gettext-locale-path /srv/translations/core \ node_modules/react-render-server/server.js \ We accomplished this by using supervisor to restart the server every time a source file changed. However because Node caches all of its imports, we needed to invalidate the cache each time we made changes to the React app source code. This code is how we were able to import React files to render components. ReactLogger('Using Babel transpilation') particularly important for the React components written in JSX. imported (using `require`) will get transpiled. When the `transpile` flag is turned on, all future modules With requirejs react-render-server used Babel to transpile modules on-demand with babel-register. Problem successfully punted.Īlso the migration to Webpack allowed us to change our React server-side rendering solution (we call it react-render-server or RRS) in our development environment. However, we did find that turning off editor autosave seemed to decrease the occurrences dramatically. In the beginning, we were too focused on the Webpack migration to investigate the problem deeply. That migration deserves a whole post in itself.ĭuring our months-long migration in 2017 (feature development never stopped by the way), the Frontend Platform team started hearing sporadic reports about Webpack “stopping.” With no obvious reproduction steps, Webpack would stop re-compiling code changes. However, we quickly hit the limits of what requirejs could do with modern libraries and decided to migrate all of our React apps over to Webpack. To limit the scope of the initial switch to React from Backbone, we ran React on the existing infrastructure. Our React applications originally ran on requirejs because that’s what our Backbone / Marionette code used (and still does to this day). Interest piqued? Read on for the details on how we discovered and plugged the memory leak!Ī little background on our frontend infrastructureīefore embarking on our quest for “micro-apps,” we first had to migrate our React apps to Webpack. We narrowed it down to a memory leak in our Docker environment and discovered a bug in the implementation for cache invalidation within our React server-side rendering system. We were experiencing an issue where Webpack would mysteriously stop re-compiling and provide no error messaging. Here in Part 2, we’ll take a quick detour to a project that occupied our time after Single App Mode (SAM), but before we continued towards separating our apps. You can read the full Introduction to our journey as well as Part 1 – Single App Mode outlining our first steps in improving our development environment. We’re documenting this process in a series of posts entitled The Quest for Micro-Apps. Eventbrite is on a quest to convert our “monolith” React application, with 30+ entry points, into individual “micro-apps” that can be developed and deployed individually.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |