meet.js Krakow, 18.05.2017
Rafal Rumanek
@ Codewise
such command
much wow
Glossary
CLI features + demo
What's next for the CLI?
Quizzes in the meantime,
stay focused!
Angular - the other framework (previously known as Angular 2)
CLI - Command Line Interface
JiT - Just in Time (compilation) - compiling your templates in browser.
AoT - Ahead of Time (compilation) - compiling your templates during the build. You won't need to ship the compiler to the browser.
Tree shaking - dead-code elimination, or more precisely, live-code import
Webpack, tests and AoT configuration can be really painful.
Importing, declaring, providing proper pieces
is a place where you are likely to make errors
Scaffolding
Generating
Building
Serving
Testing
npm install -g @angular/cli
ng new meetjs-demo --routing
blueprints:
https://github.com/angular/angular-cli/tree/master/packages/%40angular/cli/blueprints
no custom blueprints (yet...)
ng generate c components/spinner \
--spec=false --inline-style
ng generate m team
much prize
wow
{
path: 'XXX',
loadChildren: 'MODULE_PATH#MODULE_NAME'
}
ng test
ng e2e
1. Styles compiling
2. Typescript transpilation
3. Bundling
4. Assets optimization
5. Live reloading (via websockets)
6. Code spitting
1. Styles compiling
1.5 AoT compiling
2. Typescript transpilation
3. Bundling
4. Assets optimization
5. Live reloading (via websockets)
6. Code spitting
ng build
ng build --prod --sourcemaps=true --output-path=dist.prod
npm install -g source-map-explorer
source-map-explorer dist/vendor.xxx.bundle.js
Exports webpack.config.js
You can't use some of the commands from
CLI anymore :(
...and you might miss some of the cool updates
better tree shaking
(~20% decrease in size)
faster AoT
more descriptive errors
custom blueprints
custom plugins for CLI
AoT be default in dev?
much prize
wow
+ generating your code can save you a lot of silly mistakes
+ setting up your project, including tests is something you finally don't have to worry about
+ for custom builds - check out the webpack plugin
+ you get build improvements for free*
- no custom blueprints (yet)
- no plugins for CLI (yet)
- adapting existing project/build requires work
PS. We are hiring
codewise.com/careers