daddykotex / smithy4s-code-generation

Preview Smithy4s code generation
https://morning-bird-7081.fly.dev/
MIT License
7 stars 1 forks source link

Feature idea: permalinks #14

Closed kubukoz closed 10 months ago

kubukoz commented 10 months ago

Some playgrounds with code snippets support this, e.g.

https://www.typescriptlang.org/play?#code/C4TwDgpgBAqgzhATlAvFA3gKCjqA7AQwFsIAuKOYRASzwHNtcC6z8BXIgIyUZ2oBNylGvUwBfTEA

I'm not sure what encoding it is, but the original was

type User = {
    name: string
    age: number
    id: string
}

.

We could start by base64-encoding the input, or find a more optimal encoding for code such as the one used by typescript playground.

The "identifier" of the snippet would automatically update the URI in the browser for easy copy-pasting.

kubukoz commented 10 months ago

ok, I got it - lzstring.compressToEncodedURIComponent from https://pieroxy.net/blog/pages/lz-string/index.html . There are typings so we could use ScalablyTyped for the bindings, but given it's just ~2 methods we could write the JS stubs manually too.

daddykotex commented 10 months ago

That's a must have, I thought about it a while back but forgot to record an issue for it, thanks for that

kubukoz commented 10 months ago

I'll give it a go.