hyperbrew / bolt-express

A lightning-fast boilerplate for building Adobe Express Addons in Svelte, React or Vue built on Vite + TypeScript + Sass
6 stars 0 forks source link

Improve Sandbox Reloading #11

Open justintaylor-dev opened 1 month ago

justintaylor-dev commented 1 month ago

While the UI HMR is very fast, currently reloading the Sandbox code.js is very slow since it's waiting on @adobe/ccweb-add-on-scripts to rebuild and reserve the plugin. Takes about 3-4 seconds.

See if there's a way to either:

or

Have tried this on the custom-server branch, but there must be some secret sauce happening in the background. Even after serving the index.json as the script does over HTTPS, Express still doesn't want load the addon unless it's being hosted by ccweb-add-on-scripts

justintaylor-dev commented 1 month ago

Appears that @adobe/create-ccweb-add-on sends a WebSocket message to notify Express to reload the panel. I think this has to come from the some port that's being served.

https://github.com/adobe/create-ccweb-add-on/blob/9693b492c082fb3a8be32d440028bc5a7d7f1b24/packages/wxp-scripts/src/app/WxpSocketServer.ts#L165

Message 1 image image

Message 2 image image

justintaylor-dev commented 1 month ago

Update to copy has sped this up somewhat, takes about 2s instead of 4s to reload backend code now

c6df1da103b9febd0bb1a37f98673e14d0e1352c