@@ -40,20 +40,10 @@ export interface RenderOptions {
40
40
*/
41
41
export class CommonEngine {
42
42
43
- /** Return an instance of the platformServer compiler */
44
- getCompiler ( ) : Compiler {
45
- const compilerFactory : CompilerFactory = platformDynamicServer ( ) . injector . get ( CompilerFactory ) ;
46
-
47
- return compilerFactory . createCompiler ( [
48
- { providers : [ { provide : ResourceLoader , useClass : FileLoader , deps : [ ] } ] }
49
- ] ) ;
50
- }
51
-
52
- private factoryCacheMap = new Map < Type < { } > , NgModuleFactory < { } > > ( ) ;
53
- private templateCache = new Map < string , string > ( ) ;
54
- private inlineCriticalCssProcessor : InlineCriticalCssProcessor ;
55
- private pageExists = new Map < string , boolean > ( ) ;
56
-
43
+ private readonly factoryCacheMap = new Map < Type < { } > , NgModuleFactory < { } > > ( ) ;
44
+ private readonly templateCache = new Map < string , string > ( ) ;
45
+ private readonly inlineCriticalCssProcessor : InlineCriticalCssProcessor ;
46
+ private readonly pageExists = new Map < string , boolean > ( ) ;
57
47
58
48
constructor ( private moduleOrFactory ?: Type < { } > | NgModuleFactory < { } > ,
59
49
private providers : StaticProvider [ ] = [ ] ) {
@@ -133,7 +123,7 @@ export class CommonEngine {
133
123
}
134
124
135
125
/** Return the factory for a given engine instance */
136
- async getFactory ( moduleOrFactory : Type < { } > | NgModuleFactory < { } > ) : Promise < NgModuleFactory < { } > > {
126
+ private async getFactory ( moduleOrFactory : Type < { } > | NgModuleFactory < { } > ) : Promise < NgModuleFactory < { } > > {
137
127
// If module has been compiled AoT
138
128
if ( moduleOrFactory instanceof NgModuleFactory ) {
139
129
return moduleOrFactory ;
@@ -155,7 +145,7 @@ export class CommonEngine {
155
145
}
156
146
157
147
/** Retrieve the document from the cache or the filesystem */
158
- async getDocument ( filePath : string ) : Promise < string > {
148
+ private async getDocument ( filePath : string ) : Promise < string > {
159
149
let doc = this . templateCache . get ( filePath ) ;
160
150
161
151
if ( ! doc ) {
@@ -165,4 +155,13 @@ export class CommonEngine {
165
155
166
156
return doc ;
167
157
}
158
+
159
+ /** Return an instance of the platformServer compiler */
160
+ private getCompiler ( ) : Compiler {
161
+ const compilerFactory : CompilerFactory = platformDynamicServer ( ) . injector . get ( CompilerFactory ) ;
162
+
163
+ return compilerFactory . createCompiler ( [
164
+ { providers : [ { provide : ResourceLoader , useClass : FileLoader , deps : [ ] } ] }
165
+ ] ) ;
166
+ }
168
167
}
0 commit comments