Skip to content

Conversation

@braidn
Copy link

@braidn braidn commented Aug 13, 2015

Recently we have taken on a project where Sprangular's checkout module/s are the only items we want to incorporate. @simonwalsh and myself have been brainstorming in private how to do this and we feel this is a much better space.

The idea would be to remove the gem/Spree ecosystem and move to a yeoman like, scaffold based system. We could generate/build/deploy (if someone wanted to build a pure front end only application like we are doing now with another project) Sprangular-like mini applications. Examples could be Listing/PDP/Checkout/Cart.

This would also allow us to use Sprangular without the Spree ecosystem. We could bake generators in for Solidus or ROR Ecom (unaware that this was under active dev but definitely is)

What does everyone think?

cc: @joshnuss @bryanmtl @rodrigodalcindev @bourroush @DanielWright

Comments contained in the original PR
@bryanmtl
Copy link
Contributor

Best breakup ever!

@simonwalsh
Copy link
Contributor

Of course, totally down for that!

(Few) Downsides

  • haml/slim/etc support is not great in the node world
  • having to do everything through an API (can't use rails helpers to inject server stuff)
  • ?

Upsides

  • decoupled app ftw
  • can make it flexible
  • can make yo generator for a more streamlined scaffolding
  • deploying a static site
  • easier to implement front-end testing
  • easy to decouple from spree

My main stack would be:

  • yeoman
  • gulp
  • webpack
  • coffee/es6/typescript
  • angular2

By the time we have this in a good state, angular2 will also be out of alpha I believe. Since ng2 and ng1x are gonna be so different from each other, I don't think it is a good idea to start one and refactor to the other. IMO.

@braidn
Copy link
Author

braidn commented Aug 17, 2015

Just a quick question for the group. I have been exploring the limitations and abilities of using something like Yeoman. Throwing generated files into a directory is actually pretty easy. However, once the generator is updated, without parsing the AST, figuring out what has changed from the original generated content and the since modified content, the generated code will not inherent the updated code.

Is this a big deal? Do we care? Or, in this case, is the path to least resistance, cracking open the modified generator, comparing the difference and just copy pasting required changes into the generated files?

Just some food for thought when going down the Yeoman route. I still think, even with the above "limitation", that this idea still makes the most sense.

@simonwalsh
Copy link
Contributor

@braidn

Yep that is a limitation for sure. But with the right folder structure and by having the right strategy to separate the core files (sprangular) from the custom/specific files (your integration), we could be able to run an update with little trouble I believe (like this guy proposes : http://stackoverflow.com/a/18500003)...

@braidn
Copy link
Author

braidn commented Aug 17, 2015

Gotya, the idea of a core folder with using the extends keyword in ES6 to overwrite specific functions of each class is a great idea... That completely escaped me. Inheritance on this core remains clean but, we can overwrite it if needed. 👍

@braidn
Copy link
Author

braidn commented Aug 17, 2015

@braidn
Copy link
Author

braidn commented Aug 17, 2015

@simonwalsh / gang, how do you also feel about using something like this to get us "jump started"?

@simonwalsh
Copy link
Contributor

@braidn How would you feel about jumpstarting straight to angular2? IMO it is a better idea for a fresh start...

This could help : https://github.com/angular-class/angular2-webpack-starter... we would just need to insert gulp in there.

@bryanmtl
Copy link
Contributor

Nice find - it certainly seems interesting enough to test out.

@joshnuss
Copy link
Contributor

Totally great idea,

ES6 is easy to setup with Gulp and Angular 2 would put this ahead of the curve.

Just need to make sure overriding things is easy, since we relied heavily on Rails' asset pipeline to make that happen.

And let's write tests this time :)

@simonwalsh
Copy link
Contributor

@joshnuss Yes and yes! I think tests are the most important thing to nail in this time around!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants