-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: minor update for readability and formatting #2243
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,15 +32,15 @@ We also produce JS code which can be loaded faster (using named AMD module forma | |
|
||
## Installation | ||
|
||
Add a devDependency on `@bazel/typescript` | ||
Add a `devDependency` on `@bazel/typescript` | ||
|
||
```sh | ||
$ yarn add -D @bazel/typescript | ||
# or | ||
$ npm install --save-dev @bazel/typescript | ||
``` | ||
|
||
Watch for any peerDependency warnings - we assume you have already installed the `typescript` package from npm. | ||
Watch for any `peerDependency` warnings - we assume you have already installed the `typescript` package from npm. | ||
|
||
Create a `BUILD.bazel` file in your workspace root. If your `tsconfig.json` file is in the root, use | ||
|
||
|
@@ -61,9 +61,9 @@ Make sure to remove the `--noEmit` compiler option from your `tsconfig.json`. Th | |
|
||
## Self-managed npm dependencies | ||
|
||
We recommend you use Bazel managed dependencies but if you would like | ||
We recommend you use Bazel managed dependencies, but if you would like | ||
Bazel to also install a `node_modules` in your workspace you can also | ||
point the `node_repositories` repository rule in your WORKSPACE file to | ||
point the `node_repositories` repository rule in your `WORKSPACE` file to | ||
your `package.json`. | ||
|
||
```python | ||
|
@@ -112,14 +112,14 @@ nodejs_binary( | |
) | ||
``` | ||
|
||
See https://github.com/bazelbuild/rules_nodejs#dependencies for more information on | ||
See <https://github.com/bazelbuild/rules_nodejs#dependencies> for more information on | ||
managing npm dependencies with Bazel. | ||
|
||
## Customizing the TypeScript compiler binary | ||
|
||
An example use case is needing to increase the NodeJS heap size used for compilations. | ||
|
||
Similar to above, you declare your own binary for running tsc_wrapped, e.g.: | ||
Similar to above, you declare your own binary for running `tsc_wrapped`, e.g.: | ||
|
||
```python | ||
nodejs_binary( | ||
|
@@ -141,9 +141,9 @@ nodejs_binary( | |
then refer to that target in the `compiler` attribute of your `ts_library` rule. | ||
|
||
Note that `nodejs_binary` targets generated by `npm_install`/`yarn_install` can include data dependencies | ||
on packages which aren't declared as dependencies. For example, if you use [tsickle] to generate Closure Compiler-compatible JS, then it needs to be a `data` dependency of `tsc_wrapped` so that it can be loaded at runtime. | ||
 | ||
[tsickle]: https://github.com/angular/tsickle | ||
on packages which aren't declared as dependencies. For example, if you use [tsickle] to generate Closure Compiler-compatible JS, then it needs to be a data dependency of `tsc_wrapped` so that it can be loaded at runtime. | ||
|
||
[tsickle](https://github.com/angular/tsickle) | ||
|
||
## Usage | ||
|
||
|
@@ -227,7 +227,7 @@ This is for a couple reasons: | |
|
||
- help ensure that downstream rules which access default outputs will not require | ||
a cascading re-build when only the implementation changes but not the types | ||
- make you think about whether you want the devmode (named UMD) or prodmode outputs | ||
- make you think about whether you want the `devmode` (named `UMD`) or `prodmode` outputs | ||
|
||
You can access the JS output by adding a `filegroup` rule after the `ts_library`, | ||
for example | ||
|
@@ -341,8 +341,8 @@ from `ts_library` rules which set the `module_name` attribute. | |
If you'd like a "watch mode", try [ibazel]. | ||
|
||
At some point, we plan to release a tool similar to [gazelle] to generate the | ||
BUILD files from your source code. | ||
`BUILD` files from your source code. | ||
|
||
[gazelle]: https://github.com/bazelbuild/rules_go/tree/master/go/tools/gazelle | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why did you inline these? it's easier to read the text as-is IMO |
||
[gazelle]: https://github.com/bazelbuild/bazel-gazelle | ||
[ibazel]: https://github.com/bazelbuild/bazel-watcher | ||
[path mapping]: https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one was correct before - actually there was just a garbage character non line 145 messing up the formatting