-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ema JavaScript API #69
Comments
Could be nice with sending hot-reload events, such as: window.dispatchEvent(new Event('EMABeforeDOMMorph'));
// do DOM morph
window.dispatchEvent(new Event('EMABeforeScriptReload'));
// do script reload
window.dispatchEvent(new Event('EMAHotReload')); |
Would be useful to exclude some scripts from being force-reloaded, such as: <script data-ema-reload="never"> With values for the
The |
@jilleJr Wouldn't it make more sense to upstream |
Yes, well kind of. The script reloading is done by Ema, and it'd be great if that was configurable as well on a per-script-node basis. |
I'm facing ema shim-related difficulties again. Some functions in JS must be called only once after the page is fully loaded, and sadly it's hard to do this currently. The Honestly, I don't know how to work around this issue, and I feel it would be much simpler if ema did not try to replicate all the route switching work and instead leave it to the browser, which does that very well. Instead, it would only live reload inside the same route. But as you pointed out in the other issue, people may prefer the current behavior, so the shim could be customizable. Would you accept a PR adding the possibility for using a different ema shim (from the haskell side)? Footnotes
|
Sorry, I let this comment slip by.
Can you elaborate on this? I'm generally happy to see shim improvements. |
More generally, the WebSocket support should probably be decoupled from ema in some fashion so that users can plug in their own stuff if they want. |
Allow users to 'control' Ema's live server through WebSocket. Add a
window.ema
object containing the API endpoints.ema.switchRoute
to switch to different routes in live server: js: Add ema.switchRoute #70Use cases:
The text was updated successfully, but these errors were encountered: