@wavemaker/angular-codegen 11.0.0-next.71007 → 11.0.0-next.71016
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.
- angular-codegen/angular-app/angular.json +80 -81
- angular-codegen/angular-app/package-lock.json +5371 -6618
- angular-codegen/angular-app/package.json +17 -18
- angular-codegen/angular-app/src/framework/services/lazy-component-ref-provider.service.ts +31 -31
- angular-codegen/angular-app/src/framework/util/lazy-module-routes.ts +4 -0
- angular-codegen/angular-app/src/main.ts +1 -1
- angular-codegen/angular-app/tsconfig.json +9 -0
- angular-codegen/angular-app/tsconfig.web-app.json +9 -0
- angular-codegen/dependencies/transpilation-mobile.cjs.js +8961 -7117
- angular-codegen/dependencies/transpilation-web.cjs.js +8961 -7117
- angular-codegen/package.json +1 -1
- angular-codegen/src/codegen.js +1 -1
- angular-codegen/src/gen-lazy-module-routes.js +1 -0
- angular-codegen/src/handlebar-helpers.js +1 -1
- angular-codegen/src/update-angular-json.js +1 -1
- angular-codegen/templates/lazy-module-routes.ts.hbs +3 -0
@@ -18,15 +18,15 @@
|
|
18
18
|
},
|
19
19
|
"private": true,
|
20
20
|
"dependencies": {
|
21
|
-
"@angular/animations": "
|
22
|
-
"@angular/common": "
|
23
|
-
"@angular/compiler": "
|
24
|
-
"@angular/core": "
|
25
|
-
"@angular/forms": "
|
26
|
-
"@angular/platform-browser": "
|
27
|
-
"@angular/platform-browser-dynamic": "
|
28
|
-
"@angular/router": "
|
29
|
-
"@angular/service-worker": "
|
21
|
+
"@angular/animations": "11.2.14",
|
22
|
+
"@angular/common": "11.2.14",
|
23
|
+
"@angular/compiler": "11.2.14",
|
24
|
+
"@angular/core": "11.2.14",
|
25
|
+
"@angular/forms": "11.2.14",
|
26
|
+
"@angular/platform-browser": "11.2.14",
|
27
|
+
"@angular/platform-browser-dynamic": "11.2.14",
|
28
|
+
"@angular/router": "11.2.14",
|
29
|
+
"@angular/service-worker": "11.2.14",
|
30
30
|
"@babel/runtime": "^7.14.8",
|
31
31
|
"@ionic-native/app-version": "4.10.0",
|
32
32
|
"@ionic-native/barcode-scanner": "4.10.0",
|
@@ -68,16 +68,15 @@
|
|
68
68
|
"tslib": "^2.0.0",
|
69
69
|
"x2js": "3.2.6",
|
70
70
|
"zone.js": "~0.10.3",
|
71
|
-
"@wavemaker/app-ng-runtime": "11.0.0-next.
|
71
|
+
"@wavemaker/app-ng-runtime": "11.0.0-next.71016"
|
72
72
|
},
|
73
73
|
"devDependencies": {
|
74
74
|
"@ampproject/rollup-plugin-closure-compiler": "0.8.5",
|
75
|
-
"@angular-builders/custom-webpack": "
|
76
|
-
"@angular-devkit/build-angular": "0.
|
77
|
-
"@angular
|
78
|
-
"@angular/cli": "
|
79
|
-
"@angular/
|
80
|
-
"@angular/language-service": "10.2.5",
|
75
|
+
"@angular-builders/custom-webpack": "11.1.1",
|
76
|
+
"@angular-devkit/build-angular": "0.1102.15",
|
77
|
+
"@angular/cli": "11.2.15",
|
78
|
+
"@angular/compiler-cli": "11.2.14",
|
79
|
+
"@angular/language-service": "11.2.14",
|
81
80
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
82
81
|
"@compodoc/compodoc": "1.1.11",
|
83
82
|
"@types/jasmine": "2.8.8",
|
@@ -103,7 +102,7 @@
|
|
103
102
|
"karma-jasmine-html-reporter": "^1.5.0",
|
104
103
|
"karma-mocha-reporter": "2.2.5",
|
105
104
|
"moment": "2.24.0",
|
106
|
-
"ng-packagr": "
|
105
|
+
"ng-packagr": "11.2.4",
|
107
106
|
"npm-run-all": "4.1.5",
|
108
107
|
"rimraf": "2.6.3",
|
109
108
|
"rollup": "0.65.2",
|
@@ -114,7 +113,7 @@
|
|
114
113
|
"rollup-plugin-node-resolve": "3.4.0",
|
115
114
|
"ts-node": "7.0.1",
|
116
115
|
"tslint": "~6.1.0",
|
117
|
-
"typescript": "
|
116
|
+
"typescript": "4.1.6",
|
118
117
|
"util": "0.11.1"
|
119
118
|
}
|
120
119
|
}
|
@@ -1,55 +1,55 @@
|
|
1
1
|
import {
|
2
2
|
Injectable,
|
3
|
-
NgModuleFactoryLoader,
|
4
3
|
NgModuleRef,
|
5
4
|
Type,
|
6
5
|
Injector,
|
7
|
-
|
8
|
-
|
9
|
-
NgModuleFactory
|
6
|
+
Compiler,
|
7
|
+
NgModuleFactory,
|
10
8
|
} from '@angular/core';
|
11
9
|
import { PartialRefProvider } from '@wm/core';
|
12
10
|
import { ComponentType } from '@wm/runtime/base';
|
13
|
-
|
11
|
+
import { partialLazyModules, prefabLazyModules, prefabPartialLazyModules } from '../util/lazy-module-routes';
|
14
12
|
|
15
13
|
type ModuleWithRoot = Type<any> & { rootComponent: Type<any> };
|
14
|
+
type Options = {
|
15
|
+
prefab: string
|
16
|
+
};
|
16
17
|
|
17
18
|
@Injectable({
|
18
19
|
providedIn: 'root'
|
19
20
|
})
|
20
21
|
export class LazyComponentRefProviderService extends PartialRefProvider {
|
21
22
|
private moduleRef: NgModuleRef<any>;
|
22
|
-
|
23
|
-
|
24
|
-
private injector: Injector
|
25
|
-
) {
|
23
|
+
|
24
|
+
constructor(private injector: Injector, private compiler: Compiler) {
|
26
25
|
super();
|
27
26
|
}
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
27
|
+
|
28
|
+
private getLazyModule(componentName: string, componentType: ComponentType, options?: Options) {
|
29
|
+
if (componentType === ComponentType.PARTIAL && options && options.prefab) {
|
30
|
+
return prefabPartialLazyModules[`${options.prefab}_${componentName}`];
|
31
|
+
}
|
32
|
+
if (componentType === ComponentType.PARTIAL) {
|
33
|
+
return partialLazyModules[componentName];
|
34
|
+
}
|
35
|
+
if (componentType === ComponentType.PREFAB) {
|
36
|
+
return prefabLazyModules[componentName];
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
private async getModuleFactory(moduleOrFactory: NgModuleFactory<any> | Type<any>): Promise<NgModuleFactory<any>> {
|
41
|
+
if (moduleOrFactory instanceof NgModuleFactory) {
|
42
|
+
return moduleOrFactory;
|
43
|
+
} else {
|
44
|
+
return this.compiler.compileModuleAsync(moduleOrFactory);
|
44
45
|
}
|
45
|
-
return null;
|
46
46
|
}
|
47
|
-
|
48
|
-
|
47
|
+
|
48
|
+
public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: Options) {
|
49
49
|
try {
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
const moduleOrFactory = await this.getLazyModule(componentName, componentType, options).loadChildren();
|
51
|
+
const moduleFactory = await this.getModuleFactory(moduleOrFactory);
|
52
|
+
|
53
53
|
this.moduleRef = moduleFactory.create(this.injector);
|
54
54
|
const rootComponent = (moduleFactory.moduleType as ModuleWithRoot)
|
55
55
|
.rootComponent;
|
@@ -19,6 +19,15 @@
|
|
19
19
|
"dom"
|
20
20
|
],
|
21
21
|
"paths": {
|
22
|
+
"rxjs/observable/throw": [
|
23
|
+
"node_modules/rxjs-compat/_esm2015/observable/throw"
|
24
|
+
],
|
25
|
+
"rxjs/observable/*": [
|
26
|
+
"node_modules/rxjs-compat/_esm2015/observable/*"
|
27
|
+
],
|
28
|
+
"rxjs/Observable": [
|
29
|
+
"node_modules/rxjs-compat/_esm2015/Observable"
|
30
|
+
],
|
22
31
|
"@wm/build-task": [
|
23
32
|
"node_modules/@wavemaker/app-ng-runtime/build-task/"
|
24
33
|
],
|
@@ -19,6 +19,15 @@
|
|
19
19
|
"dom"
|
20
20
|
],
|
21
21
|
"paths": {
|
22
|
+
"rxjs/observable/throw": [
|
23
|
+
"node_modules/rxjs-compat/_esm2015/observable/throw"
|
24
|
+
],
|
25
|
+
"rxjs/observable/*": [
|
26
|
+
"node_modules/rxjs-compat/_esm2015/observable/*"
|
27
|
+
],
|
28
|
+
"rxjs/Observable": [
|
29
|
+
"node_modules/rxjs-compat/_esm2015/Observable"
|
30
|
+
],
|
22
31
|
"@wm/build-task": [
|
23
32
|
"node_modules/@wavemaker/app-ng-runtime/build-task/"
|
24
33
|
],
|