-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Add JIT support for AngularCompilerPlugin #7684
Conversation
Followup to #7512 |
fbb49b6
to
9ce70c4
Compare
@@ -83,17 +84,18 @@ export class AngularCompilerPlugin implements Tapable { | |||
private _angularCompilerOptions: any; | |||
private _tsFilenames: string[]; | |||
// Should be Program from @angular/compiler-cli instead of any. | |||
private _program: any; | |||
private _program: ts.Program & any; |
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.
I'm not sure & any
is even something... Wouldn't that be any
? Any reason you cannot put ts.Program
there?
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.
When the interface is available in a stable manner, we should be doing ts.Program & Program
. Meanwhile I wanted to leave a marker there that indicated it's not just ts.Program
.
For some of these we should be able to not have the & any
but for others that won't be possible since methods/props are being used that don't exist on ts.Program.
|
||
if (factoryKey in this._lazyRoutes) { | ||
if (factoryPath === null) { |
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.
You removed this part, which removed lazy routes that were deleted during a rebuild. Did you want to keep a check to remove lazy routes ?
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.
I checked earlier today and this actually doesn't do anything, as far as I could tell. When a lazy route goes away the discovered routes for this module is an empty object, so there's nothing to remove. There's a TODO just above to actually add this functionality.
@@ -607,7 +645,7 @@ export class AngularCompilerPlugin implements Tapable { | |||
// It skips the program creation because we need to use `loadNgStructureAsync()`, | |||
// and uses CustomTransformers. | |||
// Should be Program and CustomTransformers from @angular/compiler-cli instead of any. | |||
private _emit(program: any, customTransformers: any) { | |||
private _emit(program: ts.Program & any, customTransformers: ts.CustomTransformers & any) { |
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.
It seems to me those & any
are wrong. You probably want a declare type Program = ...
and declare type CustomTransformers = ...
at the top of the file to remove those weird typings in arguments.
private _lazyRoutes: LazyRouteMap = Object.create(null); | ||
private _tsConfigPath: string; | ||
private _entryModule: string; | ||
private _basePath: string; | ||
private _transformMap: Map<string, TransformOperation[]> = new Map(); | ||
private _platform: PLATFORM; | ||
private _JITMode = false; |
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.
We capitalize acronyms and initialisms as if they were words. _JitMode
.
106ddb6
to
67077c3
Compare
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
67077c3
to
36bd774
Compare
CLAs look good, thanks! |
36bd774
to
094bc3d
Compare
Blocked by #7702. |
a69dda5
to
3ee989d
Compare
e7c1ec7
to
f822fd4
Compare
`; | ||
const output = stripIndent` | ||
import __locale_fr__ from "@angular/common/locales/fr"; | ||
import { registerLocaleData as registerLocaleData } from "@angular/common"; |
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.
should be import { registerLocaleData } from "@angular/common";
, I probably did something wrong in my transformer (not really wrong but useless)
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.
Fixed.
0934f13
to
657beef
Compare
657beef
to
2b3f311
Compare
2b3f311
to
662709a
Compare
2b862aa
to
97ce26b
Compare
97ce26b
to
2c2f3d2
Compare
2c2f3d2
to
6c4d309
Compare
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. |
Fix #2034
Fix #7623