Repository navigation
build: create JS bundles for each component - #6998
Conversation
| "stripInternal": false, | ||
| "experimentalDecorators": true, | ||
| "noUnusedParameters": true, | ||
| "noUnusedParameters": false, |
There was a problem hiding this comment.
Why are we no longer having this check? Maybe add a comment if necessary
There was a problem hiding this comment.
Was just trying something during development; reverted
| module: `../@angular/${packageName}/${entryPointName}.es5.js`, | ||
| es2015: `../@angular/${packageName}/${entryPointName}.js`, | ||
| module: `../esm5/${packageName}/${entryPointName}.es5.js`, | ||
| es2015: `../esm2015/${packageName}/${entryPointName}.js`, |
There was a problem hiding this comment.
Out of curiosity: How does this work with Closure Compiler now? Is there an alternative to the js_module_roots option?
There was a problem hiding this comment.
Short answer: it doesn't.
I updated the script and left a comment explaining the current situation w/ closure.
| "flatModuleId": "@angular/material", | ||
| "skipTemplateCodegen": true | ||
| } | ||
| } |
There was a problem hiding this comment.
Is that file used anywhere? We now have three tsconfig-XX files in the lib/ package.
There was a problem hiding this comment.
I was just trying something out with this, meant to delete it.
8d1216a to
f50ea1a
Compare
|
f50ea1a to
ad93c97
Compare
|
@devversion after this PR we're definitely going to have to parallelize the typescript builds and bundling. With this change it takes over a minute. To paralleize the tasks, we'll need to manually spawn a child process for each, since nodejs is single-threaded. We also probably want to tweak the watch tasks to only re-compile the sub-packages that changed. Let me know if you want to work on all that. All of this will be obsolete when we switch to bazel, but we're at least a month away from making that switch. |
devversion
left a comment
There was a problem hiding this comment.
@jelbourn That makes sense. In regards to the tsconfig per package directory, didn't the tsconfig in the project root work anymore?
Also LGTM! Nice
|
@devversion the tsconfig in the root would cause IDEs to autogenerate the wrong imports sometimes. |
Before this change, all of `@angular/material` was bundled into a
single, flat JS file.
After this change, each top-level component (i.e., each directory under
`src/lib`) will be have its own JS file (and d.ts and metadata.json).
The benefit of this change is that current versions of webpack will be
able to do a much better job of only including the code an app is using.
It also allows (but does not require) people to explicitly import from specific components,
e.g.
```
import {MdButtonModule} from '@angular/material/button';
``
For development _within Angular Material itself_ we have to use these
deeper imports because the root `@angular/material` doesn't exist until
we build the relase package.
Additionally, this PR adds a `tsconfig.json` for each dir under `src/`
with the correct path mappings for that directory, so that IDEs will
correctly generate imports.
Closure Compiler CI check is also disabled by this PR; it cannot work
with the new package structure until a release with
google/closure-compiler#2600 is made available.
ad93c97 to
1f240a5
Compare
|
Caretaker note: both the copy config and the build rules need to updated alongside this change |
|
Another note: if this gets merged alongside another PR, it will potentially need a build fix (for anything importing from, e.g., |
Before this change, all of `@angular/material` was bundled into a
single, flat JS file.
After this change, each top-level component (i.e., each directory under
`src/lib`) will be have its own JS file (and d.ts and metadata.json).
The benefit of this change is that current versions of webpack will be
able to do a much better job of only including the code an app is using.
It also allows (but does not require) people to explicitly import from specific components,
e.g.
```
import {MdButtonModule} from '@angular/material/button';
``
For development _within Angular Material itself_ we have to use these
deeper imports because the root `@angular/material` doesn't exist until
we build the relase package.
Additionally, this PR adds a `tsconfig.json` for each dir under `src/`
with the correct path mappings for that directory, so that IDEs will
correctly generate imports.
Closure Compiler CI check is also disabled by this PR; it cannot work
with the new package structure until a release with
google/closure-compiler#2600 is made available.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Before this change, all of
@angular/materialwas bundled into asingle, flat JS file.
After this change, each top-level component (i.e., each directory under
src/lib) will be have its own JS file (and d.ts and metadata.json).The benefit of this change is that current versions of webpack will be
able to do a much better job of only including the code an app is using.
It also allows (but does not require) people to explicitly import from specific components,
e.g.
For development within Angular Material itself we have to use these
deeper imports because the root
@angular/materialdoesn't exist untilthe actual package is created.
Additionally, this PR adds a
tsconfig.jsonfor each dir undersrc/with the correct path mappings for that directory, so that IDEs will
correctly generate imports.
Closure Compiler CI check is also disabled by this PR; it cannot work
with the new package structure until a release with
google/closure-compiler#2600 is made available.
Fixes #4137