Skip to content
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

feature(universal): add support for Angular Universal #2749

Merged
merged 57 commits into from
Oct 19, 2016

Conversation

devCrossNet
Copy link

add the possibility to scaffold a universal project with --universal.

This is the next attempt to bring in the --universal feature flag.
Related PR: #2318

It is rebased onto the angular-cli/master branch and will update the angular-cli/universal branch.

hansl and others added 30 commits October 4, 2016 15:34
This removes the following warning about webpack dependency.

npm WARN string-replace-loader@1.0.3 requires a peer of webpack@1.x.x || 2.x.x but none was installed.

Close angular#2265
…ar#2486)

With angular#1814 the `defaults.poll` property was added to angular-cli.json. This configuration setting currently applies to `ng serve` but not `ng test`. This fix adds the poll value to the karma defaults so that if you set `defaults: { poll: 1000 }` it will apply to both `ng serve` and `ng test`.
…ngular#2565)

Earlier invalid angular-cli.json yielded only "Error". Now it prints something like:

Parsing angular-cli.json failed. Please make sure your angular-cli.json is valid JSON. Error:
SyntaxError: Unexpected token s in JSON at position 2

Almost the same message is now also used for the other configuration files (schema and other).
Added FAQ label note, assets note, removed dead links/sections.

Fix angular#2411
Close angular#2596
@devCrossNet
Copy link
Author

Can someone give me a hint why this is happening on appvayor:

test-project@0.0.0 pree2e C:\Users\appveyor\AppData\Local\Temp\1\angular-cli-e2e-116918-1312-ufniqq\test-project
webdriver-manager update

C:\Users\appveyor\AppData\Local\Temp\1\angular-cli-e2e-116918-1312-ufniqq\test-project\node_modules\protractor\node_modules\webdriver-manager\built\lib\cmds\update.js:63
var gecko = options[Opt.GECKO].getBoolean();
^

I tested this code on Windows 10 64-bit (Node 4/6), Linux Mint 17 (Node 4/6), OSX (Node 4/6) and it worked.

Did I miss some dependency updates? I don't see it.

@Brocco
Copy link
Contributor

Brocco commented Oct 18, 2016

You can ignore appveyor for now... there's a bug unrelated to our code... I believe when installing a web driver.

@filipesilva
Copy link
Contributor

@devCrossNet context for that error: angular/webdriver-manager#107. It's not something we can fix on our side, I think.

add the possibility to scaffold a universal project with --universal
@devCrossNet
Copy link
Author

So, the PR is ready then?

@Brocco Brocco merged commit 1026670 into angular:universal Oct 19, 2016
@chrillewoodz
Copy link

So the --univseral flag is available now in the CLI if I update?

@devCrossNet
Copy link
Author

@chrillewoodz it has to be published to npm first. @Brocco do you know when it'll be available?

@webmutation
Copy link

webmutation commented Oct 19, 2016

Where is the seed (git url) of the universal project that gets generated?

@devCrossNet
Copy link
Author

@webmutation here is the blueprint: https://github.com/angular/angular-cli/tree/universal/packages/angular-cli/blueprints/universal. It is based on https://github.com/angular/universal-starter

@kylecordes
Copy link

I realize that this optional support for universal is already merged; but I wonder if the project might consider an alternative model?

Maybe "all CLI projects are universal" instead of "there is a switch you can flip, but most people don't flip it, so will likely be issues that come up which are different for universal projects".

@webmutation
Copy link

webmutation commented Oct 19, 2016

@devCrossNet Thanks! Ah, its part of the CLI, i was expecting the mechanism would be more expandable, where it would be possible to point to custom blueprints thru a url, something similar to

ngt new PROJECT-NAME --url:https://github.com/mgechev/angular2-seed (Whatever seed/blueprint)

@devCrossNet
Copy link
Author

@kylecordes there is a lot going on at the moment. this is the first try to figure out how people will use it and how it can be finally integrated to the CLI. We also have to figure out how to play well with the --mobile flag. Or if we should combine --mobile and --universal but with different build targets like prerenderand rerender. But for now, the goal is to get the main CLI to have the 1.0.0 stable release.

@devCrossNet
Copy link
Author

@webmutation this kind of mechanism would be part of the core functionality of the CLI. I don't know if the CLI team is planning something like this. My goal is, to integrate a possibility to use universal within the CLI, based on the best practices of the Universal team.

@goriunov
Copy link

goriunov commented Oct 22, 2016

Hello , thank you very much for your work , i found that angular universal
"angular2-platform-node": "~2.0.11",
"angular2-universal": "~2.0.11",
"angular2-universal-polyfills": "~2.0.11",
"angular2-express-engine": "~2.0.11",
does not work well with
@angular/compiler": "^2.1.0",

it shows error
var SelectorMatcher = compiler_1.compiler_private.SelectorMatcher, CssSelector = compiler_1.compiler_private.CssSelector;
TypeError: Cannot read property 'SelectorMatcher' of undefined

probably need to renew dependency

@devCrossNet
Copy link
Author

@goriunov I disabled the aot support for now. But I want to update the dependencies anyways :-) maybe I can get it to work.

@elekzalan
Copy link

elekzalan commented Oct 24, 2016

@devCrossNet Hello. You have any idea, when the --aot flag is going to work? angular2-universal supports aot compilation since version 2.1.0-rc.1. Thank you for your work on this awesome project. 😃

@MarkPieszak
Copy link
Member

MarkPieszak commented Oct 24, 2016

@goriunov Please use 2.1.0 for Angular Core packages. 2.1.1 changed CssSelector & SelectorMatcher and I'm working on getting the fix in to Universal at the moment. You can follow angular/universal#607 for when they'll be fixed so that we can use 2.1.1 with Universal.

@elekzalan Once we can get a few fixes in there we'll release Universal as 2.1.1, which hopefully will include AoT, the internal compiler fixes (mentioned in my previous comment), etc.

@jaumard
Copy link

jaumard commented Oct 30, 2016

Is the --universal on the last npm version ? Because I didn't find anything on on docs about the flag and generate a new app with it doesn't embed universal :(

@kuldeepkeshwar
Copy link

@devCrossNet does it support AOT with universal 2.1.0-rc.1 ?

@devCrossNet
Copy link
Author

@jaumard the universal-cli support is now a separate package on npm universal-cli

@kuldeepkeshwar no, it is still on universal version 2.0.11, waiting for version 2.1.1.

@chrillewoodz
Copy link

@devCrossNet Why is it a separate package?

@devCrossNet
Copy link
Author

@chrillewoodz please read this comment: #1050 (comment)

@chrillewoodz
Copy link

@devCrossNet Ok makes sense. And you have to uninstall the angular-cli the same way as before, before installing the universal-cli?

@devCrossNet
Copy link
Author

@chrillewoodz yes

@chrillewoodz
Copy link

Has the universal-cli been removed again? Can't seem to find it anymore.

@devCrossNet
Copy link
Author

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet