rollup_Visual Studio 2012 RC发布-The Big Web Rollup

rollup

rollup

Today Visual Studio 2012 RC (Release Candidate) came out. (It's 2012, so 11 make less sense than 2010+2) There's a lot of nice improvements for Web Development in this release candidate as we march towards a final release. Here's some of my favorite new features from the "Angle Brackets Team." That's my name for the Web Platform and Tools team. I hope it sticks.

今天, Visual Studio 2012 RC(候选版本)问世了。 (现在是2012年,所以11的意义不及2010 + 2)。在我们迈向最终版本的过程中,此候选版本中的Web开发有很多不错的改进。 这是“角度支架团队”中我最喜欢的一些新功能。 这就是Web平台和工具团队的名字。 我希望它坚持下去。

网站优化 (Web Optimization)

There's been some significant changes to the web optimization (minification and bundling) framework since beta. There wasn't enough control over what was bundled and in what order in the beta, so that's been moved into a BundleConfig.cs (or .vb) where you have total control, but everything just works out of the box. The API has been simplified and is slightly more fluent which means it's easier to read and easier to write.

自Beta版以来,网络优化(最小化和捆绑)框架发生了一些重大变化。 对beta中捆绑的内容和顺序没有足够的控制,因此已将其移到BundleConfig.cs(或.vb)中,您可以完全控制它,但是一切都可以直接使用。 该API已进行了简化,并且稍微更流畅,这意味着它更易于阅读和编写。

Rendering bundles in Beta required some goofy syntax and a lot of repetitive namespaces. In RC it's nice and simple:

Beta中的渲染包需要使用一些愚蠢的语法和许多重复的名称空间。 在RC中,它很简单:

@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/Scripts/js")

And you can change with a params array:

您可以使用params数组进行更改:

@Styles.Render("~/Content/themes/base/css", "~/Content/css")

Also, bundles aren't bundled when you're in debug mode but are when released without you having to change your markup. The regular compilation flag in web.config controls it and you can certainly override with the BundleTable.EnableOptmizations property if you have specific needs.

同样,当您处于调试模式时,捆绑软件不会捆绑在一起,但在发布时无需更改标记。 web.config中的常规编译标志对其进行控制,如果您有特定需要,可以使用BundleTable.EnableOptmizations属性进行覆盖。


   
   

The best part is that you can plug in custom libraries. If you don't like the included minification technique or perhaps want to add your own, you can. Howard and the team showed me this small example to add support for LESS files and turn them into CSS as a transform, then minify the results.

最好的部分是您可以插入自定义库。 如果您不喜欢包含的缩小技术,或者想添加自己的缩小技术,则可以。 霍华德和团队向我展示了这个小示例,它增加了对LESS文件的支持,并将其转换为CSS,然后将结果最小化。

public class LessTransform : IBundleTransform
{
public void Process(BundleContext context, BundleResponse response)
{
response.Content = dotless.Core.Less.Parse(response.Content);
response.ContentType = "text/css";
}
}

Then bundle up the *.less files and transform them as you like.

然后捆绑* .less文件并根据需要进行转换。

var lessBundle = new Bundle("~/My/Less").IncludeDirectory("~/My", "*.less");
lessBundle.Transforms.Add(new LessTransform());
lessBundle.Transforms.Add(new CssMinify());
bundles.Add(lessBundle);

模板等 (Templates and more)

Having good Templates is very important and we'll have even more additions and improvements to templates between now and the final release. Also, because the Web Team has externalized the templates (the web templates themselves are extensions that can be updated out of band) you can expect cool and useful updates even beyond the final release. The Web tends to move fast and we'd like to move fast as well.

拥有好的模板非常重要,从现在到最终版本之间,我们将对模板进行更多的添加和改进。 另外,由于Web团队已将模板外部化(Web模板本身是可以带外更新的扩展),因此您可以期待很酷且有用的更新,甚至超越最终版本。 网络趋向于快速发展,我们也希望快速发展。

There's an Empty template introduced for ASP.NET MVC. Like really empty. Folks asked for it! The markup is cleaner in all templates and as before, is HTML5 by default.

为ASP.NET MVC引入了一个Empty模板。 像真的是空的。 人们要求它! 在所有模板中,标记更干净,默认情况下为HTML5。

The ASP.NET Web Forms template includes support for the Web Optimization framework as mentioned above. ASP.NET Web Forms (like it or not, haters! ;) ) continues to share features with ASP.NET MVC because, as I've said before, it's all One ASP.NET. That means Routing, Providers, Model Binding, HTML5 support, Web Optimization and more are all features you can count on. They are part of ASP.NET no matter which framework you're choosing to use.

如上所述,ASP.NET Web表单模板包括对Web优化框架的支持。 ASP.NET Web窗体(不管喜欢与否,讨厌!!))继续与ASP.NET MVC共享功能,因为正如我之前说过的,这都是一个ASP.NET。 这意味着路由,提供程序,模型绑定,HTML5支持,Web优化等都是您可以依靠的功能。 无论您选择使用哪种框架,它们都是ASP.NET的一部分。

Web API now includes scaffolding support (and Web Forms will soon as well) so you can easily make a CRUD (Create, Read, Update, Delete) API from your model. As with all scaffolding, you can customize it as you like.

Web API现在包括脚手架支持(以及Web窗体也将很快提供),因此您可以轻松地从模型中制作CRUD(创建,读取,更新,删除)API。 与所有脚手架一样,您可以根据需要自定义它。

Web API has Scaffolding too!

I also like that we're shipping Modernizr, Knockout, jQuery, jQuery validation and jQuery Mobile in our templates and you can bring it hundreds more with NuGet as you like.

我也喜欢我们在模板中提供Modernizr,Knockout,jQuery,jQuery验证和jQuery Mobile,并且您可以根据需要使用NuGet将其带入数百个。

前端Web开发人员的小小快乐功能 (Tiny Happy Features for Front End Web Developers)

Take note, front end people. The team has looked at the complete experience from File | New Project, through development and debugging and tried to (and continues to tyy to) improve the "tiny cuts" that hurt you when developing web apps. Big new features are fun, but sometimes little features that fit into the middle of your workflow make life better and smooth the way. I like tiny happy features.

注意,前端人员。 团队已经从File | 新项目通过开发和调试,并试图(并且继续尝试)改进在开发Web应用程序时伤害您的“小技巧”。 大型的新功能很有趣,但是有时候,适合您工作流程中间的一些功能会使生活变得更好,更顺畅。 我喜欢微小的快乐功能。

If you pull the Debug menu down you'll see it finds all your browsers so you can not only use the one you like without hunting but also change your default quickly. Plus, they've added a Browse With menu to this pull down so ASP.NET MVC folks don't have to go digging for it in right-click context menus.

如果将“调试”菜单下拉,则会看到该菜单会找到您的所有浏览器,因此您不仅可以使用自己喜欢的浏览器而无需搜索,还可以快速更改默认设置。 另外,他们在此下拉菜单中添加了“浏览方式”菜单,因此ASP.NET MVC的人们不必在右键单击上下文菜单中进行挖掘。

The debug dropdown now include a Browse With option

If you select Browse With it'll bring up this familiar dialog. Now, try Ctrl-clicking on multiple browsers and click Browse.

如果选择“浏览方式”,则会弹出一个熟悉的对话框。 现在,尝试在多个浏览器上按住Ctrl键并单击,然后单击“浏览”。

Browse With supports multiple selection

The toolbar will change so now you can startup more than one browser with one click, with with F5 or Ctrl-F5.

工具栏将发生变化,因此现在您可以使用F5或Ctrl-F5一键启动多个浏览器。

Multiple Browsers is a choice now for launching your app

When you click it, you can select a specific browser for step-through debugging, then the other browser will launch as well.

单击它时,可以选择特定的浏览器进行逐步调试,然后另一个浏览器也会启动。

Pick a browser for debugging

This is a small, but happy feature that I appreciate.

这是一个小功能,但我很高兴。

CSS,JavaScript和HTML编辑器的改进 (CSS, JavaScript, and HTML Editor Improvements)

Dozens and dozens of improvements and new "smarts" have gone into the CSS, JavaScript and HTML editors. For example, the HTML editor is updated with the latest HTML5 intellisense and validation based on the latest W3C standards. All the attributes and tags that you want are there.

CSS,JavaScript和HTML编辑器中进行了数十种改进和新的“智能”。 例如,HTML编辑器将根据最新的W3C标准使用最新HTML5智能感知和验证进行更新。 所需的所有属性和标签都在这里。

aria and data attributes are available

If I type a hyphen (dash) in the CSS editor I get a smart list of all the vendor specific prefixes, even Opera! These lists include help text as well for properties which was no small amount of work.

如果在CSS编辑器中键入连字符(破折号),我将获得所有特定于供应商的前缀的智能列表,甚至包括Opera! 这些列表还包括帮助文本,这些帮助文本的工作量很小。

We love you Opera, honest.

There's drop-downs and pickers for fonts and colors (my favorite) as well as a color picker.

有用于字体和颜色的下拉列表和选择器(我最喜欢)以及颜色选择器。

That's a color picker, my friend

These are just a few bits of polish. There's lots of new snippets and expansions as well.

这些只是点点滴滴。 还有很多新的摘要和扩展。

出版 (Publishing )

Be sure to sign up for the 6/7 Meet Windows Azure event with Scott Gu online to see some VERY cool improvements to publishing in Visual Studio. Before then, you can check out new features for Publishing like:

请确保在线注册Scott Gu参加6/7 Meet Windows Azure活动,以了解在Visual Studio中发布的一些非常酷的改进。 在此之前,您可以签出发布的新功能,例如:

  • Updated cleaner and simpler publish UI

    更新了更简洁的发布UI
  • Running EF Code First migrations on the publish dialog

    在发布对话框上运行EF Code First迁移
  • Incremental database schema publish and preview

    增量数据库架构发布和预览
  • Update connection strings in web.config on publish (including complex EF connection strings)

    在发布时更新web.config中的连接字符串(包括复杂的EF连接字符串)
  • Prompting for untrusted certificates on publish dialog during publish

    在发布过程中在发布对话框中提示不受信任的证书
  • Automatically convert VS2010 publish profiles to the new VS2012 format

    自动将VS2010发布配置文件转换为新的VS2012格式
  • You can easily publish from the command line using a publish profile:

    您可以使用发布配置文件从命令行轻松发布:

    • msbuild mywap.csproj /p:DeployOnBuild=true;PublishProfile=MyProfileName

      msbuild mywap.csproj / p:DeployOnBuild = true; PublishProfile = MyProfileName
  • You can also create profile specific transforms, i.e. web.Production.config, but we haven’t updated the tooling yet to create these. In this case if you have a profile specific transform we will execute the build config one first and then the profile one.

    您还可以创建特定于配置文件的转换,即web.Production.config,但我们尚未更新工具来创建这些转换。 在这种情况下,如果您有一个特定于配置文件的转换,我们将首先执行构建配置,然后再执行一个配置文件。

ASP.NET和ASP.NET Web表单 (ASP.NET and ASP.NET Web Forms)

In addition to the new features I've talked about before like Model Binding and better HTML5 support there's:

除了我之前讨论的新功能(例如模型绑定)和更好HTML5支持之外,还有:

  • Updates to assist in async ASP.NET development:

    更新以协助异步ASP.NET开发:

    • HttpResponse.ClientDisconnectedToken: A CancellationToken that asynchronously notifies the application when a client has disconnected from the underlying web server.

      HttpResponse.ClientDisconnectedToken:一个CancellationToken,当客户端与基础Web服务器断开连接时,该异步通知应用程序。
    • HttpRequest.TimedOutToken: A CancellationToken that asynchronously notifies the application when a request has run longer than the configured request timeout value.

      HttpRequest.TimedOutToken:一个CancellationToken,当请求的运行时间超过配置的请求超时值时,该异步通知应用程序。
    • HttpContext.ThreadAbortOnTimeout: Allows applications to control the behavior of timed out requests. Defaults to true. When set to false ASP.NET will not Thread Abort the request but rather leave it to the application to end the request.

      HttpContext.ThreadAbortOnTimeout:允许应用程序控制超时请求的行为。 默认为true。 设置为false时,ASP.NET不会“线程中止”请求,而是将其留给应用程序以结束请求。
    • Protection against race conditions and deadlocks that can be introduced by starting async work at invalid times in the request pipeline

      通过在请求管道中的无效时间启动异步工作来防止出现竞争状况和死锁
  • Added ability for applications to forcibly terminate the underlying TCP connection of a request via HttpRequest.Abort()

    应用程序增加了通过HttpRequest.Abort()强制终止请求的基础TCP连接的功能
  • Improved support for async in Web Forms including support for async page & control event handlers

    改进了对Web窗体中异步的支持,包括对异步页面和控件事件处理程序的支持
  • ScriptManager support for the new ASP.NET bundling & minification library

    ScriptManager对新的ASP.NET捆绑和缩小库的支持
  • Improvements for extending the Web Forms compilation system:

    扩展Web窗体编译系统的改进:

    • New ControlBuilderInterceptor class to enable customization of the Web Forms page & control compilation output

      新的ControlBuilderInterceptor类可自定义Web窗体页面和控件编译输出
    • TemplateParser.ParseTemplate method that allows the application to generate an ITemplate instance from a string of ASPX markup

      TemplateParser.ParseTemplate方法,该方法允许应用程序从ASPX标记的字符串生成ITemplate实例
  • Support for Entity Framework enums and spatial data types in Dynamic Data

    支持动态数据中的实体框架枚举和空间数据类型

ASP.NET Web API和MVC(ASP.NET Web API and MVC)

Both ASP.NET MVC and ASP.NET Web API have had a number of improvements since Beta.

自Beta版以来,ASP.NET MVC和ASP.NET Web API均进行了许多改进。

  • We now use and support the open source Json.NET serializer for handling of JSON data.

    现在,我们使用并支持开源Json.NET序列化程序来处理JSON数据。

  • You now can easily build custom help and test pages for your web APIs by using the new IApiExplorer service to get a complete runtime description of your web APIs.

    现在,您可以使用新的IApiExplorer服务轻松地为Web API构建自定义的帮助和测试页面,以获取Web API的完整运行时描述。
  • ASP.NET Web API now provides light weight tracing infrastructure that makes it easy to integrate with existing logging solutions such as System.Diagnostics, ETW and third party logging frameworks. You can enable tracing by providing an ITraceWriter implementation and adding it to your web API configuration.

    ASP.NET Web API现在提供了轻量级跟踪基础结构,可以轻松地与现有的日志记录解决方案(例如System.Diagnostics,ETW和第三方日志记录框架)集成。 您可以通过提供ITraceWriter实现并将其添加到Web API配置中来启用跟踪。
  • Use the ASP.NET Web API UrlHelper to generate links to related resources in the same application.

    使用ASP.NET Web API UrlHelper可以生成指向同一应用程序中相关资源的链接。
  • ASP.NET Web API provides better support for IoC containers through an improved dependency resolver abstraction

    ASP.NET Web API通过改进的依赖关系解析器抽象为IoC容器提供了更好的支持
  • Use the Add Controller dialog to quickly scaffold a web API controller based on an Entity Framework based model type.

    使用“添加控制器”对话框可基于基于实体框架的模型类型快速搭建Web API控制器。
  • Create a unit test project along with your Web API project to get started quickly writing unit tests for your Web API functionality.

    与Web API项目一起创建一个单元测试项目,以快速开始为Web API功能编写单元测试。
  • EF 5 database migrations included out of the box in the ASP.NET MVC 4 Basic Template

    EF 5数据库迁移已包含在ASP.NET MVC 4基本模板中
  • Add Controller to any project folder

    将Controller添加到任何项目文件夹
  • Bundling and minification built in

    内置捆绑和缩小
  • The configuration logic For MVC applications has been moved from Global.asax.cs to a set of static classes in the App_Start directory. Routes are registered in RouteConfig.cs. Global MVC filters are registered in FilterConfig.cs. Bundling and minification configuration now lives in BundleConfig.cs.

    MVC应用程序的配置逻辑已从Global.asax.cs移至App_Start目录中的一组静态类。 路由在RouteConfig.cs中注册。 全局MVC筛选器在FilterConfig.cs中注册。 捆绑和缩小配置现在位于BundleConfig.cs中。

Visual Studio主题 (Visual Studio Theme)

Ah, the controversial theme change. They've added a bunch of splashes of color, brightened the background and made the status bar change color depending on your status. I'm not sure what I think about the ALL CAPS menus but I honestly don't look at them much. They seem to be the last thing that folks are freaking out about. My guess (I am NOT a designer) is that there's an implied horizontal rule along the top edge of the letters and if you used mixed case they'd just be floating words. We'll see what happens, maybe it'll be a option to change, maybe not. I'm more worried about the web functionality than the look of the menus. I think the RC looks way way better than the initial Beta, myself, and I understand there are more changes coming as well as clearer icons in the dark theme for the final release. You can read more and look at side by side examples and decide for yourself at the Visual Studio Blog. It's growing on me.

啊,有争议的主题改变。 他们添加了一堆颜色,照亮了背景,并使状态栏根据您的状态更改颜色。 我不确定我对“所有大写字母”菜单的看法,但是老实说我不太看这些菜单。 他们似乎是人们最害怕的事情。 我的猜测(我不是设计师)是,在字母的顶部边缘有一个隐含的水平线,如果使用混合大小写,它们只是浮空字。 我们将看到发生了什么,也许它将是更改的一种选择,也许不是。 我比菜单的外观更担心Web功能。 我认为RC看起来比最初的Beta测试版要好得多,而且我知道最终版本的深色主题中会有更多更改以及更清晰的图标。 您可以阅读更多内容,并排查看示例,并在Visual Studio Blog中自行决定。 它在我身上成长。

I've even tried out the Dark Theme along with Rob's Wekeroad Ink theme from http://studiostyl.es. While I'm not sure if I'm ready to fully make the dark theme switch, it's pretty nice.

我什至从http://studiostyl.es尝试了Dark主题和Rob的Wekeroad Ink主题。 虽然我不确定是否准备好完全进行黑暗主题切换,但它非常不错。

其他非Webby功能 (Other non-Webby Features)

Some other features and cool things of note to me (there are lots more than this) are:

我需要注意的其他一些功能和很酷的东西(还有很多其他功能)是:

  • Customization is back to make for a smaller installation.

    定制又回来了,以进行较小的安装。
  • Install the RC directly over the Beta. No need to uninstall. Whew!

    直接在Beta上安装RC。 无需卸载。 ew!

  • Windows Vista support for .NET Framework 4.5

    Windows Vista对.NET Framework 4.5的支持
  • XAML compiler incremental builds in Metro apps is now twice as fast as beta.

    Metro应用程序中的XAML编译器增量生成现在是Beta的两倍

  • Go-Live license, which means you can publish apps live today and get support if you need it.

    上线许可证,这意味着您可以立即发布实时应用程序,并在需要时获得支持。

晦涩的陷阱和已知问题 (Obscure Gotchas and Known Issues)

Be sure to go through the readme to make sure that there aren't known issues that might mess you up. As with all pre-release software, be careful. Test things and don't blindly install on systems you care about. I'm installing this "on the metal" but I'm keeping a Visual Studio 2010 SP1 virtual machine around just in case something obscure is discovered.

确保阅读自述文件,以确保不存在可能使您感到困惑的已知问题。 与所有预发行软件一样,请小心。 测试事物,不要盲目安装在您关心的系统上。 我正在“在金属上”安装此软件,但我会保留Visual Studio 2010 SP1虚拟机,以防万一发现某些晦涩难懂的内容。

One gotcha that I know of so far for those of you who are totally riding the beta train. If you install Visual Studio 2012 RC on Windows 8 Release Preview and are trying to get an ASP.NET 3.5 (that's 3.5, be aware) application to work, you'll have trouble with IIS Express. You can work around it by installing IIS8 from the Windows 8 Add Features control panel. Just installing IIS8 will fix a bad registry key created by IIS8 Express. This will be fixed in release. Obscure, but worth noting.

到目前为止,对于那些完全乘坐Beta火车的人来说,这是我所知道的。 如果在Windows 8 Release Preview上安装Visual Studio 2012 RC并尝试使ASP.NET 3.5(请注意,即3.5)应用程序正常工作,则IIS Express将会遇到麻烦。 您可以通过从Windows 8“添加功能”控制面板安装IIS8来解决此问题。 仅安装IIS8即可解决IIS8 Express创建的错误注册表项。 这将在发行版中修复。 晦涩,但值得注意。

相关链接 (Related Links)

所有下载链接-包括ISO内的离线安装程序(All The Download Links - including OFFLINE installers inside ISOs)

翻译自: https://www.hanselman.com/blog/visual-studio-2012-rc-is-released-the-big-web-rollup

rollup

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
@rollup/plugin-dynamic-import-vars 是一个 Rollup 插件,用于处理动态导入(Dynamic Import)语法中的变量部分。 在 ES 模块中,我们可以使用动态导入语法来动态加载模块。而 @rollup/plugin-dynamic-import-vars 插件则是为了解决在动态导入语法中使用变量引用的问题。 当我们在动态导入语法中使用变量时,Rollup 默认会将该变量视为一个字符串,而不是实际的变量引用。这样就无法准确地确定被导入模块的路径。例如: ```javascript const modulePath = './path/to/module.js'; import(modulePath).then(module => { // ... }); ``` 在上述代码中,modulePath 是一个变量,它存储了被导入模块的路径。然而,默认情况下,Rollup 会将该变量视为字符串,导致无法正确解析模块路径。 @rollup/plugin-dynamic-import-vars 插件的作用就是在构建过程中解析这些变量引用,并将其正确地转换为模块路径。通过该插件,我们可以顺利地将动态导入的模块正确地导入并使用。 需要注意的是,使用该插件时,我们需要保证变量引用是由静态可确定的值构成,如果变量引用是动态的、不可确定的,则插件无法正确处理。因此,在使用该插件时,我们需要遵循一定的限制,以确保构建过程的准确性和稳定性。 总之,@rollup/plugin-dynamic-import-vars 是一个用于处理动态导入语法中变量引用的 Rollup 插件,可以解决默认情况下变量引用视为字符串的问题,确保动态导入模块的正确构建。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值