FusionAuth / fusionauth-issues

FusionAuth issue submission project
https://fusionauth.io
91 stars 12 forks source link

Bundle JS files in fusionauth-app using webpack #2825

Open lyleschemmerling opened 3 months ago

lyleschemmerling commented 3 months ago

Bundle JS files in fusionauth-app using webpack

Description

At present, we load every javascript file in fusionauth directly, which creates a lot of http requests when a user agent first visits our application. Instead, we should use a bundler like Webpack to consolidate those assets into single files.

Since we are server-side rendered using Freemarker it will be difficult for any tool to scan the templates and determine what javascript to include. The best approach will likely be to define an "entrypoint" javascript file per page, and that javascript file should import anything else that the page needs, preferably using es6 imports. See https://webpack.js.org/concepts/entry-points/

This would also be a very convenient time to switch to typescript 😄

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.