to try React on your app —Or you need to completely change the look and feel of your app (aka the infamous Rebranding) What's Stopping you? @elg0nz - Lumosity - #MadRuby2018
Asset Pipeline with a React app, wasn't trivial. —There is no easy way to port your current HTML/ CSS to React —The current CSS styles clash with your React Apps —It's not clear how to prevent those clashes @elg0nz - Lumosity - #MadRuby2018
for the job —An Impedance mismatch** ** Term borrowed from Electrical engineering that means having incompatible interfaces @elg0nz - Lumosity - #MadRuby2018
libraries into your public folder —And then include a script tag —If two libraries had the same dependency, you had two copies of it on different folders —You had to be careful to change your Javascript file names to invalidate the browsers caches @elg0nz - Lumosity - #MadRuby2018
that does: * Linking: Allows you to 'require' other Javascript files, either internal or third party * Dependency Management: Makes sure your dependencies are properly set * Concatenating: Packs all your javascript code into a single deployable asset. * Minifying: Compresses the Pack above to reduce time * Transpiling: Optimizes your code by transpiling to the most optimal JS possible. @elg0nz - Lumosity - #MadRuby2018
Cybernetics around this idea —In living organisms cells are regenerated, resilient systems act the same way —In order to your system to survive, you will eventually have to replace parts of it (Chad Fowler's Legacy talk goes over this idea at great detail). @elg0nz - Lumosity - #MadRuby2018
all —One of our duties as SW engineers is to be proactive towards potential threats to our systems —Our best tool is use our Radars @elg0nz - Lumosity - #MadRuby2018
protect his consulting company after discovering that the Market had shifted away from the technology they used —The tldr; of it, is that when talking about new technologies you should sort them into three buckets: hold, assess, adopt. @elg0nz - Lumosity - #MadRuby2018
will eventually need a scripting language. —HOLD Dojo Builder (2008): Dojo is still around but not widely used. —ADOPT Asset Pipeline (2011, Rails 3.1) : —HOLD Grunt/Gulp/Bower (2012): The library creators recommend switching to Webpack —ADOPT Webpack (2012): ! —ASSESS Rollup (2015) Looks promising, but it's early —ASSESS Phoenix Asset Pipeline @elg0nz - Lumosity - #MadRuby2018
need them both? —A to keep your existing code around —To rebrand your site incrementally —To enable embedding React into your Rails App @elg0nz - Lumosity - #MadRuby2018
we use on Ruby? Yes. In particular: —"Single Responsibility" You should limit the obligations of each components. —"Open/Closed Principle" Your components should be easier to extend than modify. —(Shay also mentioned this yesterday ) @elg0nz - Lumosity - #MadRuby2018
—BEM is a CSS technique to apply those solid principles by using the following convention for selectors —Block: Standalone Entities —Element: Part of a block that has no standalone meaning —Modifier: Flag or alteration on an element. A state change usually triggers them. @elg0nz - Lumosity - #MadRuby2018
to require blocks only as needed —Yes, there is a small performance penalty, but it's worth it. https://medium.com/@coorasse/partial- rendering-performance-in-rails-101fdfb6ffb9 @elg0nz - Lumosity - #MadRuby2018
app: * Make sure your API (either REST, GraphQL, etc.) can be integrated with your React SPA * If you feel you can't trust your existing code at all, start putting your app using IFRAMEs (Slightly hacky, but it's a great way to guarantee 0% chance of collisions) * If you want to keep all your code on Rails, use react_rails * If your code is clean, you can use JS packs to mount your SPAs where they are needed. @elg0nz - Lumosity - #MadRuby2018
really small, you will have to incrementally port Components from haml/sass to React —Some duplication will happen —You are still deploying backend and frontend code together —Webpack can be hard to configure (and harder with webpacker) @elg0nz - Lumosity - #MadRuby2018
will make it easier to jump to the next tech stack. —"Regardless of how many movers you have, It's always easier to move small/medium boxes than a couple Large ones." —Aspire to "keep your desk clean" (nod Betsy, Sarah Mei) —Keep your Radar on! @elg0nz - Lumosity - #MadRuby2018