Comments (8)
1.0.0-beta.4 landed with AoT, Lazy Loading (with or without @angular/cli
and auto code splitting)
from angular.
@Jordan-Hall are you using webpack 1.x or 2.x?
from angular.
I thought we had already released the code necessary for webpack lazy loading, but apparently it's coming in the next release 1.0.0-beta.4
See these comments for more details: angular-ui/ui-router#3079 (comment)
angular-ui/ui-router#3037
I plan to write an example starting from the angular-cli
from angular.
From @Jordan-Hall on November 30, 2016 0:34
I'm using Web pack 2
from angular.
From @wpitallo on January 15, 2017 23:25
Hi @christopherthielen, any idea when 1.0.0-beta.4 will be released with the support for Lazy Loading with webpack2?
Thanks for the help!
from angular.
I'm actively working on getting ahead of time compilation plus lazy loading in the angular-cli working. That's the last thing holding up beta.4
from angular.
From @wpitallo on January 16, 2017 14:46
Ok cool, thanks so much! Been using beta.3 and it's great, just missing the Lazy Loading, thanks so much!
from angular.
It looks like we can't (yet) do AoT + lazy load with the angular-cli. AoT compilation and ngtools
have related code to 1) code split with webpack and 2) rewrite System.import()
to import the ngfactory
. It's currently hard coded only to process ng router lazy loaded child routes. Don't worry. We'll get there soon enough.
As of beta.4
, we will be able to:
- Lazy Load routes in (with or without CLI) using JIT mode.
- Run in AoT mode (with the CLI) without any lazy loaded routes.
- Both AoT compile with Lazy Loading (without the CLI) by manually changing lazy loading to
System.import('../aot/foo/foo.module.ngfactory').then(x => x.FooModule)
.
To streamline support in the CLI, I'm changing the API to:
JIT:
{ name: 'foo.**', url: '/foo',
loadChildren: () => System.import('./foo/foo.module').then(x => x.FooModule) }
JIT shorthand (and future syntax for AoT + CLI support -- will require ngtools
to enable code splitting in webpack):
{ name: 'foo.**', url: '/foo',
loadChildren: './foo/foo.module#FooModule' }
AoT:
{ name: 'foo.**', url: '/foo',
loadChildren: () => System.import('../../aot/app/foo/foo.module.ngfactory')
.then(x => x.FooModuleNgFactory) }
where /aot/
is the genDir
for ngc
(where ngc
generates the AoT files)
from angular.
Related Issues (20)
- Error: State 'quizzes' is already defined HOT 2
- uiSref doesn't work unless matching "name". Can't use full path/name. HOT 2
- How to lazy load with chunks HOT 11
- Incompatibility with Angular v13 - removal of `NgModuleFactoryLoader` HOT 1
- Angular 13 Support (libs update) and version policy HOT 13
- [Discussion] Monorepo requirements for ui-router packages HOT 11
- Redirects on local anchor reference HOT 2
- onError not redirecting HOT 1
- Angular v14 support HOT 2
- [bug(?)]: future state declaration's data not passed/merged to/with loaded child state HOT 1
- Angular 15 support HOT 5
- MergeInjector breaks normal Angular DI priority HOT 3
- [question] Lazy loaded module empty after creating
- Breaks when building with Angular 16
- Angular 16 support HOT 9
- Angular 17 support HOT 4
- Incorrect Ui Routing on iOS 17 safari private browsing mode.
- Example for angular 17 standalone
- Can't use extended StateDeclaration as a generic to StateObject
- Angular 18 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.