solidjs / solidjs/solid-playground

Change URL behavior (parse the content to the url)

Open
#149 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
244
Forks
69
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading related issue #105 and the Vue SFC playground ReplStore linked in the issue. Then inspect the current URL, token, anonymous-user, and share-button behavior. Done requires an agreed content-to-URL round trip and clarified effects on existing sharing and token behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.