In place (ngUpgrade) | Rewrite |
---|---|
+ Less risk in breaking | + Cleaner code |
+ Incremental | + Experience in new framework |
- Difficult w/new UX | - More time required |
- Bundle size increases | - Requires more developers |
1.x | Angular |
---|---|
ng-idle | ng2-idle |
angular-ui/bootstrap |
ng-bootstrap
ngx-bootstrap |
angular-translate | ngx-translate |
select2 | ng2-iq-select2 |
ui-router | @angular/router |
d3 | Test within Angular |
ng generate library my-lib
ng build my-lib
/remind #channel at 9am every weekday "@here STANDUP! Use this format:
Y:
> - What you did yesterday
T:
> - What you doing today
B: Blockers
"
// package.json
{
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commitmsg": "commitlint -e $GIT_PARAMS"
}
},
"lint-staged": {
"*.{ts,js,json,scss}": ["prettier --write", "git add"],
"*.ts": ["tslint"]
}
}
// commitlint.config.js
module.exports = { extends: ['@commitlint/config-conventional'] };
Rule | Purpose |
---|---|
"ordered-imports": true |
Grouping, ordering imports |
"no-unused-variable": true |
Flag unused variables (and imports) |
"arrow-parens": true |
Require parenthesis around params in arrow functions |
"array-type": [true, "generic"] |
Force Array<T> syntax |
"object-literal-shorthand": true |
Force ES6 shorthand (ex: no myVar: myVar) |
"member-access": true |
Force devs to be explicit on public/private |
member-ordering |
Ideally, force ordering |
Remove no-inferrable-types rule | Allow redundant type declarations |
Remove quotemark rule | May conflict with Prettier |
ChangeDetectionStrategy.OnPush
ChangeDetectorRef
and manually execute CD if needed@Input
values as immutableasync
pipe more often.take(xx)
completes observable.unsubscribe()
@HostListener
, some Renderer2
window
natively