In a world of emerging JavaScript, is Rails getting left behind? Are server-side MVC applications out and static single page applications in? In this talk I’ll describe how we’ve used webpack(er) and Vue to revitalize our JavaScript approach within an aging Rails application. You can have it both ways.
14. • Many constraints!
• Established MVC server-side application
• Lots of valuable legacy JavaScript
• You do not have a fully featured API to work with (yet)
15. Where did CodeShip start?
( ~ 2 years ago )
• Standard mature Rails application
• Lots of JavaScript sprinkles
• But also CoffeeScript sprinkles
• Lot’s of direct DOM manipulation and jQuery
• Global everything (via Asset Pipeline)
• JavaScript was only exercised within acceptance tests
16. Where do we want to end up?
• Leverage the progress in the JavaScript ecosystem
• JavaScript components as upgraded partials
• Let Rails continue to be good at what Rails is good at
• Our Vue usage should reflect the Vue community
• Testability!
18. Once your JavaScript files express their
dependencies explicitly using ESModules or
CommonJS, webpack can leverage that information
to build your assets in more intelligent ways