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

@IHIutch IHIutch commented May 25, 2026

Copy link
Copy Markdown

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

43081j commented May 27, 2026

Copy link
Copy Markdown
Contributor

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

IHIutch commented May 27, 2026

Copy link
Copy Markdown
Author

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

@43081j

43081j commented May 27, 2026

Copy link
Copy Markdown
Contributor

That will not allow shareability tho

but this need didn't come out of shareability, it came out of being able to go back and forth in your history.

which is why i'd lean more towards just some state instead of introducing an extra feature the original issue didn't need.

we have two separate things:

  1. ability to share package.json results
  2. ability to go back/forward without losing state

i think 1 needs more discussion since adding it means we're supporting unbounded URL params for not much gain IMO. realistically, who wants to share a dropped package.json? Most will be publicly available ones from github, which you can already share.

i think 2 should be solved as its closer to a bug than a feature req.

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