Skip to content

feat: add url param for pasted or dropped package.json#74

Open
IHIutch wants to merge 2 commits into
e18e:mainfrom
IHIutch:add-url-param-for-pasted-config
Open

feat: add url param for pasted or dropped package.json#74
IHIutch wants to merge 2 commits into
e18e:mainfrom
IHIutch:add-url-param-for-pasted-config

Conversation

@IHIutch
Copy link
Copy Markdown

@IHIutch IHIutch commented May 25, 2026

Adds ?config= param (via lz-string) to url when pasting or dropping package.json config. This preserves the URL history when clicking into a suggested replacement, allowing the user to navigate "Back" to the full replacement list. This is a similar to the existing behavior of using a GitHub URL

@paoloricciuti
Copy link
Copy Markdown
Collaborator

LZ string will make the url super long if the package.json is big enough (I think it should be well below the URL limit of the browsers)...that said being able to refresh or link the results is something I will probably quite like. WDYT @43081j ?

@43081j
Copy link
Copy Markdown
Contributor

43081j commented May 27, 2026

i'm not sure about this 👀

i like the effect of it (the fact we can then go back and forth).

but i feel like we shouldn't be persisting unbounded JSON blobs in URLs. can we not just hold it in local state somewhere? dump it in sessionStorage or something?

@paoloricciuti
Copy link
Copy Markdown
Collaborator

That will not allow shareability tho...the TS/solid/svelte playground does the same thing but I agree that maybe in our case is not the best. Another option would be to use KV to store them in memory and associate them with an id...but maybe it's an overkill

@gameroman
Copy link
Copy Markdown
Contributor

I assume this is something similar to what npmgraph does

https://npmgraph.js.org/?q=...

@IHIutch
Copy link
Copy Markdown
Author

IHIutch commented May 27, 2026

Happy to update what you think is reasonable. I grabbed lz-string because I was familiar with it from UnoCSS playground. I can look into some other prior art too, like npmgraph, if that's helpful

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

Successfully merging this pull request may close these issues.

4 participants