Skip to content
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

Merged
merged 6 commits into from
Sep 28, 2017

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Sep 13, 2017

Fix #2034
Fix #7623

@filipesilva
Copy link
Contributor Author

Followup to #7512

@filipesilva filipesilva force-pushed the angular-compiler-jit branch 7 times, most recently from fbb49b6 to 9ce70c4 Compare September 14, 2017 13:24
@@ -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;
Copy link
Contributor

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?

Copy link
Contributor Author

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) {
Copy link
Contributor

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 ?

Copy link
Contributor Author

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) {
Copy link
Contributor

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;
Copy link
Contributor

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.

@filipesilva filipesilva force-pushed the angular-compiler-jit branch 4 times, most recently from 106ddb6 to 67077c3 Compare September 15, 2017 13:01
@googlebot
Copy link

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 cla/google commit status will not change from this State. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot
Copy link

CLAs look good, thanks!

@filipesilva
Copy link
Contributor Author

Blocked by #7702.

@filipesilva filipesilva force-pushed the angular-compiler-jit branch 6 times, most recently from a69dda5 to 3ee989d Compare September 21, 2017 13:47
@filipesilva filipesilva force-pushed the angular-compiler-jit branch 3 times, most recently from e7c1ec7 to f822fd4 Compare September 22, 2017 16:03
`;
const output = stripIndent`
import __locale_fr__ from "@angular/common/locales/fr";
import { registerLocaleData as registerLocaleData } from "@angular/common";
Copy link
Contributor

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@filipesilva filipesilva force-pushed the angular-compiler-jit branch 2 times, most recently from 0934f13 to 657beef Compare September 22, 2017 16:26
@filipesilva filipesilva self-assigned this Sep 25, 2017
@filipesilva filipesilva changed the title Angular compiler jit Add JIT support for AngularCompilerPlugin Sep 27, 2017
@filipesilva filipesilva force-pushed the angular-compiler-jit branch 3 times, most recently from 2b862aa to 97ce26b Compare September 28, 2017 12:59
hansl
hansl previously approved these changes Sep 28, 2017
@filipesilva filipesilva merged commit 335bd04 into angular:master Sep 28, 2017
@filipesilva filipesilva deleted the angular-compiler-jit branch September 28, 2017 20:12
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants