fresh icon indicating copy to clipboard operation
fresh copied to clipboard

feat: Support Partial navigation on every element

Open osddeitf opened this issue 2 years ago • 3 comments

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.

osddeitf avatar Dec 03 '23 05:12 osddeitf

@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

osddeitf avatar Dec 03 '23 05:12 osddeitf

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?

marvinhagemeister avatar Dec 05 '23 12:12 marvinhagemeister

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.

osddeitf avatar Dec 05 '23 12:12 osddeitf