Reduce DOPP JavaScript size
planned
Tobe Osakwe
We prioritize performance. In order to load and display discounted prices as quickly as possible on online stores, we will use techniques like code-splitting to minimize the size of the DOPP JavaScript.
Currently, the DOPP JavaScript is always in
async
script tags, so it won't block the loading of pages (so you don't need to worry).However, when it comes to performance, we believe that being proactive is the best approach.
We will track progress on this initiative in this thread.
Tobe Osakwe
Instead of code splitting, we will do the following:
- Tree-shaking
- Minification
And:
- Move discount calculation to an API hosted on our server (but run through a Shopify app proxy), instead including all the discount calculation logic in JS.
In addition to helping reduce the DOPP JavaScript, this will also help us ensure consistent discount calculations, as we will be able to remove our existing TypeScript implementation of the discount logic, and just use the same Rust code everywhere.
Tobe Osakwe
planned