This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
[Explorer] NextJS port for Webpack 5 compatibility #25987
Labels
javascript
Pull requests that update Javascript code
stale
[bot only] Added to stale content; results in auto-close after a week.
Greetings maintainers! I (and my team) am currently maintaining a small team via the MLH Solana programme (with assistance from our core devs) and we're looking into upgrading the core framework of the explorer (CRA4 - Webpack 4) over to WP5. In order to do so (while carrying much lesser problems in upgrading), would we stand a chance if the framework moves over from CRA4 to NextJS?
We're also running a fork of the explorer atm and are looking to value-add more cross explorer, but since this chance is significant, looking to consult you guys first!
Problem
Referencing facebook/create-react-app#11756, it is unfavourable to continue to build explorer around CRA. With an impending issue bound to cause a downward spiral due to 0 support with default polyfills - as you can see, the issue has been open for a little over 7 months. It is still Open as of now, and we will never be sure about when it will be resolved.
vercel/next.js#16022 - nextJS add support for browser polyfills for node.js modules
Referencing #25197, most of solana-labs packages have moved to ESModules which does not have support for CRA4, lots of workaround with the usage of writing config-overrides.js and react-app-rewired to try to get ESModules support on CRA4 (locked on older versions)
Proposed Solution
Instead, we propose migration to NextJS (built in Webpack 5 by default).
Static Generation (SG) can be utilised to preload pages which do not change (blocks, transactions, epochs) at all to improve loading performance for the explorer.
Conclusion
If this is not favourable, we can always focus on the upgrade towards CRA5 instead, but its carrying a lot of issues with some of the external package the explorer already is dependent on (like mango's lib)
Hope you guys can approve this idea and we'll start work!
The text was updated successfully, but these errors were encountered: