Now it's not possible to add custom pages and components, since we are simply building vite app, and serving it as a static files.
Simplest way to do this is for static part to be served normally, and user provided to be compiled with vite, and server as additional file user-custom.js, which admin panel can dynamically import.
Problem is that IDK if vite is to big dependecy. I do not want to that be user's responsability.
Other option is maybe to use import { } from "react-dom/server" since then app can be rendered on server, maybe???
This is prettier since user is not providing path to file, but code directly
Edit: ReactDOM is not the way, since I still have to provide code to rehydrate on client. I thought that that is not needed with streaming rendered, but I was wrong. So that leaves Vite
Now it's not possible to add custom pages and components, since we are simply building vite app, and serving it as a static files. Simplest way to do this is for static part to be served normally, and user provided to be compiled with vite, and server as additional file
user-custom.js
, which admin panel can dynamically import.Problem is that IDK if vite is to big dependecy. I do not want to that be user's responsability. Other option is maybe to use
import { } from "react-dom/server"
since then app can be rendered on server, maybe??? This is prettier since user is not providing path to file, but code directlyEdit: ReactDOM is not the way, since I still have to provide code to rehydrate on client. I thought that that is not needed with streaming rendered, but I was wrong. So that leaves Vite