![]() Import ' core-js/stable ' import ' regenerator-runtime/runtime ' īecause we had a few items shared between our sprockets and Webpack builds (AJAX, jQuery, etc), we opted to add this polyfill code in a new shims pack, which would be required in both Javascript contexts. Ultimately, we didn't settle on this, as it would be a network request outside of our control.Īfter some experimentation, we landed on the polyfill approach recommended by Webpacker: ![]() We could load their script from their CDN and let them handle the heavy lifting. One good resolution was to use polyfill.io. Once the first wave of bugs was in, we found some of our customers are using older browsers that aren't compatible with some of the functionality of Javascript code. Unsupported browser methods that can be removed Unsupported browser methods that probably require a polyfill Our list looked something like this: Customer Impact Grouping errors to identify patternsĮarly on, we grouped the errors into categories, ordered by customer impact. Any solution we found had to work equally well in both contexts, even if it meant exposing global objects on window for the time being. The DNSimple app is built on Rails, with half of our Javascript coming from Sprockets via the asset pipeline and the remainder coming from Webpack. After three months, we brought our total unique errors down from ~315 to ~0, modernized our Javascript stack, and moved our legacy tests to our jest testing environment. In our July 2020 planning session, the team decided to allocate some time to "eliminate front end errors". Within a couple weeks, it became clear that we were unaware of many issues. In June 2020, we started tracking client-side Javascript errors using Bugsnag. In this post, we'll look specifically at our Javascript undertaking to find what worked, what didn't, and what's next. ![]() Improving customer-facing code is usually an ambitious, detailed project, and we wanted to share more of the process with you. Throughout 2020, we've made some significant progress in both the Javascript and Ruby worlds. We're always working to improve the quality, reliability, and developer-happiness in DNSimple's customer-facing code.
0 Comments
Leave a Reply. |