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

Change URL behavior (parse the content to the url) #149

Open
nirtamir2 opened this issue Aug 5, 2023 · 0 comments
Open

Change URL behavior (parse the content to the url) #149

nirtamir2 opened this issue Aug 5, 2023 · 0 comments

Comments

@nirtamir2
Copy link

I think it's better to take inspiration from Vue SFC playground.
It seems like it creates a hash for the content, and parse it inside it's ReplStore. See https://github.com/vuejs/core/tree/main/packages/sfc-playground
This will make the link is a Bijective function to the content. Which means that we can create cool stuff like programmatically embed content to the url - like in https://github.com/LinusBorg/slidev-theme-vuetiful/blob/348090dff814bb97f835c2944daaf2fd77552d83/layouts/sfc.vue#L32 - the component embed its content programmatically so the content code is readable before injecting it into the url - and we can extract it from the url. The url get const encoded = window.btoa(JSON.stringify(content)) so we can do the reverse with const decodedString = JSON.parse(window.atob(encoded)).
This may affect the way the URL handles now with tokens and anonymous users and the behavior of the share button will be just to copy the URL instead of saving.
This issue is related to #105

@nirtamir2 nirtamir2 changed the title Change URL behavior Change URL behavior (parse the content to the url) Aug 5, 2023
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