generator-angular-fullstack icon indicating copy to clipboard operation
generator-angular-fullstack copied to clipboard

Angular 2

Open Awk34 opened this issue 8 years ago • 56 comments

After everything @ ng-conf 2016, I now have a plan on transitioning the generator to Angular 2.

Requires:

  • [x] Modules (webpack)
  • [ ] upgrade adapter
  • [x] New router documentation

Awk34 avatar May 07 '16 03:05 Awk34

Care to share the general outline of your plan? Is it simply first getting Webpack / Browserify / SystemJS in place and then a big bang approach with creating an alternative implementation using Angular 2? And envisioning keeping Angular 1 or Angular 1 and 2 hybrid?

Other than various blog posts and Angular 2 docs, inspirational projects one might wanna glance at:

  • https://github.com/NathanWalker/angular2-seed-advanced - Seemingly working example project with Angular 2, Electron and NativeScript.
  • https://github.com/FountainJS/generator-fountain-angular2 Pre-alpha of Angular 2 version of the next generation of yeoman project https://github.com/swiip/generator-gulp-angular.
  • https://github.com/ericmdantas/generator-ng-fullstack - Yeoman project with Angular 1, 2 with NodeJS and Go backend. Mentioned in issue #884
  • https://github.com/angular/angular-cli - The official angular solution using Broccoli and extending ember-cli.

Koslun avatar May 11 '16 23:05 Koslun

I'll be initially removing Bower and opting for Webpack (I would eventually like to support SystemJS as well). I wanted to do this a while ago, but it's a large overhaul. Then I'll set up the upgrade adapter and move components over piece-by-piece. This will make the transition easier, as well as allow for generator users to see exactly how it would be done in one of his/her own apps. Then eventually a full cut-over. I spoke with Igor about Flow support with Angular 2, but there were some reasons I won't get into as to why that got pushed off. At the conference, Brad pretty much said that Angular 2 is production ready for most people, so that was another big deciding factor.

Awk34 avatar May 14 '16 02:05 Awk34

Not trying to stir the pot here, but why wouldn't now be a good time to commit to a single task runner? There are a lot of shops that just use npm now for task running, so providing Gulp is kind of a nice bonus, and Grunt seems like excessive work to keep it up to date. At the time this project was started there was only Grunt, but now it seems like we're past that and can move on.

btw: I still use grunt often, but for the sake of alleviating pressure on the maintainers, and being a lean && mean scaffolding project, one task runner should be good enough. no?

Thoughts?

macneib avatar May 19 '16 22:05 macneib

@macneib oh, you don't know how much I'd like to ditch Grunt, but look at this chart:

screenshot-analytics google com 2016-05-20 10-06-40

Now probably would be a good time to commit to Gulp, but I wonder how the users of the generator would react.

Awk34 avatar May 20 '16 14:05 Awk34

FYI #1911

Awk34 avatar May 20 '16 14:05 Awk34

@Awk34 here's a possible idea, perhaps communicating clearly well in advance where everyone can see it that grunt deprecation is coming then you could measure to see if users are in fact beginning the migration process.

could you console a message in the generator or a warning when selecting Grunt/Gulp that support 'may' be discontinued at a specific version or date?

people with already existing grunt projects won't be affected, however using an tiny bit of FUD may be effective at migrating new projects to one task runner. just an idea.

macneib avatar May 20 '16 16:05 macneib

FUD = Fear, uncertainty and doubt (I had to look that one up, although I hope it doesn't exactly apply here)

I think this sounds like a reasonable plan

Awk34 avatar May 20 '16 16:05 Awk34

FUD <- for lack of a better term. Apologies, I don't mean to suggest scaring people out of grunt, but a clear warning with time to prepare would be fair warning to everyone.

Edit: Migrating to ng2 is a significant undertaking. Bower is being tossed and no one has objected thus far. I think users appreciate things are going to change, and streamlining the project to make that happen sooner rather than later would be the priority IMHO.

macneib avatar May 20 '16 17:05 macneib

I plan on maintaining 3.x.x for the forseeable future, at least

Awk34 avatar May 20 '16 17:05 Awk34

Will ng2 be in 4.x.x?

I just rolled an angular-cli based project last night, and I think it's still too early to use, however I think we all can agree that pre-positioning this generator to be 'ng2-ready' would be kind of a nice thing.

macneib avatar May 20 '16 17:05 macneib

@macneib the plan right now is to release webpack + ng1 with 4.0.0, and ng2 with 5.0.0

Awk34 avatar May 20 '16 17:05 Awk34

I agree about the grunt point, I used to like gulp more but I've used grunt so much I'm actually happier with it now.

mayeaux avatar May 21 '16 18:05 mayeaux

I agree about the grunt point, I used to like gulp more but I've used grunt so much I'm actually happier with it now.

Do you mean the other way around?

Awk34 avatar May 22 '16 03:05 Awk34

I also agree with dropping support for Grunt for the 4.x.x release with a deprecation or/and recommendation of gulp over grunt in this release. And as @Awk34 said, try to get a 3.x.x maintenance release working for some time.

Looking at the PR for webpack support (#1892) I think upgrading will invoke so many breaking changes that the argument about having Grunt around for backwards compatibility kind of falls apart anyway.

So think it more comes down to how much the generator's users prefer grunt over gulp. I'd speculate the preference is generally due how this generator, and by extension many of its users, have used grunt in the past. Which in turn made many of them more comfortable with that, such as @mrmayfield. Especially with the months the gulp option was quite unstable.

But on @macneib point, dropping Grunt means dropping considerable overhead and allow us to get to a ng2-ready state a lot faster I think. And I do think most people would prefer a ng2-ready generator over however much they prefer grunt. With Angular 2 offering so many potential benefits over Angular 1. Save for depending on old Angular 1 code I think it definitely makes a lot more sense to start Angular 2 projects now than Angular 1. If not the current users prefer it I'd bet a lot of other people would.

Either way I do think it's ultimately up to the contributors, as long as we're not racking in lots of donations or something. Anyone else can always pitch in and contribute to getting a grunt version going as well.

Koslun avatar May 22 '16 04:05 Koslun

@Awk34

Do you mean the other way around?

Nope, I'm more comfortable with grunt now, after having originally started with gulp.

mayeaux avatar May 22 '16 04:05 mayeaux

@Awk34

Do you mean the other way around?

Nope, I'm more comfortable with grunt now, after having originally started with gulp.

Yeah I think that's actually what he meant. As both @Awk34, @macneib and myself rather settled on dropping support for grunt in favor of gulp so we can get the generator working with Angular 2 faster.

Koslun avatar May 22 '16 04:05 Koslun

So the interesting question is: "would you trade grunt for faster access to ng2" IMHO yes.

@mrmayfield made the point that he's comfortable with both grunt and gulp although prefers grunt. I think accommodative features like having both grunt and gulp around is one of the many nice aspects about this generator project.

Here's the catch, when asked, @Awk34 indicated in his own words that he would like to ditch grunt to simplify the maintenance overhead of this project. And as long as it's clearly communicated to somewhere so everyone knows this is happening then I think that's reasonable to drop grunt support for now. It also means the release cadence for this project would be faster. (not that it isn't fast now, but it can always be faster :) )

I'm just one user, and everyone has different preferences, restrictions and use cases, but IMHO this conversation should be geared towards how this generator is going to stay current to support new projects going forward as versus staying true to already generated projects. In that context, and given how much work needs to be invested, it's probably sensible sense to get leaner and commit to one task runner and perhaps once the dust settles someone could bring grunt back in if someone is so inclined.

again, just my two cents.

macneib avatar May 23 '16 15:05 macneib

Latest:

screenshot-analytics google com 2016-06-21 12-04-55

Awk34 avatar Jun 21 '16 16:06 Awk34

@Awk34 hehehe

macneib avatar Jun 22 '16 04:06 macneib

Looks like the deprecation warning is working. Here's the past week:

untitled

Awk34 avatar Jun 30 '16 19:06 Awk34

👍 I'm someone who pointed out in the past maybe we want to use Grunt, but Gulp is fine honestly, they are both very similar I feel pretty proficient in both.

mayeaux avatar Jun 30 '16 20:06 mayeaux

As @macneib pointed out earlier in https://github.com/angular-fullstack/generator-angular-fullstack/issues/1869#issuecomment-221011829 the key question is would you trade grunt for faster access to ng2? and I believe most people will answer "yes" to that. I only know gulp from what I read and I would gladly make the leap from grunt if that means getting Angular 2 sooner.

dmarcelino avatar Jul 21 '16 09:07 dmarcelino

@dmarcelino Gulp will be the only choice for 4.0.0

Awk34 avatar Jul 21 '16 14:07 Awk34

@Awk34 what is current progress of transitioning to Angular2?

Abdizriel avatar Aug 24 '16 08:08 Abdizriel

With Angular 2 being released today, You can expect to see a full turnover from Angular 1 to Angular 2 hopefully in the coming months

Awk34 avatar Sep 15 '16 19:09 Awk34

Waiting impatiently !!! You are doing a great Job.

Thanks

aabm00 avatar Sep 16 '16 06:09 aabm00

Really appreciate this, I've been holding out starting of a personal project because I much prefer this generator to others currently supporting Angular2.

MatthewTrout avatar Sep 24 '16 12:09 MatthewTrout

I have a branch locally with support for a hybrid Angular 1.5 / 2.0.0 app. Will try to work out some kinks and then publish it soon.

Awk34 avatar Sep 24 '16 22:09 Awk34

@Awk34 just say if you need any help to speed up process. I really appreciate whole team effort, but generator is few steps behind at the moment, while seizing Angular2.

fcagalj avatar Sep 24 '16 22:09 fcagalj

@fcagalj I have mainly been waiting to add Angular 2 support since a lot has been in flux between RC versions. I have a personal hybrid app that was using up to version RC.4, and RC versions after that completely broke quite a few things. Now that Angular 2.0.0 is stable, I won't have to worry about accounting for a bunch of huge breaking changes.

Awk34 avatar Sep 24 '16 22:09 Awk34