-
Notifications
You must be signed in to change notification settings - Fork 27k
Implement runtime deps tracker #50980
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
Conversation
devversion
left a comment
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.
overall LGTM. this is pretty clean!
devversion
left a comment
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.
LGTM overall, just some minor comments
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.
Is the as cast here correct? wouldn't it be NgModuleWIthProvider or something?
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.
The main issue is the import type in NgModuleDef<T> does not include ModuleWithProviders, even though the comment says it should. But changing that would require more changes. In a separate PR I can fix this type issue and make things more consistent.
848314e to
ac6d36d
Compare
…cy tracker The implementation is more or less follows the pattern in render3/jit/module.ts#transitiveScopesFor helper. A few additional helper functions also added to jit utils.
…untime deps tracker The logic mainly followed the `render3/jit/directive.ts#getStandaloneDefFunctions` helper.
This method mainly has application test beds where we want to apply overrides and re-compute the scope.
… the runtime deps tracker This includes implementation of methods getComponentDependencies and registerNgModule. In order to correlate ng-modules with their declarations it is required to use the method registerNgModule to regiater the ng-module. However, the actual correlation will happen lazily once getComponentDependencies method is called. This lazy behaviour also allows for forward refs to be resolved. The method getComponentDependencies will be used in local compilation mode to compute the rendering component deps in runtime.
The previous commits add a new runtime error code (RUNTIME_DEPS_INVALID_IMPORTED_TYPE) which needs to be added to the golden for the tests to pass.
jessicajaniuk
left a comment
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.
reviewed-for: public-api
pkozlowski-opensource
left a comment
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.
LGTM
Reviewed-for: public-api
|
This PR was merged into the repository by commit 89c84bf. |
… the runtime deps tracker (#50980) This includes implementation of methods getComponentDependencies and registerNgModule. In order to correlate ng-modules with their declarations it is required to use the method registerNgModule to regiater the ng-module. However, the actual correlation will happen lazily once getComponentDependencies method is called. This lazy behaviour also allows for forward refs to be resolved. The method getComponentDependencies will be used in local compilation mode to compute the rendering component deps in runtime. PR Close #50980
…cy tracker (angular#50980) The implementation is more or less follows the pattern in render3/jit/module.ts#transitiveScopesFor helper. A few additional helper functions also added to jit utils. PR Close angular#50980
…untime deps tracker (angular#50980) The logic mainly followed the `render3/jit/directive.ts#getStandaloneDefFunctions` helper. PR Close angular#50980
…angular#50980) This method mainly has application test beds where we want to apply overrides and re-compute the scope. PR Close angular#50980
… the runtime deps tracker (angular#50980) This includes implementation of methods getComponentDependencies and registerNgModule. In order to correlate ng-modules with their declarations it is required to use the method registerNgModule to regiater the ng-module. However, the actual correlation will happen lazily once getComponentDependencies method is called. This lazy behaviour also allows for forward refs to be resolved. The method getComponentDependencies will be used in local compilation mode to compute the rendering component deps in runtime. PR Close angular#50980
…ngular#50980) The previous commits add a new runtime error code (RUNTIME_DEPS_INVALID_IMPORTED_TYPE) which needs to be added to the golden for the tests to pass. PR Close angular#50980
|
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. |
…cy tracker (angular#50980) The implementation is more or less follows the pattern in render3/jit/module.ts#transitiveScopesFor helper. A few additional helper functions also added to jit utils. PR Close angular#50980
…untime deps tracker (angular#50980) The logic mainly followed the `render3/jit/directive.ts#getStandaloneDefFunctions` helper. PR Close angular#50980
…angular#50980) This method mainly has application test beds where we want to apply overrides and re-compute the scope. PR Close angular#50980
… the runtime deps tracker (angular#50980) This includes implementation of methods getComponentDependencies and registerNgModule. In order to correlate ng-modules with their declarations it is required to use the method registerNgModule to regiater the ng-module. However, the actual correlation will happen lazily once getComponentDependencies method is called. This lazy behaviour also allows for forward refs to be resolved. The method getComponentDependencies will be used in local compilation mode to compute the rendering component deps in runtime. PR Close angular#50980
…ngular#50980) The previous commits add a new runtime error code (RUNTIME_DEPS_INVALID_IMPORTED_TYPE) which needs to be added to the golden for the tests to pass. PR Close angular#50980
An initial implementation which captures what we need for both JIT and local compilations. This PR only changes deps tracker files which are NOT being used anywhere yet. So this change does not affect anything. In a follow up PR I'll migrate JIT compilation to use this deps tracker (instead of transitiveScopesFor tools and monkey patching) and hopefully it will break lots of tests cross g3 and worldwide which makes it look like I have done something ...
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?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information