-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
fix(ivy): several small fixes to run cli-hello-world-ivy integration test suite #27438
Conversation
@@ -51,6 +51,10 @@ export function compileNgModuleDefs(moduleType: Type<any>, ngModule: NgModule): | |||
exports: flatten(ngModule.exports || EMPTY_ARRAY).map(expandModuleWithProviders), | |||
emitInline: true, | |||
}); | |||
|
|||
if (applyScope) { |
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 is a bit of a hack, but TestBed
applies its own module scopes which this would otherwise interfere with. I have some work in #27399 to hopefully avoid this in the future, but that needs some more work.
@@ -198,7 +202,7 @@ export function transitiveScopesFor<T>(moduleType: Type<T>): NgModuleTransitiveS | |||
scopes.compilation.pipes.add(entry); | |||
scopes.exported.pipes.add(entry); | |||
}); | |||
} else if (getNgModuleDef(exportedTyped)) { | |||
} else if (getPipeDef(exportedTyped)) { |
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 bug was not found with TestBed
tests as it has its own idea of module scopes, so this code was not relevant there. With the work in #27399 I deleted the custom module scope application (for now, we might still need something similar as my current approach seems too limited) and that uncovered this issue.
I'll have to investigate why Travis fails with |
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 have no idea about the setScopeOnDeclaredComponents()
change.
The rest looks great 😃
Yes, it definitely is. Basically |
6da5be0
to
fcf4948
Compare
@gkalpak All green now 🍏 💚 I've had to disable the ci-production e2e configuration as that would timeout with an error that Angular cannot be found. Don't know what's going on exactly but I'm accepting for now that that test just doesn't run yet. |
if (checkMarkerFile(entryPoint, format)) { | ||
console.warn(`Skipping ${entryPoint.name} : ${format} (already built).`); | ||
return; | ||
} |
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.
👌
"start": "ng serve", | ||
"test": "ng build --progress false" | ||
"test": "ng test --progress=false --watch=false && yarn e2e --configuration=ci" |
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.
Can you leave a TODO comment here mentioning that ci-production
is failing? E.g.:
"//test1": "TODO: Re-enable `ci-production`. Currently, it fails like this and that.",
"//test2": "ng test --progress=false --watch=false && yarn e2e --configuration=ci && yarn e2e --configuration=ci-production",
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.
@gkalpak Good idea, done!
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.
Thx! Can you also add that this is tracked in Jira issue is FW-813?
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.
@gkalpak Done, thanks for registering in Jira 👍
ae877e4
to
b48bcf8
Compare
"start": "ng serve", | ||
"test": "ng build --progress false" | ||
"test": "ng test --progress=false --watch=false && yarn e2e --configuration=ci" |
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.
Thx! Can you also add that this is tracked in Jira issue is FW-813?
316d64e
to
3902d92
Compare
Marking this as blocked on #27159. (I'd prefer to merge that first in order to preserve the PR comment history.) |
Nice work! |
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.
Waiting to rebase once #27159 lands
While creating FESM files, rollup usually drops all unused symbols. All *__POST_R3__ are unused unless ngcc rewires stuff. To prevent this DCE we reexport them as private symbols. If ngcc is not used, these symbols will be dropped when we optimize an application bundle.
This is tested in the Ivy CLI integration test.
ngcc would feed ngtsc with the function declaration inside of an IIFE as that is considered the class symbol's declaration node, according to TypeScript's `ts.Symbol.valueDeclaration`. ngtsc however only considered variable decls and actual class decls as potential class declarations, so given the function declaration node it would fail to generate the `setClassMetadata` call. ngtsc no longer makes its own assumptions about what classes look like, but always asks the reflection host to yield this kind of information.
With the bundle info being assembled into a single object before the transform is started, we now greedily create a TypeScript program up-front. If a marker file exists that indicates that the bundle could be skipped the program creation has already taken place which takes a significant amount of time. This commit moves the marker check to occur before the bundle is assembled.
…ration suite The ci-production e2e test is diabled because Angular fails to be found
ade4563
to
a455354
Compare
a455354
to
28f4dd7
Compare
Rebased now that #27159 has been merged. Tests are green, presubmit time! |
Note to caretaker: Assistance needed with g3sync. |
This is tested in the Ivy CLI integration test. PR Close #27438
ngcc would feed ngtsc with the function declaration inside of an IIFE as that is considered the class symbol's declaration node, according to TypeScript's `ts.Symbol.valueDeclaration`. ngtsc however only considered variable decls and actual class decls as potential class declarations, so given the function declaration node it would fail to generate the `setClassMetadata` call. ngtsc no longer makes its own assumptions about what classes look like, but always asks the reflection host to yield this kind of information. PR Close #27438
…27438) With the bundle info being assembled into a single object before the transform is started, we now greedily create a TypeScript program up-front. If a marker file exists that indicates that the bundle could be skipped the program creation has already taken place which takes a significant amount of time. This commit moves the marker check to occur before the bundle is assembled. PR Close #27438
While creating FESM files, rollup usually drops all unused symbols. All *__POST_R3__ are unused unless ngcc rewires stuff. To prevent this DCE we reexport them as private symbols. If ngcc is not used, these symbols will be dropped when we optimize an application bundle. PR Close angular#27438
This is tested in the Ivy CLI integration test. PR Close angular#27438
…lar#27438) ngcc would feed ngtsc with the function declaration inside of an IIFE as that is considered the class symbol's declaration node, according to TypeScript's `ts.Symbol.valueDeclaration`. ngtsc however only considered variable decls and actual class decls as potential class declarations, so given the function declaration node it would fail to generate the `setClassMetadata` call. ngtsc no longer makes its own assumptions about what classes look like, but always asks the reflection host to yield this kind of information. PR Close angular#27438
…ngular#27438) With the bundle info being assembled into a single object before the transform is started, we now greedily create a TypeScript program up-front. If a marker file exists that indicates that the bundle could be skipped the program creation has already taken place which takes a significant amount of time. This commit moves the marker check to occur before the bundle is assembled. PR Close angular#27438
…ration suite (angular#27438) The ci-production e2e test is diabled because Angular fails to be found PR Close angular#27438
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. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The cli-hello-world-ivy test would only build, not actually run. With some Ivy fixes the tests can now actually be enabled:
Fixes:
__POST_R3__
symbols were DCE'd. The integration test now finally catches those.setClassMetadata
would fail to be generated from ngcc for ES5 bundles.This builds on top of #27159 as the ESM5 bundle is used for tests.
What is the new behavior?
Ivy Hello World integration test actually runs 🎉
Does this PR introduce a breaking change?
Other information