feat(common): add UniversalEngine to encapsulate rendering#912
feat(common): add UniversalEngine to encapsulate rendering#912CaerusKaru wants to merge 1 commit intomasterfrom
Conversation
|
Full credit to @Toxicable for getting this together. Removed from the commit history because the clabot is evil. |
23732d0 to
83d7bac
Compare
Toxicable
left a comment
There was a problem hiding this comment.
A couple of things that need to be applied to all engines
| @@ -0,0 +1,12 @@ | |||
| // Configuration for IDEs only. | |||
There was a problem hiding this comment.
this was left over from the factor, should be removed
There was a problem hiding this comment.
I think it's important to note that this file should not be extended, and is not being used to build the package
There was a problem hiding this comment.
IDEs, as noted by the comment. It's so that the imports are not considered invalid while editing files.
| "baseUrl": "." | ||
| "baseUrl": ".", | ||
| "paths": { | ||
| "@nguniversal/common": ["../../dist/packages/common"] |
There was a problem hiding this comment.
Should point to ../common - the src not the output, unless this was the fix to the issue I had
There was a problem hiding this comment.
This was exactly the fix to the issue you had
| /** | ||
| * ResourceLoader implimentation for loading files | ||
| */ | ||
| export class FileLoader implements ResourceLoader { |
There was a problem hiding this comment.
Should be @Interval along with the other ones under UniversalEngine
There was a problem hiding this comment.
This file is not exported in the public api so is by default internal
There was a problem hiding this comment.
Unless you mean I should just add an internal comment? In which case sure
| import {FileLoader} from './file-loader'; | ||
| import {RenderOptions} from './interfaces'; | ||
|
|
||
| export class UniversalEngine { |
There was a problem hiding this comment.
Also, I don't think this should be internal. I think the whole point is to encourage usage, even outside of the nguniversal-scope engines.
There was a problem hiding this comment.
That wasn't my original plan. I think for now we should keep it internal, we can always externalize it later on, we cannot internalize it once it's already external
There was a problem hiding this comment.
Alright I've marked it and its methods internal for now, but we really should look at this soon to externalize
| @@ -0,0 +1,9 @@ | |||
| // Configuration for IDEs only. | |||
| @@ -0,0 +1,12 @@ | |||
| // Configuration for IDEs only. | |||
83d7bac to
4e2fe07
Compare
4e2fe07 to
0ddb84d
Compare
|
Setting to blocked while we decide when this should be merged. |
0ddb84d to
b8208c9
Compare
b8208c9 to
514ed07
Compare
514ed07 to
9bddc48
Compare
ef0e48a to
5d50a23
Compare
| const libNames = [ | ||
| 'aspnetcore-engine', | ||
| 'common', | ||
| 'aspnetcore-engine', |
There was a problem hiding this comment.
Not anymore, was leftover from when we used the pre-Material build system. The rationale being that common needed to be built before everything else
5d50a23 to
60d633a
Compare
| node_repositories(package_json = ["//:package.json"]) | ||
|
|
||
|
|
||
| local_repository( |
There was a problem hiding this comment.
This is easier to leave as is since it'll use the one that Angular core depends on, otherwise we could get out of sync
| export { StateTransferInitializerModule } from './src/state-transfer-initilizer/module'; | ||
| export { UniversalEngine as ɵUniversalEngine } from './src/universal-engine/universal-engine'; | ||
| export { NgSetupOptions } from './src/universal-engine/interfaces'; | ||
| export { REQUEST, RESPONSE, ORIGIN_URL } from './src/tokens/index'; |
There was a problem hiding this comment.
Tokens should be a secondary entry point here.
Otherwise we'll get size regressions
60d633a to
26c71ed
Compare
| */ | ||
| export * from './public_api'; | ||
| export * from './interfaces'; | ||
| export {UniversalEngine as ɵUniversalEngine} from './universal-engine'; |
There was a problem hiding this comment.
could you make a private export file for common and do the renaming there
Toxicable
left a comment
There was a problem hiding this comment.
Just the secondary entry on tokens then should be good.
But blocking the merge for now till we do a release with our current status
4c2a51d to
763bc2e
Compare
| "*.ts", | ||
| "src/**/*.ts", | ||
| ]), | ||
| module_name = "@nguniversal/express-engine", |
763bc2e to
12b793b
Compare
|
There's a regression here with I propose we make a secondary entry for the Engine to avoid any more API changes |
|
We should reexport the tokens from their old locations but depricate them so this isn't a breaking change, to be removed in v7 |
* Abstract the common rendering patterns and caching into
a UniversalEngine
* Update build parameters to reflect dependency on
common for existing engines
BREAKING CHANGE:
* The ASP.NET Core, Express, and Hapi engines now have
the Common package as a peer dependency
* The tokens for all engines are now exported from
`@nguniversal/common`
E.g.
BEFORE:
`import {REQUEST, RESPONSE} from '@nguniversal/express-engine/tokens';`
AFTER:
`import {REQUEST, RESPONSE} from '@nguniversal/common';`
|
Closed in favor of #996 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
a UniversalEngine
common for existing engines
BREAKING CHANGE:
the Common package as a peer dependency
@nguniversal/commonE.g.
BEFORE:
import {REQUEST, RESPONSE} from '@nguniversal/express-engine/tokens';AFTER:
import {REQUEST, RESPONSE} from '@nguniversal/common';