docs: Redirect /guide/bazel to deprecation doc in Angular repo (#37190)
This commit adds a 301 redirect for /guide/bazel on angular.io to the deprecation doc for Angular Bazel schematics in Angular repo. PR Close #37190
This commit is contained in:
parent
1fc7891add
commit
e64176019a
|
@ -18,6 +18,7 @@
|
|||
{"type": 301, "source": "/docs/*/latest/quickstart.html", "destination": "/start"},
|
||||
{"type": 301, "source": "/docs/*/latest/guide/server-communication.html", "destination": "/guide/http"},
|
||||
{"type": 301, "source": "/docs/*/latest/guide/style-guide.html", "destination": "/guide/styleguide"},
|
||||
{"type": 301, "source": "/guide/bazel", "destination": "https://github.com/angular/angular/blob/master/packages/bazel/src/schematics/README.md"},
|
||||
{"type": 301, "source": "/guide/cli-quickstart", "destination": "/start"},
|
||||
{"type": 301, "source": "/guide/service-worker-getstart", "destination": "/guide/service-worker-getting-started"},
|
||||
{"type": 301, "source": "/guide/service-worker-comm", "destination": "/guide/service-worker-communications"},
|
||||
|
|
|
@ -2,43 +2,39 @@
|
|||
|
||||
Bazel builder for Angular CLI has been deprecated.
|
||||
|
||||
**tl;dr: We have deprecated the the Bazel builder and schematics for Angular CLI. As of Angular v10 we removed the ability to call `ng add @angular/bazel` to convert existing Angular CLI projects to use Bazel. We believe that some Angular projects can greatly benefit from using Bazel - these projects should use Bazel Web directly as documented in the [canonical example in the Bazel Web repo](https://github.com/bazelbuild/rules_nodejs/tree/master/examples/angular).**
|
||||
We believe that a lot of projects would benefit from directly using Bazel, the same way we do in Angular. Validating the experimental Bazel schematics for the Angular CLI for the past year as part of Angular Labs, we concluded that they don't implement the most optimal approach. In v10, we're deprecating `@angular/bazel` and encouraging developers to explore using Bazel directly following the [canonical example](https://github.com/bazelbuild/rules_nodejs/tree/master/examples/angular).
|
||||
|
||||
The schematics for Bazel builder have been in Angular Labs for some time. Via labs we have been able to experiment with wrapping Bazel into the CLI and make it's use in the CLI invisible to developers using Angular CLI.
|
||||
Using the Bazel builder, we abstracted the build file management and tooling orchestration, making Bazel invisible for developers.
|
||||
|
||||
Through this experiment we, the Angular team have found that wrapping Bazel into Angular CLI does currently not meet our expectation of providing a great experience to developers using Angular.
|
||||
Through this experiment, we found that wrapping Bazel into Angular CLI does currently not meet our expectation of providing a great experience to developers.
|
||||
|
||||
|
||||
There are multiple factors:
|
||||
There are a few reasons we're taking this path:
|
||||
|
||||
1. Bazel ecosystem for the Web is still evolving at a rapid pace.
|
||||
2. The introduction of the Angular Ivy compiler enables new ways to use Bazel in a faster
|
||||
and more efficient manner.
|
||||
3. Feature parity with Webpack based Angular CLI is currently difficult to achieve without trade offs that would not be acceptable for many Angular users.
|
||||
3. Feature parity with Webpack based Angular CLI is currently difficult to achieve without trade-offs that would not be acceptable for many Angular users.
|
||||
|
||||
For users who are currently using Bazel builder, there are a few migration
|
||||
options.
|
||||
|
||||
## View Engine
|
||||
|
||||
If your application is using View Engine, you could leave the Bazel files
|
||||
in your workspace, and manage them manually.
|
||||
|
||||
|
||||
## Migrate from `@angular/bazel`
|
||||
|
||||
For users who are currently using Bazel builder, there are a few migration options.
|
||||
|
||||
### Eject the build config
|
||||
|
||||
You could leave the Bazel files in your workspace, and manage them manually:
|
||||
|
||||
```
|
||||
ng build --leaveBazelFilesOnDisk
|
||||
```
|
||||
|
||||
## Ivy
|
||||
|
||||
If your application is using Ivy, you should also leave the Bazel files on disk.
|
||||
|
||||
```
|
||||
ng build --leaveBazelFilesOnDisk
|
||||
```
|
||||
|
||||
Once that is done, switch to using the latest [`ng_ts_library`](https://github.com/bazelbuild/rules_nodejs/blob/master/examples/angular/tools/angular_ts_library.bzl) rule.
|
||||
This new rule leverages ngtsc plugin supported by `ts_library`, and it is much
|
||||
faster.
|
||||
If you're using Ivy, in your build files replace `ng_module` with the [`ng_ts_library`](https://github.com/bazelbuild/rules_nodejs/blob/master/examples/angular/tools/angular_ts_library.bzl) rule. This new rule leverages ngtsc plugin supported by `ts_library`, and it is much faster.
|
||||
|
||||
For the latest recommendations, please refer to the canonical Angular Bazel [repo](https://github.com/bazelbuild/rules_nodejs/tree/master/examples/angular).
|
||||
|
||||
|
|
Loading…
Reference in New Issue