Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Sandbox Reloading #11

Open
justintaylor-dev opened this issue Sep 29, 2024 · 2 comments
Open

Improve Sandbox Reloading #11

justintaylor-dev opened this issue Sep 29, 2024 · 2 comments

Comments

@justintaylor-dev
Copy link
Contributor

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:

  • Update the code.js outside of ccweb-add-on-scripts and reload the addon sandbox from within the addon itself

or

  • Bypass ccweb-add-on-scripts altogether so we have full control.

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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

c6df1da

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant