Remove `System.import()` usage in favor of `import()`
See original GitHub issueI’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:
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 https://github.com/webpack/webpack/pull/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
Issue Analytics
- State:
- Created 6 years ago
- Reactions:89
- Comments:45 (14 by maintainers)
Top Results From Across the Web
angular - System.import is deprecated in webpack2 in favor of ...
Show activity on this post. I am working on a project in Angular 4 with Webpack 2. According to this: https://webpack.js.org/guides/code- ...
Read more >5. The import system — Python 3.11.1 documentation
Python code in one module gains access to the code in another module by the process of importing it. The import statement is...
Read more >import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >Python import: Advanced Techniques and Tips
In this tutorial, you'll learn how to: Use modules, packages, and namespace packages; Handle resources and data files inside your packages; Import modules ......
Read more >Imports Statement - .NET Namespace and Type - Visual Basic
An import alias or name by which code can refer to namespace instead of the full ... Public Function GetFolders() As String '...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I use a parser rule in my webpack configuration to disable the warning:
https://webpack.js.org/configuration/module/#rule-parser
In Angular 7 this warning wan’t resolved