-
Notifications
You must be signed in to change notification settings - Fork 481
feat(ng-module-map-ngfactory-loader): introduce module-map-ngfactory loader #754
Conversation
c502526
to
482dbb5
Compare
|
||
```ts | ||
@NgModule({ | ||
imports: [ModuleMapLoaderModule], |
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.
Let's simplify this to:
imports: [ModuleMapLoaderModule.withMap(...)]
`@angular/cli` will generate this map in its main output bundle. | ||
|
||
```ts | ||
const { AppModuleNgFactory, moduleMap } = require('main.bundle.js'); |
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.
Shouldn't this be LAZY_MODULE_MAP
per the other review?
ce8ae6f
to
51d07af
Compare
|
||
```ts | ||
@NgModule({ | ||
imports: [ModuleMapLoaderModule.withMap(LAZY_MODULE_MAP] |
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 isn't correct, I don't think. We can't know the LAZY_MODULE_MAP
symbol ahead of time.
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 for like... regular usage.. if someone wants to i guess they could technically just build the map themselves. To be honest, the usage with CLI should come first... because thats the way most people will use it.. but at the same time we should describe how to use it without any other context?
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.
Oh, you missed my point - this code would being in the application, which means it's part of the bundle, which means it can't self-reference the not-yet-generated LAZY_MODULE_MAP symbol. We should get rid of the .withMap
bit.
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.
There also looks to be a typo there, the (
is unclosed. It should read ...withMap(LAZY_MODULE_MAP)]
51d07af
to
6720233
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. |
Feature
Currently, there is no such ngfactory loader
This introduces a ngfactory loader mainly used with the cli but basically loads modules based on a map
No