feat: add url param for pasted or dropped package.json#74
Conversation
|
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 ? |
|
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 |
|
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 |
|
I assume this is something similar to what |
|
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 |
Adds
?config=param (vialz-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