@nx/angular 16.0.3 → 16.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mf/mf.js +1 -2
- package/mf/mf.js.map +1 -1
- package/migrations.json +126 -0
- package/package.json +27 -36
- package/src/builders/webpack-server/schema.d.ts +1 -1
- package/src/builders/webpack-server/schema.json +5 -0
- package/src/builders/webpack-server/validate-options.js +7 -0
- package/src/builders/webpack-server/validate-options.js.map +1 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.d.ts +2 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +13 -5
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js.map +1 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.d.ts +2 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.transform.js +2 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.d.ts +2 -2
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.js +45 -24
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-package.transform.js.map +1 -1
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ngc/compile-source-files.d.ts +3 -3
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ngc/compile-source-files.js +10 -8
- package/src/executors/ng-packagr-lite/ng-packagr-adjustments/ngc/compile-source-files.js.map +1 -1
- package/src/executors/ng-packagr-lite/schema.json +1 -1
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.d.ts +2 -0
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +22 -10
- package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js.map +1 -1
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.d.ts +3 -2
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js +13 -3
- package/src/executors/package/ng-packagr-adjustments/ngc/compile-source-files.js.map +1 -1
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.d.ts +1 -0
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js +14 -0
- package/src/executors/package/ng-packagr-adjustments/utils/ng-compiler-cli.js.map +1 -0
- package/src/executors/utilities/tailwindcss.js +7 -2
- package/src/executors/utilities/tailwindcss.js.map +1 -1
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +7 -0
- package/src/generators/application/files/standalone-components/src/main.ts__tpl__ +3 -9
- package/src/generators/host/files/src/main.server.ts__tmpl__ +3 -3
- package/src/generators/host/lib/add-ssr.js +2 -2
- package/src/generators/host/lib/add-ssr.js.map +1 -1
- package/src/generators/init/init.js +3 -0
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/library/files/base/package.json__tpl__ +2 -2
- package/src/generators/library/lib/create-files.js +5 -0
- package/src/generators/library/lib/create-files.js.map +1 -1
- package/src/generators/ngrx/lib/add-imports-to-module.js +10 -10
- package/src/generators/ngrx/lib/add-imports-to-module.js.map +1 -1
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +3 -0
- package/src/generators/ngrx/lib/add-ngrx-to-package-json.js.map +1 -1
- package/src/generators/remote/files/{src → base/src}/main.server.ts__tmpl__ +3 -3
- package/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +7 -0
- package/src/generators/remote/lib/add-ssr.d.ts +2 -1
- package/src/generators/remote/lib/add-ssr.js +11 -2
- package/src/generators/remote/lib/add-ssr.js.map +1 -1
- package/src/generators/remote/remote.js +5 -1
- package/src/generators/remote/remote.js.map +1 -1
- package/src/generators/setup-ssr/files/ngmodule/pre-v15-2/src/main.ts__tpl__ +14 -0
- package/src/generators/setup-ssr/files/standalone/__serverFileName__ +60 -0
- package/src/generators/setup-ssr/files/standalone/src/__main__ +7 -0
- package/src/generators/setup-ssr/files/standalone/src/app/app.config.server.ts__tpl__ +11 -0
- package/src/generators/setup-ssr/lib/generate-files.js +15 -4
- package/src/generators/setup-ssr/lib/generate-files.js.map +1 -1
- package/src/generators/setup-ssr/lib/index.d.ts +1 -0
- package/src/generators/setup-ssr/lib/index.js +1 -0
- package/src/generators/setup-ssr/lib/index.js.map +1 -1
- package/src/generators/setup-ssr/lib/normalize-options.d.ts +1 -0
- package/src/generators/setup-ssr/lib/normalize-options.js +11 -9
- package/src/generators/setup-ssr/lib/normalize-options.js.map +1 -1
- package/src/generators/setup-ssr/lib/update-app-module.js +5 -0
- package/src/generators/setup-ssr/lib/update-app-module.js.map +1 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +32 -19
- package/src/generators/setup-ssr/lib/update-project-config.js.map +1 -1
- package/src/generators/setup-ssr/lib/validate-options.d.ts +3 -0
- package/src/generators/setup-ssr/lib/validate-options.js +10 -0
- package/src/generators/setup-ssr/lib/validate-options.js.map +1 -0
- package/src/generators/setup-ssr/schema.d.ts +1 -0
- package/src/generators/setup-ssr/schema.json +5 -1
- package/src/generators/setup-ssr/setup-ssr.js +4 -1
- package/src/generators/setup-ssr/setup-ssr.js.map +1 -1
- package/src/generators/utils/insert-ngmodule-import.js +11 -35
- package/src/generators/utils/insert-ngmodule-import.js.map +1 -1
- package/src/generators/utils/version-utils.d.ts +0 -1
- package/src/generators/utils/version-utils.js +3 -10
- package/src/generators/utils/version-utils.js.map +1 -1
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +16 -1
- package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js.map +1 -1
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.d.ts +2 -0
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js +109 -0
- package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js.map +1 -0
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.d.ts +2 -0
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.js +27 -0
- package/src/migrations/update-16-1-0/remove-ngcc-invocation.js.map +1 -0
- package/src/migrations/update-16-1-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-16-1-0/update-angular-cli.js +28 -0
- package/src/migrations/update-16-1-0/update-angular-cli.js.map +1 -0
- package/src/migrations/update-16-1-0/update-server-executor-config.d.ts +2 -0
- package/src/migrations/update-16-1-0/update-server-executor-config.js +30 -0
- package/src/migrations/update-16-1-0/update-server-executor-config.js.map +1 -0
- package/src/migrations/utils/projects.d.ts +5 -0
- package/src/migrations/utils/projects.js +18 -0
- package/src/migrations/utils/projects.js.map +1 -0
- package/src/utils/backward-compatible-versions.d.ts +1 -1
- package/src/utils/backward-compatible-versions.js +28 -1
- package/src/utils/backward-compatible-versions.js.map +1 -1
- package/src/utils/file-change-recorder.d.ts +1 -0
- package/src/utils/file-change-recorder.js +3 -0
- package/src/utils/file-change-recorder.js.map +1 -1
- package/src/utils/nx-devkit/ast-utils.d.ts +9 -0
- package/src/utils/nx-devkit/ast-utils.js +53 -12
- package/src/utils/nx-devkit/ast-utils.js.map +1 -1
- package/src/utils/public-api.d.ts +1 -1
- package/src/utils/public-api.js +2 -1
- package/src/utils/public-api.js.map +1 -1
- package/src/utils/versions.d.ts +5 -5
- package/src/utils/versions.js +5 -5
- package/src/utils/versions.js.map +1 -1
- package/fesm2015/nx-angular-mf.mjs +0 -60
- package/fesm2015/nx-angular-mf.mjs.map +0 -1
- package/fesm2020/nx-angular-testing.mjs +0 -43
- package/fesm2020/nx-angular-testing.mjs.map +0 -1
- package/fesm2020/nx-angular.mjs +0 -351
- package/fesm2020/nx-angular.mjs.map +0 -1
- package/src/generators/setup-ssr/files/base/src/main.ts__tpl__ +0 -16
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/mf/index.mjs +0 -0
- /package/{esm2020 → esm2022}/mf/mf.mjs +0 -0
- /package/{esm2020 → esm2022}/mf/nx-angular-mf.mjs +0 -0
- /package/{esm2020 → esm2022}/nx-angular.mjs +0 -0
- /package/{esm2020 → esm2022}/src/runtime/nx/data-persistence.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/index.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/nx-angular-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/src/testing-utils.mjs +0 -0
- /package/{fesm2020 → fesm2022}/nx-angular-mf.mjs +0 -0
- /package/{fesm2020 → fesm2022}/nx-angular-mf.mjs.map +0 -0
- /package/{fesm2015 → fesm2022}/nx-angular-testing.mjs +0 -0
- /package/{fesm2015 → fesm2022}/nx-angular-testing.mjs.map +0 -0
- /package/{fesm2015 → fesm2022}/nx-angular.mjs +0 -0
- /package/{fesm2015 → fesm2022}/nx-angular.mjs.map +0 -0
- /package/src/generators/remote/files/{webpack.server.config.js__tmpl__ → base/webpack.server.config.js__tmpl__} +0 -0
- /package/src/generators/setup-ssr/files/{base → ngmodule/base}/__serverFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{base → ngmodule/base}/src/__main__ +0 -0
- /package/src/generators/setup-ssr/files/{base → ngmodule/base}/src/app/__rootModuleFileName__ +0 -0
- /package/src/generators/setup-ssr/files/{v14 → ngmodule/v14}/src/__main__ +0 -0
package/fesm2020/nx-angular.mjs
DELETED
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
import { ROUTER_NAVIGATION } from '@ngrx/router-store';
|
|
2
|
-
import { isObservable, of } from 'rxjs';
|
|
3
|
-
import { concatMap, groupBy, mergeMap, switchMap, filter, map, catchError } from 'rxjs/operators';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* @whatItDoes Handles pessimistic updates (updating the server first).
|
|
8
|
-
*
|
|
9
|
-
* Updating the server, when implemented naively, suffers from race conditions and poor error handling.
|
|
10
|
-
*
|
|
11
|
-
* `pessimisticUpdate` addresses these problems. It runs all fetches in order, which removes race conditions
|
|
12
|
-
* and forces the developer to handle errors.
|
|
13
|
-
*
|
|
14
|
-
* ## Example:
|
|
15
|
-
*
|
|
16
|
-
* ```typescript
|
|
17
|
-
* @Injectable()
|
|
18
|
-
* class TodoEffects {
|
|
19
|
-
* updateTodo$ = createEffect(() =>
|
|
20
|
-
* this.actions$.pipe(
|
|
21
|
-
* ofType('UPDATE_TODO'),
|
|
22
|
-
* pessimisticUpdate({
|
|
23
|
-
* // provides an action
|
|
24
|
-
* run: (action: UpdateTodo) => {
|
|
25
|
-
* // update the backend first, and then dispatch an action that will
|
|
26
|
-
* // update the client side
|
|
27
|
-
* return this.backend.updateTodo(action.todo.id, action.todo).pipe(
|
|
28
|
-
* map((updated) => ({
|
|
29
|
-
* type: 'UPDATE_TODO_SUCCESS',
|
|
30
|
-
* todo: updated,
|
|
31
|
-
* }))
|
|
32
|
-
* );
|
|
33
|
-
* },
|
|
34
|
-
* onError: (action: UpdateTodo, error: any) => {
|
|
35
|
-
* // we don't need to undo the changes on the client side.
|
|
36
|
-
* // we can dispatch an error, or simply log the error here and return `null`
|
|
37
|
-
* return null;
|
|
38
|
-
* },
|
|
39
|
-
* })
|
|
40
|
-
* )
|
|
41
|
-
* );
|
|
42
|
-
*
|
|
43
|
-
* constructor(private actions$: Actions, private backend: Backend) {}
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* Note that if you don't return a new action from the run callback, you must set the dispatch property
|
|
48
|
-
* of the effect to false, like this:
|
|
49
|
-
*
|
|
50
|
-
* ```typescript
|
|
51
|
-
* class TodoEffects {
|
|
52
|
-
* updateTodo$ = createEffect(() =>
|
|
53
|
-
* this.actions$.pipe(
|
|
54
|
-
* //...
|
|
55
|
-
* ), { dispatch: false }
|
|
56
|
-
* );
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* @param opts
|
|
61
|
-
*/
|
|
62
|
-
function pessimisticUpdate(opts) {
|
|
63
|
-
return (source) => {
|
|
64
|
-
return source.pipe(mapActionAndState(), concatMap(runWithErrorHandling(opts.run, opts.onError)));
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* @whatItDoes Handles optimistic updates (updating the client first).
|
|
70
|
-
*
|
|
71
|
-
* It runs all fetches in order, which removes race conditions and forces the developer to handle errors.
|
|
72
|
-
*
|
|
73
|
-
* When using `optimisticUpdate`, in case of a failure, the developer has already updated the state locally,
|
|
74
|
-
* so the developer must provide an undo action.
|
|
75
|
-
*
|
|
76
|
-
* The error handling must be done in the callback, or by means of the undo action.
|
|
77
|
-
*
|
|
78
|
-
* ## Example:
|
|
79
|
-
*
|
|
80
|
-
* ```typescript
|
|
81
|
-
* @Injectable()
|
|
82
|
-
* class TodoEffects {
|
|
83
|
-
* updateTodo$ = createEffect(() =>
|
|
84
|
-
* this.actions$.pipe(
|
|
85
|
-
* ofType('UPDATE_TODO'),
|
|
86
|
-
* optimisticUpdate({
|
|
87
|
-
* // provides an action
|
|
88
|
-
* run: (action: UpdateTodo) => {
|
|
89
|
-
* return this.backend.updateTodo(action.todo.id, action.todo).pipe(
|
|
90
|
-
* mapTo({
|
|
91
|
-
* type: 'UPDATE_TODO_SUCCESS',
|
|
92
|
-
* })
|
|
93
|
-
* );
|
|
94
|
-
* },
|
|
95
|
-
* undoAction: (action: UpdateTodo, error: any) => {
|
|
96
|
-
* // dispatch an undo action to undo the changes in the client state
|
|
97
|
-
* return {
|
|
98
|
-
* type: 'UNDO_TODO_UPDATE',
|
|
99
|
-
* todo: action.todo,
|
|
100
|
-
* };
|
|
101
|
-
* },
|
|
102
|
-
* })
|
|
103
|
-
* )
|
|
104
|
-
* );
|
|
105
|
-
*
|
|
106
|
-
* constructor(private actions$: Actions, private backend: Backend) {}
|
|
107
|
-
* }
|
|
108
|
-
* ```
|
|
109
|
-
*
|
|
110
|
-
* Note that if you don't return a new action from the run callback, you must set the dispatch property
|
|
111
|
-
* of the effect to false, like this:
|
|
112
|
-
*
|
|
113
|
-
* ```typescript
|
|
114
|
-
* class TodoEffects {
|
|
115
|
-
* updateTodo$ = createEffect(() =>
|
|
116
|
-
* this.actions$.pipe(
|
|
117
|
-
* //...
|
|
118
|
-
* ), { dispatch: false }
|
|
119
|
-
* );
|
|
120
|
-
* }
|
|
121
|
-
* ```
|
|
122
|
-
*
|
|
123
|
-
* @param opts
|
|
124
|
-
*/
|
|
125
|
-
function optimisticUpdate(opts) {
|
|
126
|
-
return (source) => {
|
|
127
|
-
return source.pipe(mapActionAndState(), concatMap(runWithErrorHandling(opts.run, opts.undoAction)));
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
*
|
|
132
|
-
* @whatItDoes Handles data fetching.
|
|
133
|
-
*
|
|
134
|
-
* Data fetching implemented naively suffers from race conditions and poor error handling.
|
|
135
|
-
*
|
|
136
|
-
* `fetch` addresses these problems. It runs all fetches in order, which removes race conditions
|
|
137
|
-
* and forces the developer to handle errors.
|
|
138
|
-
*
|
|
139
|
-
* ## Example:
|
|
140
|
-
*
|
|
141
|
-
* ```typescript
|
|
142
|
-
* @Injectable()
|
|
143
|
-
* class TodoEffects {
|
|
144
|
-
* loadTodos$ = createEffect(() =>
|
|
145
|
-
* this.actions$.pipe(
|
|
146
|
-
* ofType('GET_TODOS'),
|
|
147
|
-
* fetch({
|
|
148
|
-
* // provides an action
|
|
149
|
-
* run: (a: GetTodos) => {
|
|
150
|
-
* return this.backend.getAll().pipe(
|
|
151
|
-
* map((response) => ({
|
|
152
|
-
* type: 'TODOS',
|
|
153
|
-
* todos: response.todos,
|
|
154
|
-
* }))
|
|
155
|
-
* );
|
|
156
|
-
* },
|
|
157
|
-
* onError: (action: GetTodos, error: any) => {
|
|
158
|
-
* // dispatch an undo action to undo the changes in the client state
|
|
159
|
-
* return null;
|
|
160
|
-
* },
|
|
161
|
-
* })
|
|
162
|
-
* )
|
|
163
|
-
* );
|
|
164
|
-
*
|
|
165
|
-
* constructor(private actions$: Actions, private backend: Backend) {}
|
|
166
|
-
* }
|
|
167
|
-
* ```
|
|
168
|
-
*
|
|
169
|
-
* This is correct, but because it set the concurrency to 1, it may not be performant.
|
|
170
|
-
*
|
|
171
|
-
* To fix that, you can provide the `id` function, like this:
|
|
172
|
-
*
|
|
173
|
-
* ```typescript
|
|
174
|
-
* @Injectable()
|
|
175
|
-
* class TodoEffects {
|
|
176
|
-
* loadTodo$ = createEffect(() =>
|
|
177
|
-
* this.actions$.pipe(
|
|
178
|
-
* ofType('GET_TODO'),
|
|
179
|
-
* fetch({
|
|
180
|
-
* id: (todo: GetTodo) => {
|
|
181
|
-
* return todo.id;
|
|
182
|
-
* },
|
|
183
|
-
* // provides an action
|
|
184
|
-
* run: (todo: GetTodo) => {
|
|
185
|
-
* return this.backend.getTodo(todo.id).map((response) => ({
|
|
186
|
-
* type: 'LOAD_TODO_SUCCESS',
|
|
187
|
-
* todo: response.todo,
|
|
188
|
-
* }));
|
|
189
|
-
* },
|
|
190
|
-
* onError: (action: GetTodo, error: any) => {
|
|
191
|
-
* // dispatch an undo action to undo the changes in the client state
|
|
192
|
-
* return null;
|
|
193
|
-
* },
|
|
194
|
-
* })
|
|
195
|
-
* )
|
|
196
|
-
* );
|
|
197
|
-
*
|
|
198
|
-
* constructor(private actions$: Actions, private backend: Backend) {}
|
|
199
|
-
* }
|
|
200
|
-
* ```
|
|
201
|
-
*
|
|
202
|
-
* With this setup, the requests for Todo 1 will run concurrently with the requests for Todo 2.
|
|
203
|
-
*
|
|
204
|
-
* In addition, if there are multiple requests for Todo 1 scheduled, it will only run the last one.
|
|
205
|
-
*
|
|
206
|
-
* @param opts
|
|
207
|
-
*/
|
|
208
|
-
function fetch(opts) {
|
|
209
|
-
return (source) => {
|
|
210
|
-
if (opts.id) {
|
|
211
|
-
const groupedFetches = source.pipe(mapActionAndState(), groupBy(([action, ...store]) => {
|
|
212
|
-
return opts.id(action, ...store);
|
|
213
|
-
}));
|
|
214
|
-
return groupedFetches.pipe(mergeMap((pairs) => pairs.pipe(switchMap(runWithErrorHandling(opts.run, opts.onError)))));
|
|
215
|
-
}
|
|
216
|
-
return source.pipe(mapActionAndState(), concatMap(runWithErrorHandling(opts.run, opts.onError)));
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* @whatItDoes Handles data fetching as part of router navigation.
|
|
221
|
-
*
|
|
222
|
-
* Data fetching implemented naively suffers from race conditions and poor error handling.
|
|
223
|
-
*
|
|
224
|
-
* `navigation` addresses these problems.
|
|
225
|
-
*
|
|
226
|
-
* It checks if an activated router state contains the passed in component type, and, if it does, runs the `run`
|
|
227
|
-
* callback. It provides the activated snapshot associated with the component and the current state. And it only runs
|
|
228
|
-
* the last request.
|
|
229
|
-
*
|
|
230
|
-
* ## Example:
|
|
231
|
-
*
|
|
232
|
-
* ```typescript
|
|
233
|
-
* @Injectable()
|
|
234
|
-
* class TodoEffects {
|
|
235
|
-
* loadTodo$ = createEffect(() =>
|
|
236
|
-
* this.actions$.pipe(
|
|
237
|
-
* // listens for the routerNavigation action from @ngrx/router-store
|
|
238
|
-
* navigation(TodoComponent, {
|
|
239
|
-
* run: (activatedRouteSnapshot: ActivatedRouteSnapshot) => {
|
|
240
|
-
* return this.backend
|
|
241
|
-
* .fetchTodo(activatedRouteSnapshot.params['id'])
|
|
242
|
-
* .pipe(
|
|
243
|
-
* map((todo) => ({
|
|
244
|
-
* type: 'LOAD_TODO_SUCCESS',
|
|
245
|
-
* todo: todo,
|
|
246
|
-
* }))
|
|
247
|
-
* );
|
|
248
|
-
* },
|
|
249
|
-
* onError: (
|
|
250
|
-
* activatedRouteSnapshot: ActivatedRouteSnapshot,
|
|
251
|
-
* error: any
|
|
252
|
-
* ) => {
|
|
253
|
-
* // we can log and error here and return null
|
|
254
|
-
* // we can also navigate back
|
|
255
|
-
* return null;
|
|
256
|
-
* },
|
|
257
|
-
* })
|
|
258
|
-
* )
|
|
259
|
-
* );
|
|
260
|
-
*
|
|
261
|
-
* constructor(private actions$: Actions, private backend: Backend) {}
|
|
262
|
-
* }
|
|
263
|
-
* ```
|
|
264
|
-
*
|
|
265
|
-
* @param component
|
|
266
|
-
* @param opts
|
|
267
|
-
*/
|
|
268
|
-
function navigation(component, opts) {
|
|
269
|
-
return (source) => {
|
|
270
|
-
const nav = source.pipe(mapActionAndState(), filter(([action]) => isStateSnapshot(action)), map(([action, ...slices]) => {
|
|
271
|
-
if (!isStateSnapshot(action)) {
|
|
272
|
-
// Because of the above filter we'll never get here,
|
|
273
|
-
// but this properly type narrows `action`
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
return [
|
|
277
|
-
findSnapshot(component, action.payload.routerState.root),
|
|
278
|
-
...slices,
|
|
279
|
-
];
|
|
280
|
-
}), filter(([snapshot]) => !!snapshot));
|
|
281
|
-
return nav.pipe(switchMap(runWithErrorHandling(opts.run, opts.onError)));
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
function isStateSnapshot(action) {
|
|
285
|
-
return action.type === ROUTER_NAVIGATION;
|
|
286
|
-
}
|
|
287
|
-
function runWithErrorHandling(run, onError) {
|
|
288
|
-
return ([action, ...slices]) => {
|
|
289
|
-
try {
|
|
290
|
-
const r = wrapIntoObservable(run(action, ...slices));
|
|
291
|
-
return r.pipe(catchError((e) => wrapIntoObservable(onError(action, e))));
|
|
292
|
-
}
|
|
293
|
-
catch (e) {
|
|
294
|
-
return wrapIntoObservable(onError(action, e));
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* @whatItDoes maps Observable<Action | [Action, State]> to
|
|
300
|
-
* Observable<[Action, State]>
|
|
301
|
-
*/
|
|
302
|
-
function mapActionAndState() {
|
|
303
|
-
return (source) => {
|
|
304
|
-
return source.pipe(map((value) => normalizeActionAndState(value)));
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* @whatItDoes Normalizes either a bare action or an array of action and slices
|
|
309
|
-
* into an array of action and slices (or undefined)
|
|
310
|
-
*/
|
|
311
|
-
function normalizeActionAndState(args) {
|
|
312
|
-
let action, slices;
|
|
313
|
-
if (args instanceof Array) {
|
|
314
|
-
[action, ...slices] = args;
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
slices = [];
|
|
318
|
-
action = args;
|
|
319
|
-
}
|
|
320
|
-
return [action, ...slices];
|
|
321
|
-
}
|
|
322
|
-
function findSnapshot(component, s) {
|
|
323
|
-
if (s.routeConfig && s.routeConfig.component === component) {
|
|
324
|
-
return s;
|
|
325
|
-
}
|
|
326
|
-
for (const c of s.children) {
|
|
327
|
-
const ss = findSnapshot(component, c);
|
|
328
|
-
if (ss) {
|
|
329
|
-
return ss;
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
return null;
|
|
333
|
-
}
|
|
334
|
-
function wrapIntoObservable(obj) {
|
|
335
|
-
if (isObservable(obj)) {
|
|
336
|
-
return obj;
|
|
337
|
-
}
|
|
338
|
-
else if (!obj) {
|
|
339
|
-
return of();
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
return of(obj);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Generated bundle index. Do not edit.
|
|
348
|
-
*/
|
|
349
|
-
|
|
350
|
-
export { fetch, navigation, optimisticUpdate, pessimisticUpdate };
|
|
351
|
-
//# sourceMappingURL=nx-angular.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nx-angular.mjs","sources":["../../../../packages/angular/src/runtime/nx/data-persistence.ts","../../../../packages/angular/nx-angular.ts"],"sourcesContent":["import type { Type } from '@angular/core';\nimport type {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\nimport type { RouterNavigationAction } from '@ngrx/router-store';\nimport { ROUTER_NAVIGATION } from '@ngrx/router-store';\nimport type { Action } from '@ngrx/store';\nimport type { Observable } from 'rxjs';\nimport { isObservable, of } from 'rxjs';\nimport {\n catchError,\n concatMap,\n filter,\n groupBy,\n map,\n mergeMap,\n switchMap,\n} from 'rxjs/operators';\n\nexport interface PessimisticUpdateOpts<T extends Array<unknown>, A> {\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n onError(a: A, e: any): Observable<any> | any;\n}\n\nexport interface OptimisticUpdateOpts<T extends Array<unknown>, A> {\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n undoAction(a: A, e: any): Observable<Action> | Action;\n}\n\nexport interface FetchOpts<T extends Array<unknown>, A> {\n id?(a: A, ...slices: [...T]): any;\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n onError?(a: A, e: any): Observable<any> | any;\n}\n\nexport interface HandleNavigationOpts<T extends Array<unknown>> {\n run(\n a: ActivatedRouteSnapshot,\n ...slices: [...T]\n ): Observable<Action> | Action | void;\n onError?(a: ActivatedRouteSnapshot, e: any): Observable<any> | any;\n}\n\nexport type ActionOrActionWithStates<T extends Array<unknown>, A> =\n | A\n | [A, ...T];\nexport type ActionOrActionWithState<T, A> = ActionOrActionWithStates<[T], A>;\nexport type ActionStatesStream<T extends Array<unknown>, A> = Observable<\n ActionOrActionWithStates<T, A>\n>;\nexport type ActionStateStream<T, A> = Observable<\n ActionOrActionWithStates<[T], A>\n>;\n\n/**\n *\n * @whatItDoes Handles pessimistic updates (updating the server first).\n *\n * Updating the server, when implemented naively, suffers from race conditions and poor error handling.\n *\n * `pessimisticUpdate` addresses these problems. It runs all fetches in order, which removes race conditions\n * and forces the developer to handle errors.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('UPDATE_TODO'),\n * pessimisticUpdate({\n * // provides an action\n * run: (action: UpdateTodo) => {\n * // update the backend first, and then dispatch an action that will\n * // update the client side\n * return this.backend.updateTodo(action.todo.id, action.todo).pipe(\n * map((updated) => ({\n * type: 'UPDATE_TODO_SUCCESS',\n * todo: updated,\n * }))\n * );\n * },\n * onError: (action: UpdateTodo, error: any) => {\n * // we don't need to undo the changes on the client side.\n * // we can dispatch an error, or simply log the error here and return `null`\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * Note that if you don't return a new action from the run callback, you must set the dispatch property\n * of the effect to false, like this:\n *\n * ```typescript\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * //...\n * ), { dispatch: false }\n * );\n * }\n * ```\n *\n * @param opts\n */\nexport function pessimisticUpdate<T extends Array<unknown>, A extends Action>(\n opts: PessimisticUpdateOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.onError))\n );\n };\n}\n\n/**\n *\n * @whatItDoes Handles optimistic updates (updating the client first).\n *\n * It runs all fetches in order, which removes race conditions and forces the developer to handle errors.\n *\n * When using `optimisticUpdate`, in case of a failure, the developer has already updated the state locally,\n * so the developer must provide an undo action.\n *\n * The error handling must be done in the callback, or by means of the undo action.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('UPDATE_TODO'),\n * optimisticUpdate({\n * // provides an action\n * run: (action: UpdateTodo) => {\n * return this.backend.updateTodo(action.todo.id, action.todo).pipe(\n * mapTo({\n * type: 'UPDATE_TODO_SUCCESS',\n * })\n * );\n * },\n * undoAction: (action: UpdateTodo, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return {\n * type: 'UNDO_TODO_UPDATE',\n * todo: action.todo,\n * };\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * Note that if you don't return a new action from the run callback, you must set the dispatch property\n * of the effect to false, like this:\n *\n * ```typescript\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * //...\n * ), { dispatch: false }\n * );\n * }\n * ```\n *\n * @param opts\n */\nexport function optimisticUpdate<T extends Array<unknown>, A extends Action>(\n opts: OptimisticUpdateOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.undoAction))\n );\n };\n}\n\n/**\n *\n * @whatItDoes Handles data fetching.\n *\n * Data fetching implemented naively suffers from race conditions and poor error handling.\n *\n * `fetch` addresses these problems. It runs all fetches in order, which removes race conditions\n * and forces the developer to handle errors.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodos$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('GET_TODOS'),\n * fetch({\n * // provides an action\n * run: (a: GetTodos) => {\n * return this.backend.getAll().pipe(\n * map((response) => ({\n * type: 'TODOS',\n * todos: response.todos,\n * }))\n * );\n * },\n * onError: (action: GetTodos, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * This is correct, but because it set the concurrency to 1, it may not be performant.\n *\n * To fix that, you can provide the `id` function, like this:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('GET_TODO'),\n * fetch({\n * id: (todo: GetTodo) => {\n * return todo.id;\n * },\n * // provides an action\n * run: (todo: GetTodo) => {\n * return this.backend.getTodo(todo.id).map((response) => ({\n * type: 'LOAD_TODO_SUCCESS',\n * todo: response.todo,\n * }));\n * },\n * onError: (action: GetTodo, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * With this setup, the requests for Todo 1 will run concurrently with the requests for Todo 2.\n *\n * In addition, if there are multiple requests for Todo 1 scheduled, it will only run the last one.\n *\n * @param opts\n */\nexport function fetch<T extends Array<unknown>, A extends Action>(\n opts: FetchOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n if (opts.id) {\n const groupedFetches = source.pipe(\n mapActionAndState(),\n groupBy(([action, ...store]) => {\n return opts.id(action, ...store);\n })\n );\n\n return groupedFetches.pipe(\n mergeMap((pairs) =>\n pairs.pipe(switchMap(runWithErrorHandling(opts.run, opts.onError)))\n )\n );\n }\n\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.onError))\n );\n };\n}\n\n/**\n * @whatItDoes Handles data fetching as part of router navigation.\n *\n * Data fetching implemented naively suffers from race conditions and poor error handling.\n *\n * `navigation` addresses these problems.\n *\n * It checks if an activated router state contains the passed in component type, and, if it does, runs the `run`\n * callback. It provides the activated snapshot associated with the component and the current state. And it only runs\n * the last request.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * // listens for the routerNavigation action from @ngrx/router-store\n * navigation(TodoComponent, {\n * run: (activatedRouteSnapshot: ActivatedRouteSnapshot) => {\n * return this.backend\n * .fetchTodo(activatedRouteSnapshot.params['id'])\n * .pipe(\n * map((todo) => ({\n * type: 'LOAD_TODO_SUCCESS',\n * todo: todo,\n * }))\n * );\n * },\n * onError: (\n * activatedRouteSnapshot: ActivatedRouteSnapshot,\n * error: any\n * ) => {\n * // we can log and error here and return null\n * // we can also navigate back\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * @param component\n * @param opts\n */\nexport function navigation<T extends Array<unknown>, A extends Action>(\n component: Type<any>,\n opts: HandleNavigationOpts<T>\n) {\n return (source: ActionStatesStream<T, A>) => {\n const nav = source.pipe(\n mapActionAndState(),\n filter(([action]) => isStateSnapshot(action)),\n map(([action, ...slices]) => {\n if (!isStateSnapshot(action)) {\n // Because of the above filter we'll never get here,\n // but this properly type narrows `action`\n return;\n }\n\n return [\n findSnapshot(component, action.payload.routerState.root),\n ...slices,\n ] as [ActivatedRouteSnapshot, ...T];\n }),\n filter(([snapshot]) => !!snapshot)\n );\n\n return nav.pipe(switchMap(runWithErrorHandling(opts.run, opts.onError)));\n };\n}\n\nfunction isStateSnapshot(\n action: any\n): action is RouterNavigationAction<RouterStateSnapshot> {\n return action.type === ROUTER_NAVIGATION;\n}\n\nfunction runWithErrorHandling<T extends Array<unknown>, A, R>(\n run: (a: A, ...slices: [...T]) => Observable<R> | R | void,\n onError: any\n) {\n return ([action, ...slices]: [A, ...T]): Observable<R> => {\n try {\n const r = wrapIntoObservable(run(action, ...slices));\n return r.pipe(catchError((e) => wrapIntoObservable(onError(action, e))));\n } catch (e) {\n return wrapIntoObservable(onError(action, e));\n }\n };\n}\n\n/**\n * @whatItDoes maps Observable<Action | [Action, State]> to\n * Observable<[Action, State]>\n */\nfunction mapActionAndState<T extends Array<unknown>, A>() {\n return (source: Observable<ActionOrActionWithStates<T, A>>) => {\n return source.pipe(\n map((value) => normalizeActionAndState(value) as [A, ...T])\n );\n };\n}\n\n/**\n * @whatItDoes Normalizes either a bare action or an array of action and slices\n * into an array of action and slices (or undefined)\n */\nfunction normalizeActionAndState<T extends Array<unknown>, A>(\n args: ActionOrActionWithStates<T, A>\n): [A, ...T] {\n let action: A, slices: T;\n\n if (args instanceof Array) {\n [action, ...slices] = args;\n } else {\n slices = [] as T;\n action = args;\n }\n\n return [action, ...slices];\n}\n\nfunction findSnapshot(\n component: Type<any>,\n s: ActivatedRouteSnapshot\n): ActivatedRouteSnapshot {\n if (s.routeConfig && s.routeConfig.component === component) {\n return s;\n }\n for (const c of s.children) {\n const ss = findSnapshot(component, c);\n if (ss) {\n return ss;\n }\n }\n return null;\n}\n\nfunction wrapIntoObservable<O>(obj: Observable<O> | O | void): Observable<O> {\n if (isObservable(obj)) {\n return obj;\n } else if (!obj) {\n return of();\n } else {\n return of(obj as O);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
2
|
-
|
|
3
|
-
import { AppModule } from './app/app.module';
|
|
4
|
-
|
|
5
|
-
function bootstrap() {
|
|
6
|
-
platformBrowserDynamic()
|
|
7
|
-
.bootstrapModule(AppModule)
|
|
8
|
-
.catch((err) => console.error(err));
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (document.readyState !== 'loading') {
|
|
13
|
-
bootstrap();
|
|
14
|
-
} else {
|
|
15
|
-
document.addEventListener('DOMContentLoaded', bootstrap);
|
|
16
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/generators/setup-ssr/files/{base → ngmodule/base}/src/app/__rootModuleFileName__
RENAMED
|
File without changes
|
|
File without changes
|