I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[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
Current behavior
Currently Angular core makes use of a System.import() call to load templates (html/css) and lazy modules:
|
return System.import(module) |
|
.then((module: any) => module[exportName]) |
|
.then((type: any) => checkNotEmpty(type, module, exportName)) |
|
.then((type: any) => this._compiler.compileModuleAsync(type)); |
In the past System.import was expected to become a standard, but import() was settled upon instead.
Modern tooling is beginning to deprecate (notably Webpack 4 webpack/webpack#6321) System.import() detection in favor of the standard and it should not be unexpected that more follow suit.
Expected behavior
The standard import() is used, so that tooling that supports code splitting can detect it.
Minimal reproduction of the problem with instructions
The SystemJS loader can be found at https://github.com/angular/angular/blob/master/packages/core/src/linker/system_js_ng_module_factory_loader.ts.
What is the motivation / use case for changing the behavior?
Remain compatible with modern tooling.
Environment
Angular version: 2, 4 and 5
/cc @hansl @bradlygreen @IgorMinar @robwormald
I'm submitting a...
Current behavior
Currently Angular core makes use of a
System.import()call to load templates (html/css) and lazy modules:angular/packages/core/src/linker/system_js_ng_module_factory_loader.ts
Lines 67 to 70 in 3bcc0e6
In the past
System.importwas expected to become a standard, butimport()was settled upon instead.Modern tooling is beginning to deprecate (notably Webpack 4 webpack/webpack#6321)
System.import()detection in favor of the standard and it should not be unexpected that more follow suit.Expected behavior
The standard
import()is used, so that tooling that supports code splitting can detect it.Minimal reproduction of the problem with instructions
The SystemJS loader can be found at https://github.com/angular/angular/blob/master/packages/core/src/linker/system_js_ng_module_factory_loader.ts.
What is the motivation / use case for changing the behavior?
Remain compatible with modern tooling.
Environment
/cc @hansl @bradlygreen @IgorMinar @robwormald