Skip to content

Move NgModuleFactoryLoader from core to router #23796

Closed
@dawidgarus

Description

@dawidgarus

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

NgModuleFactoryLoader and SystemJsNgModuleLoader are defined in @angular/core

Expected behavior

They should be defined in @angular/router or other module.

Minimal reproduction of the problem with instructions

N/A

What is the motivation / use case for changing the behavior?

  1. NgModuleFactoryLoader is not used anywhere in core or in any module other than router
  2. NgModuleFactoryLoader is provided in router
  3. This change would probably allow us to use DllPlugin with @ngtools/webpack. See this issue: @ngtools/webpack :: Lazy Loaded Routes Not Built In Build With DLL Bundles angular-cli#4565.
    Currently @angular/core cannot be compiled separately from main app bundle as dll, because lazy loading chunks are not generated then. And because everything depends on @angular/core, all angular packages cannot be in dll. If SystemJsNgModuleLoader was in @angular/router, all other angular packages could be included in dll.

Environment


Angular version: 6.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtime

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions