Solveduniversal update to rc5/rc6/rc7
✔️Accepted Answer
Other Answers:
Sorry for the delay again I'll try to be a bit more transparent. I decided to update universal to rc6 which pushed back Universal that was in the middle of being updated to rc5. rc6 required Universal to recreate a lot of internal services that I was reused since the internal angular APIs kept changing. I also determined that there also needs to be a UniversalModule for the browser that now needs to be designed. UniversalModule is needed to seamlessly transition between Node and the Browser.
*/\ list moved to the original post /*
#511 (comment)
I'm shooting for Friday
@gdi2290 : Do you have any idea when the new version of Angular universal supporting rc5 would be released ?
it's updated in the example folder for rc5 and rc6. The universal module has been rebuilt from the ground up. The only things left are rearranging the repo with it, making the new API work with the old API, and then publishing it
https://github.com/angular/universal/blob/master/examples/next-hello-world/src/main.node.ts
import { NgModule, Component, Injectable } from '@angular/core';
import {
NodeModule,
NodeHttpModule,
NodeJsonpModule,
platformDynamicNode, // might be renamed to platformDynamicUniversal
} from '@angular/universal';
import { App } from './app';
@Component({
selector: 'another-component',
template: 'SERVER-RENDERED'
})
class AnotherComponent {}
export const platform = platformDynamicNode();
export function main(document, config?: any) {
@NgModule({
bootstrap: [ App, AnotherComponent ],
declarations: [ App, AnotherComponent ],
imports: [
NodeModule.withConfig({
document: document,
originUrl: 'http://localhost:3000',
baseUrl: '/',
requestUrl: '/',
preboot: {
appRoot: ['app'],
uglify: true
},
}),
NodeHttpModule,
NodeJsonpModule
]
})
class MainModule {
ngOnInit() {
console.log('ngOnInit');
}
// ngDoCheck() {
// console.log('ngDoCheck');
// return true;
// }
ngOnStable() {
console.log('ngOnStable');
}
ngOnRendered() {
console.log('ngOnRendered');
}
}
return platform
.serializeModule(MainModule, config)
.then((html) => {
console.log('done');
return html
});
};
rc6/rc7 update
UNIVERSAL_CACHE
APP_ID
to be passed to client to reuse stylesmove most NodePlatform logic to UniversalPlatformafter initial release
http
/https
WIP angular/zone.js#430fs
angular/zone.js#438experimental