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

Updating to cli final from a angular2 project #5663

Closed
harilal opened this issue Mar 26, 2017 · 13 comments
Closed

Updating to cli final from a angular2 project #5663

harilal opened this issue Mar 26, 2017 · 13 comments

Comments

@harilal
Copy link

harilal commented Mar 26, 2017

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request

I have a existing angular2 project which uses the cli rc3. When updating to cli final it create new project in angular4. Also there is no information regarding updating to latest final using angular2. Since its in production its not easy to switch to ng4. So please provide guidelines for the exisiting ng2 application . And also how to cretae angular 2 application in cli final version.

Versions.

Repro steps.

The log given by the failure.

Desired functionality.

Mention any other details that might be useful.

@infinitysky
Copy link

In the final version of the @Angular/cli, which set the ng4 as default project.
Btw the NG4 is fully compatible with NG2 projects. The only thing that you need to check is your 3rd-party Angular library.

@harilal
Copy link
Author

harilal commented Mar 27, 2017

Then how to create a fresh NG2 application using CLI final version?

@RicardoVaranda
Copy link
Contributor

There is not way to create an ng2 app with the final version of the cli, the cli will support building them, but ng new will always be latest major.

@harilal
Copy link
Author

harilal commented Mar 27, 2017

That's kinda weird. Its better to have an option to create a ng2 application. So i think we need to switch to rc4 to create a ng2 application?

@harilal
Copy link
Author

harilal commented Mar 27, 2017

also in the wiki it's says

ng4
`--ng4` _default value: false_

Create a project with Angular 4 in the template.

That's totally misleading.
https://github.com/angular/angular-cli/wiki/new

@RicardoVaranda
Copy link
Contributor

You are right! Thanks for reporting that, I have created a PR to fix this: #5680

In regards to your main issue, I don't see why you would want to create a ng2 project at this stage as ng4 will support your existing ng2 projects.

@harilal
Copy link
Author

harilal commented Mar 27, 2017

@RicardoVaranda That's mostly based on client requirement. Most of them were not ready to use latest/cutting edge one. Since NG2 is almost stable they like to stick to them rather than switching to the new one. Also NG2 to NG4 does have some serious breaking change like in template. That will be huge code rewrite in case of production big projects. As a developer i like to use the latest one. That's not case when we develop for a client. :) just Practicality :)

@RicardoVaranda
Copy link
Contributor

I understand where you are coming from the best way to approach this then would be like you said, if you need to create a new ng2 project then revert to rc4 and create one, from then on just create copies of that project so you don't have to keep reverting back to rc4 since you can still build and serve ng2 on the latest cli.

@harilal
Copy link
Author

harilal commented Mar 27, 2017

@RicardoVaranda Yeah that's the idea. 👍 Other thing is third party libraries. That also needed to be tested before we use it . Will it work if we create a NG4 application and copy the existing NG2 code in to the application?

@RicardoVaranda
Copy link
Contributor

@harilal What I did with my projects was the following:

  • Created an ng4 application with the cli

  • copy and replaced the differences between the package.json

  • move tsconfig.json from /src/ folder to the root of the project /

  • Rename angular-cli.json to .angular-cli.json

@harilal
Copy link
Author

harilal commented Mar 27, 2017

@RicardoVaranda that doesn't worked well for me. So what i did was in a separate machine i updated the cli to final. :) that's more safe. Also my project is in rc4 so it only needs changing the code to work with NG4. :) I will try it and let you the results. Also i read somewhere that there is a big change in bundle sice in NG4. That's one big thing am looking for . So planning to switch to NG4 in near future.

@filipesilva
Copy link
Contributor

Misleading flag fixed in #5649.

The easiest way to make a new project use Angular version 2 is to just update the third party deps as shown here: https://github.com/angular/angular-cli/blob/master/tests/e2e/utils/project.ts#L81-L98

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants