调整blog格式
This commit is contained in:
parent
e4e0f2ff36
commit
f08dcf149e
|
@ -1,3 +1,4 @@
|
||||||
|
.blog
|
||||||
:marked
|
:marked
|
||||||
原文位于 <http://angularjs.blogspot.com/2017/03/angular-400-now-available.html>
|
原文位于 <http://angularjs.blogspot.com/2017/03/angular-400-now-available.html>
|
||||||
|
|
||||||
|
@ -13,21 +14,21 @@
|
||||||
|
|
||||||
我们很高兴与社区共享这个发布,在过去的三个月中,它做出了很多主要的功能增强。我们努力确保开发人员可以轻易地升级到这个版本。
|
我们很高兴与社区共享这个发布,在过去的三个月中,它做出了很多主要的功能增强。我们努力确保开发人员可以轻易地升级到这个版本。
|
||||||
|
|
||||||
## What’s New
|
# What’s New
|
||||||
|
|
||||||
## 改了什么?
|
# 改了什么?
|
||||||
|
|
||||||
### Smaller & Faster
|
## Smaller & Faster
|
||||||
|
|
||||||
### 更小、更快
|
## 更小、更快
|
||||||
|
|
||||||
In this release we deliver on our promise to make Angular applications smaller and faster. By no means are we done yet, and you'll see us being focused on making further improvements in the coming months.
|
In this release we deliver on our promise to make Angular applications smaller and faster. By no means are we done yet, and you'll see us being focused on making further improvements in the coming months.
|
||||||
|
|
||||||
在这个发布中,我们兑现了我们的承诺:让Angular应用更小、更快。但我们不会就此止步,将来,我们还会集中精力进一步提升它们。
|
在这个发布中,我们兑现了我们的承诺:让Angular应用更小、更快。但我们不会就此止步,将来,我们还会集中精力进一步提升它们。
|
||||||
|
|
||||||
#### View Engine
|
### View Engine
|
||||||
|
|
||||||
#### 视图引擎
|
### 视图引擎
|
||||||
|
|
||||||
We’ve made changes under to hood to what AOT generated code looks like. These changes reduce the size of the generated code for your components by around 60% in most cases. The more complex your templates are, the higher the savings.
|
We’ve made changes under to hood to what AOT generated code looks like. These changes reduce the size of the generated code for your components by around 60% in most cases. The more complex your templates are, the higher the savings.
|
||||||
|
|
||||||
|
@ -41,9 +42,9 @@
|
||||||
|
|
||||||
你可以阅读[设计文档](https://docs.google.com/document/d/195L4WaDSoI_kkW094LlShH6gT3B7K1GZpSBnnLkQR-g/preview)来了解我们用视图引擎做了什么。
|
你可以阅读[设计文档](https://docs.google.com/document/d/195L4WaDSoI_kkW094LlShH6gT3B7K1GZpSBnnLkQR-g/preview)来了解我们用视图引擎做了什么。
|
||||||
|
|
||||||
#### Animation Package
|
### Animation Package
|
||||||
|
|
||||||
#### 动画包
|
### 动画包
|
||||||
|
|
||||||
We have pulled animations out of `@angular/core` and into their own package. This means that if you don’t use animations, this extra code will not end up in your production bundles.
|
We have pulled animations out of `@angular/core` and into their own package. This means that if you don’t use animations, this extra code will not end up in your production bundles.
|
||||||
|
|
||||||
|
@ -53,13 +54,13 @@
|
||||||
|
|
||||||
这项改动还允许你更容易找到文档,并且从自动完成功能中获益更多。你可以自己从`@angular/platform-browser/animations`中导入`BrowserAnimationsModule`来添加动画功能。
|
这项改动还允许你更容易找到文档,并且从自动完成功能中获益更多。你可以自己从`@angular/platform-browser/animations`中导入`BrowserAnimationsModule`来添加动画功能。
|
||||||
|
|
||||||
### New Features
|
## New Features
|
||||||
|
|
||||||
### 新特性
|
## 新特性
|
||||||
|
|
||||||
#### Improved `*ngIf` and `*ngFor`
|
### Improved `*ngIf` and `*ngFor`
|
||||||
|
|
||||||
#### 强化了`*ngIf`和`*ngFor`
|
### 强化了`*ngIf`和`*ngFor`
|
||||||
|
|
||||||
Our template binding syntax now supports a couple helpful changes. You can now use an `if/else` style syntax, and assign local variables such as when unrolling an observable.
|
Our template binding syntax now supports a couple helpful changes. You can now use an `if/else` style syntax, and assign local variables such as when unrolling an observable.
|
||||||
|
|
||||||
|
@ -74,9 +75,9 @@
|
||||||
<ng-template #loading>Loading...</ng-template>
|
<ng-template #loading>Loading...</ng-template>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Angular Universal
|
### Angular Universal
|
||||||
|
|
||||||
#### Angular 统一平台(Universal)
|
### Angular 统一平台(Universal)
|
||||||
|
|
||||||
Universal, the project that allows developers to run Angular on a server, is now up to date with Angular again, and this is the first release since Universal, originally a community-driven project, was adopted by the Angular team. This release now includes the results of the internal and external work from the Universal team over the last few months. The majority of the Universal code is now located in @angular/platform-server.
|
Universal, the project that allows developers to run Angular on a server, is now up to date with Angular again, and this is the first release since Universal, originally a community-driven project, was adopted by the Angular team. This release now includes the results of the internal and external work from the Universal team over the last few months. The majority of the Universal code is now located in @angular/platform-server.
|
||||||
|
|
||||||
|
@ -86,29 +87,29 @@
|
||||||
|
|
||||||
要了解如何从Angular Universal获益,可以看看`@angular/platform-server`中的[`renderModuleFactory`](https://github.com/angular/angular/blob/56f232cdd70a352cb9151bc7cfe8981bc2710ea6/modules/%40angular/platform-server/src/utils.ts#L63-L72)方法,或者看看Rob Wormald的[演示库](https://github.com/robwormald/ng-universal-demo/)。将来我们会加入更多的文档和范例代码。
|
要了解如何从Angular Universal获益,可以看看`@angular/platform-server`中的[`renderModuleFactory`](https://github.com/angular/angular/blob/56f232cdd70a352cb9151bc7cfe8981bc2710ea6/modules/%40angular/platform-server/src/utils.ts#L63-L72)方法,或者看看Rob Wormald的[演示库](https://github.com/robwormald/ng-universal-demo/)。将来我们会加入更多的文档和范例代码。
|
||||||
|
|
||||||
#### TypeScript 2.1 and 2.2 compatibility
|
### TypeScript 2.1 and 2.2 compatibility
|
||||||
|
|
||||||
#### 与TypeScript 2.1和2.2兼容
|
### 与TypeScript 2.1和2.2兼容
|
||||||
|
|
||||||
We’ve updated Angular to a more recent version of TypeScript. This will improve the speed of ngc and you will get better type checking throughout your application.
|
We’ve updated Angular to a more recent version of TypeScript. This will improve the speed of ngc and you will get better type checking throughout your application.
|
||||||
|
|
||||||
我们已经把Angular更新扥凯恩TypeScript的最新版本。这会提升ngc的速度,而且你的应用也会获得更好地类型检查。
|
我们已经把Angular更新扥凯恩TypeScript的最新版本。这会提升ngc的速度,而且你的应用也会获得更好地类型检查。
|
||||||
|
|
||||||
#### Source Maps for Templates
|
### Source Maps for Templates
|
||||||
|
|
||||||
#### 模板的Source Maps
|
### 模板的Source Maps
|
||||||
|
|
||||||
Now when there is an error caused by something in one of your templates, we generate source maps that give a meaningful context in terms of the original template.
|
Now when there is an error caused by something in one of your templates, we generate source maps that give a meaningful context in terms of the original template.
|
||||||
|
|
||||||
现在,如果你的模板中出现了某个错误,我们会根据生成的Source Maps给出一个有意义的结果,指向原始模板中的正确位置。
|
现在,如果你的模板中出现了某个错误,我们会根据生成的Source Maps给出一个有意义的结果,指向原始模板中的正确位置。
|
||||||
|
|
||||||
### Packaging Changes
|
## Packaging Changes
|
||||||
|
|
||||||
### 包的改动
|
## 包的改动
|
||||||
|
|
||||||
#### Flat ES Modules (Flat ESM / FESM)
|
### Flat ES Modules (Flat ESM / FESM)
|
||||||
|
|
||||||
#### 扁平的ES模块 (Flat ESM / FESM)
|
### 扁平的ES模块 (Flat ESM / FESM)
|
||||||
|
|
||||||
We now ship flattened versions of our modules ("rolled up" version of our code in the EcmaScript Module format, see [example file](https://github.com/angular/core-builds/blob/85cbe3f8d6107af033b0f8b56456c181cbcb5eb7/%40angular/core.js)). This format should help tree-shaking, help reduce the size of your generated bundles, and speed up build, transpilation, and loading in the browser in certain scenarios.
|
We now ship flattened versions of our modules ("rolled up" version of our code in the EcmaScript Module format, see [example file](https://github.com/angular/core-builds/blob/85cbe3f8d6107af033b0f8b56456c181cbcb5eb7/%40angular/core.js)). This format should help tree-shaking, help reduce the size of your generated bundles, and speed up build, transpilation, and loading in the browser in certain scenarios.
|
||||||
|
|
||||||
|
@ -118,39 +119,39 @@
|
||||||
|
|
||||||
了解更多关于扁平ES模块的知识,参见["小模块的代价"](https://nolanlawson.com/2016/08/15/the-cost-of-small-modules/)。
|
了解更多关于扁平ES模块的知识,参见["小模块的代价"](https://nolanlawson.com/2016/08/15/the-cost-of-small-modules/)。
|
||||||
|
|
||||||
#### Experimental ES2015 Builds
|
### Experimental ES2015 Builds
|
||||||
|
|
||||||
#### 试验ES2015构建
|
### 试验ES2015构建
|
||||||
|
|
||||||
We now also ship our packages in the ES2015 Flat ESM format. This option is experimental and opt-in. Developers have reported up to 7% bundle size savings when combining these packages with Rollup. To try out these new packages, configure your build toolchain to resolve ["es2015" property](https://github.com/angular/core-builds/blob/dc0c8d828a8bae6591d2b9c77974271481af818c/package.json#L7) in package.json over the regular ["module" property](https://github.com/angular/core-builds/blob/dc0c8d828a8bae6591d2b9c77974271481af818c/package.json#L6).
|
We now also ship our packages in the ES2015 Flat ESM format. This option is experimental and opt-in. Developers have reported up to 7% bundle size savings when combining these packages with Rollup. To try out these new packages, configure your build toolchain to resolve ["es2015" property](https://github.com/angular/core-builds/blob/dc0c8d828a8bae6591d2b9c77974271481af818c/package.json#L7) in package.json over the regular ["module" property](https://github.com/angular/core-builds/blob/dc0c8d828a8bae6591d2b9c77974271481af818c/package.json#L6).
|
||||||
|
|
||||||
我们也把包发布成了ES2015扁平模块格式。这个选项是实验性的、可选的。开发人员报告说当把这些包和Rollup合用时节省了大约7%的体积。要试验这些新包,请把你的工具链设置为优先解析`package.json`中的[`es2015`属性](https://github.com/angular/core-builds/blob/dc0c8d828a8bae6591d2b9c77974271481af818c/package.json#L7),而不是标准的[`module`属性](https://github.com/angular/core-builds/blob/dc0c8d828a8bae6591d2b9c77974271481af818c/package.json#L6)。
|
我们也把包发布成了ES2015扁平模块格式。这个选项是实验性的、可选的。开发人员报告说当把这些包和Rollup合用时节省了大约7%的体积。要试验这些新包,请把你的工具链设置为优先解析`package.json`中的[`es2015`属性](https://github.com/angular/core-builds/blob/dc0c8d828a8bae6591d2b9c77974271481af818c/package.json#L7),而不是标准的[`module`属性](https://github.com/angular/core-builds/blob/dc0c8d828a8bae6591d2b9c77974271481af818c/package.json#L6)。
|
||||||
|
|
||||||
#### Experimental Closure Compatibility
|
### Experimental Closure Compatibility
|
||||||
|
|
||||||
#### 试验Closure兼容
|
### 试验Closure兼容
|
||||||
|
|
||||||
All of our code now has Closure annotations, making it possible to take advantage of advanced Closure optimizations, resulting in smaller bundle sizes and better tree shaking.
|
All of our code now has Closure annotations, making it possible to take advantage of advanced Closure optimizations, resulting in smaller bundle sizes and better tree shaking.
|
||||||
|
|
||||||
所有代码都有Closure注解,这样就可以获益于Closure的高级优化特性,结果就是更小的包尺寸与更好地摇树优化。
|
所有代码都有Closure注解,这样就可以获益于Closure的高级优化特性,结果就是更小的包尺寸与更好地摇树优化。
|
||||||
|
|
||||||
## Updating to 4.0.0
|
# Updating to 4.0.0
|
||||||
|
|
||||||
## 升级到 4.0.0
|
# 升级到 4.0.0
|
||||||
|
|
||||||
Updating to 4 is as easy as updating your Angular dependencies to the latest version, and double checking if you want animations. This will work for most use cases.
|
Updating to 4 is as easy as updating your Angular dependencies to the latest version, and double checking if you want animations. This will work for most use cases.
|
||||||
|
|
||||||
升级到4,简单到几乎只需要把你的Angular依赖改为最新版本。如果你需要动画才需要再次检查一下。对大多数用户都是这样。
|
升级到4,简单到几乎只需要把你的Angular依赖改为最新版本。如果你需要动画才需要再次检查一下。对大多数用户都是这样。
|
||||||
|
|
||||||
#### On Linux/Mac:
|
### On Linux/Mac:
|
||||||
|
|
||||||
#### 在Linux/Mac上
|
### 在Linux/Mac上
|
||||||
|
|
||||||
`npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@latest typescript@latest --save`
|
`npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@latest typescript@latest --save`
|
||||||
|
|
||||||
#### On Windows:
|
### On Windows:
|
||||||
|
|
||||||
#### 在Windows上:
|
### 在Windows上:
|
||||||
|
|
||||||
`npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save`
|
`npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save`
|
||||||
|
|
||||||
|
@ -167,17 +168,17 @@
|
||||||
|
|
||||||
我们已经开始了交互式[Angular升级向导](https://angular-update-guide.firebaseapp.com/)的开发工作,借助它你可以得到升级时要对你的应用程序做什么改动的更多信息。
|
我们已经开始了交互式[Angular升级向导](https://angular-update-guide.firebaseapp.com/)的开发工作,借助它你可以得到升级时要对你的应用程序做什么改动的更多信息。
|
||||||
|
|
||||||
## Known Issues
|
# Known Issues
|
||||||
|
|
||||||
## 已知问题
|
# 已知问题
|
||||||
|
|
||||||
One of the goals for version 4 was to make Angular compatible with TypeScript's [strictNullChecks](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html) setting, allowing for a more restrictive subset of types to be mandated. We discovered during the RC period that there is more work to be done for this to function properly in all use cases, so we intentionally made 4.0 incompatible with the strictNullChecks setting in order to avoid breaking apps that would otherwise eagerly adopt this TypeScript mode when the proper support lands in 4.1 (tracking issue is [#15432](https://github.com/angular/angular/issues/15432)).
|
One of the goals for version 4 was to make Angular compatible with TypeScript's [strictNullChecks](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html) setting, allowing for a more restrictive subset of types to be mandated. We discovered during the RC period that there is more work to be done for this to function properly in all use cases, so we intentionally made 4.0 incompatible with the strictNullChecks setting in order to avoid breaking apps that would otherwise eagerly adopt this TypeScript mode when the proper support lands in 4.1 (tracking issue is [#15432](https://github.com/angular/angular/issues/15432)).
|
||||||
|
|
||||||
第四版的目标之一是让Angular兼容TypeScript的[`strictNullChecks`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html)设置,允许对类型的子集进行更多限定。我们在RC阶段讨论过,要让这个功能在更多用例中工作需要付出更多的努力,所以我们决定让4.0线不兼容`strictNullChecks`选项,从而避免破坏现有应用,我们准备在4.1中再采纳它(它的跟踪issue是[#15432](https://github.com/angular/angular/issues/15432))
|
第四版的目标之一是让Angular兼容TypeScript的[`strictNullChecks`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html)设置,允许对类型的子集进行更多限定。我们在RC阶段讨论过,要让这个功能在更多用例中工作需要付出更多的努力,所以我们决定让4.0线不兼容`strictNullChecks`选项,从而避免破坏现有应用,我们准备在4.1中再采纳它(它的跟踪issue是[#15432](https://github.com/angular/angular/issues/15432))
|
||||||
|
|
||||||
## What's next?
|
# What's next?
|
||||||
|
|
||||||
## 以后呢?
|
# 以后呢?
|
||||||
|
|
||||||
We are in the process of setting the roadmap for the next 6 months, following the same cadence as our [published release schedule](https://github.com/angular/angular/blob/master/docs/RELEASE_SCHEDULE.md) for 2.x. You'll see patch updates to 4.0.0 and we are already getting started on 4.1. We are going to continue making Angular smaller and faster, and we're going to evolve capabilities such as @angular/http, @angular/service-worker, and @angular/language-service out of experimental.
|
We are in the process of setting the roadmap for the next 6 months, following the same cadence as our [published release schedule](https://github.com/angular/angular/blob/master/docs/RELEASE_SCHEDULE.md) for 2.x. You'll see patch updates to 4.0.0 and we are already getting started on 4.1. We are going to continue making Angular smaller and faster, and we're going to evolve capabilities such as @angular/http, @angular/service-worker, and @angular/language-service out of experimental.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
.blog {
|
||||||
|
|
||||||
|
h1, h2, h3 {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,6 +15,7 @@
|
||||||
@import 'theme';
|
@import 'theme';
|
||||||
@import 'angular';
|
@import 'angular';
|
||||||
@import "translate";
|
@import "translate";
|
||||||
|
@import "blog";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue