feat: Support Partial navigation on every element
Fix #1952.
The idea is to assign some common functions / state variables to window. So both the inline-script embeded to html, and islands may be able to import and use it.
@marvinhagemeister I need your review on this. I have tested and it worked fine, but still need more testing and clean up.
The exposed function is currently navigate from /src/runtime/entrypoints/impl/global.ts
This PR is a bit difficult to review because it moves a bunch of things around. Is the idea to expose the navigate function for users?
Yes.
The file entrypoints/main.ts is an entrypoint input to esbuild.
User defined islands are different entrypoints.
It would be hard for them to share the same state variables (different entrypoints are minify differently by esbuild).
So my idea is to assign them to global window object.
It would help if you try viewing different commits one by one. This PR is just a draft anyway, just to show it could work.