-
Notifications
You must be signed in to change notification settings - Fork 484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update to rc5/rc6/rc7 #511
Comments
Any forecast when you are going to implement this? |
Hi, I would like to know too. Thanks in advance. |
here's a preview of what I have so far which is sticking to the angular API as much as possible import { NgModule } from '@angular/core';
import {
NodeModule,
NodeHttpModule,
NodeJsonpModule,
platformDynamicNode,
} from '@angular/universal';
import { App } from './app';
export const platform = platformDynamicUniversal();
export function main(document) {
@NgModule({
bootstrap: [ App ],
declarations: [ App ],
imports: [
UniversalModule.forRoot(document, {
originUrl: 'http://localhost:3000',
baseUrl: '/',
requestUrl: '/'
}),
NodeHttpModule,
NodeJsonpModule
],
providers: [ ]
})
class MainModule {}
return platform
.serializeModule(MainModule)
.then((html) => {
console.log('done')
return html
});
}; |
Is '@angular/universal' released yet ? I can't get my hand on it with npm. |
@GrandSchtroumpf
This is latest version. But it is not working with latest angular (rc.5). I believe that if you want to use it with rc.5 solution provided by @gdi2290 is working correctly (I did not check it no my end). |
rc.5 is not released yet for universal |
So code which you provided is not compatible with angular rc5? Do I understand correctly? |
the current API is compatible but will be depreciated since I was essentially doing what NgModule now allows me to do. The rc5 release of universal will recommend users to follow the Angular API conventions. The old Bootloader API will still be supported until everyone switches to the new NgModule syntax using |
@gdi2290 : Do you have any idea when the new version of Angular universal supporting rc5 would be released ? |
I'm shooting for Friday |
How's the Friday release looking? |
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 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
});
}; |
Where's |
According to the tsconfig.json :
|
Universal hasn't been publish to the |
I see, thanks! |
@gdi2290: Any estimate on when |
Hey Patrick!!! Thanks for your work... I'm really looking forward for RC5-6 support w/ NgModule. I'm integrating this with the LoopBack Framework and The LoopBack SDK Builder and there is a lot of community interest for this so good job!!! Jonathan Casarrubias |
RC6 just came out, is a new issue ticket required? |
The latest changes in master has rc6 changes. All that's left are integrations, docs, and introduce a few universal services for browser to match up with the server (data/styles) |
Come one guys! Can't wait to play with hmr( |
Hello every one I am new to angular Universal so would like ti ask if you could explain my why we have 2 server files in examples ( express-server.ts and server.ts). I would appreciate your answer . |
@goriunov The examples at the moment are more for just testing if Universal works, and in that case run it in different scenarios, normally you wouldn't need/have those 2 (since they both fire up separate express applications). You can check out the (work in progress) documentation #526 in this PR. When rc5/6 gets published it'll all work something like that. |
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 /* |
@gdi2290 @jeffwhelpley is support for rc7 out? |
@kuldeepkeshwar Check angular/universal-starter@45f8fcd and angular/universal-starter@8ccc07f which updated to RC7 |
I think it's "normal" as AoT support is not yet checked, but I'm trying to use AoT compiler with Universal, and when I use ngc, I get this error : "Unexpected value 'UniversalModule' imported by the module 'AppModule'". AoT is working on the classic app without Universal. Unfortunately I don't know how to help you with this, but I just wanted to let you know. |
AoT support will be in the next release which has a small breaking change (remove main function for ngModule reference) and will be released as 2.0.0 the changes are on my laptop I just need to push it up and cut a release |
angular2 is out of rc! |
yup, the next release will use the 2.0.0 release |
how soon can we expect support for 2.0.0 release ? |
Think Pat said he'll make another push to npm in a few hours? |
ya sorry not tonight as I originally planned. I'm getting a weird typescript error that i need to dive into to figure out why it's giving me the error update: Universal 2.0.x released. ts error fixed |
I did notice that your main.node and main.browser files in angular-universal-starter are completely identical. Maybe start there @gdi2290 :) |
Universal 2.0.x was released on npm. The rest of the items on the list will be released as patches |
The starter for Node and the examples in the documentation are not exactly the same (especially for the main.node as mentioned acthomas06) is one way better than the other ? |
the starter is the best example. the examples in this repo are mostly for stress testing different scenarios etc |
Hi @gdi2290, i see you've checked aot compilation, but i can't get it to work. From what i can gather, all libraries that i use in my project should have an index.metadata.json which is generated by the compiler-cli(ngc compiler). I've tried aot-compiling the universal project myself, but there are a bunch of "Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function" errors. Basically all functions used inside an "@NgModule" need to be exported and referenced. I'll maybe take a look this weekend if i may and i'm right about my assumptions, i just wanted to let everyone searching for this issue know and thanks for all the great work you're putting in! |
we're missing our metadata.json file |
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. |
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 feat(node): patch outgoing http requests to capture the zone zone.js#430fs
feat(node): patch most fs methods zone.js#438experimental
The text was updated successfully, but these errors were encountered: