Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Svelte repl #182

Open
Snailedlt opened this issue Aug 3, 2023 · 16 comments
Open

Add Svelte repl #182

Snailedlt opened this issue Aug 3, 2023 · 16 comments
Labels
enhancement New feature or request

Comments

@Snailedlt
Copy link

I see that some languages like Vue 3, Alpine and SolidJS have playground links to run the code:
image

It would be nice to have the same for Svelte.
You can use the svelte repl for this purpose: https://svelte.dev/repl/

@matschik
Copy link
Owner

matschik commented Aug 4, 2023

When you click for example on Vue3 REPL on a snippet, look at the URL.
You'll see the snippet code in the url and the REPL is supporting code in URL.
But Svelte REPL seems not.
Can you ask them if they supports this ?

@Snailedlt
Copy link
Author

@matschik looks like it's not implemented, but there's an open issue on it: sveltejs/sites#330

Could we use another repl for this purpose though? Perhaps codesandbox.io like Alpine does?
image
repl link

@Snailedlt
Copy link
Author

Not sure how you do it with Alpine, but I'm guessing you use some starting template, and populate it with code via the url. If that's the case we can probably do the same with svelte using this template: https://codesandbox.io/s/svelte

@matschik
Copy link
Owner

matschik commented Aug 4, 2023

The Alpine playground is not a good example. The good example is Vue 3 playground.
Is Codesandbox supporting code in URL like Vue 3 playground does ?

@Snailedlt
Copy link
Author

I see. I don't know unfortunately

@benmccann
Copy link
Contributor

benmccann commented Aug 20, 2023

We should make sure the contents of the REPL stay in sync with the contents here. Using a hashed URL like suggested in sveltejs/sites#330 would make that difficult, so a better feature might be for the REPL to load the source from GitHub or something along those lines.

@Snailedlt
Copy link
Author

Why would using a hashed URL be difficult? So long as we can programatically create the URL it shouldn't be an issue

@benmccann
Copy link
Contributor

If we expose the ability to create a hashed URL then we can never change the hashing scheme because every site using it would need to be updated

@Snailedlt
Copy link
Author

Fair point. Would definitely be neat to have a repl created and updated based on a GitHub repo

@brunnerh
Copy link
Contributor

brunnerh commented Nov 3, 2023

If we expose the ability to create a hashed URL then we can never change the hashing scheme because every site using it would need to be updated

That should not be much of an issue. A version number could be added so migrations are possible later. E.g.

#v1-<encoded-data>

@Snailedlt
Copy link
Author

Svelte's preview repl for the upcoming runes feature set supports encoded URLs: https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACkVPQQrCMBD8yhI8KArVa2wF_-DNeqjpVhbTTUk2goT-3bRFPc7Mzs5MUh1ZDEpfk-KmR6XVeRjUTsl7mEB4oRXMOLjozcSUwXga5FRzLRYFjIssUMEqSCO43m-OWclaF9kIOQZi47FHlvUG0qTUsni2FRyOC1EUcMEgxA9ANq7FFqK38P3RWJL3dDnWXBb_Alzeo0jOcKyNJfOs0i9tnBvObNCQ5sjZvlhOeVPvWuoIW6XFRxxv4wd_ijFPDgEAAA==

Perhaps the current svelte.repl also does under the hood? I don't see any documentation on it though... So I wouldn't know how it works, or what encoding they use

@benmccann
Copy link
Contributor

Svelte's preview repl for the upcoming runes feature set supports encoded URLs

I would not recommend relying on this domain as the site will not live on after the Svelte 5 launch

Perhaps the current svelte.repl also does under the hood?

It does not

@AliSawari
Copy link

AliSawari commented Jan 24, 2024

The comment above is a scam & phishing attempt. report the user. it just randomly mentioned some users. the website also is not official and a fake clone used for phishing

Repository owner deleted a comment Jan 24, 2024
@matschik
Copy link
Owner

Thanks @AliSawari, I just deleted the content and reported the user.
Crypto scammers spammed social networks and now they begin to spam Github...
Let's move on

@SikandarJODD
Copy link

When you click for example on Vue3 REPL on a snippet, look at the URL. You'll see the snippet code in the url and the REPL is supporting code in URL. But Svelte REPL seems not. Can you ask them if they supports this ?

Can we use : https://www.sveltelab.dev for this ?

@matschik matschik added the enhancement New feature or request label Feb 16, 2024
Repository owner deleted a comment from tim-tepia Mar 18, 2024
@github-staff github-staff deleted a comment Apr 26, 2024
@Snailedlt
Copy link
Author

@SikandarJODD
Looks like it. You're able to share code using the hash, and choose which files you want to share.
Here's how it looks:
image

And here's the resulting hash declare state for the example:
https://www.sveltelab.dev/?files=.%2Fsrc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u6rME2fWhI4uDdbm1G4moOgwOIfsSy-y1DfIIhcM4mzQIW-GuCr8xBfQohZqqalQkwbQYy1cxFFbNHcgPACAV9K87HG8n9EBAnR8rTdLWBVsUbJJPDUQzJBmAfS8WDPVOs7CVi5m15RQ7WJpFuzkrsqQ0MlwgQmbeIBxN4BrCYg5IeWGM41ouYhu6Uyqbu-ZXuoe5wbWftQaQ8PMK2HtfshY1sRa1jP8YFMeNo-ZPLNoxsqJTdVdLVXlKZM3f084hxGYnVV0xmNYkeq9EIBtS1YCH5JUAoaQnLcnB5MB0FGDPIoabqEM8MLYrw2tJGFDF6Beuva9MKabUYT%2B7nUKepHumOTkmYQeQcNpQwxJK4YIxZUaFJEOVCVmM8dum1IiYJXtXQhYD%2B4FUMUChYidE41rHRW5RBp7b0Y9E1ODBDH1SnYWCB5eszLejI9hv04RlIPZfGa9XVTJIBqyUQrR6cRpQpODarehHWcnLGKRofIiZmjJUI9afR41a7YpKMJu%2Bh5exhnhs04FCDRoUwiwoAnBmBq0cDSWD5ACMZWZReUoXJS%2BopAIb6uhn%2B1uoKNhle01I1MjGR70Xgh2G6IOJs3cRIO026EpwZRRyU8nCET1f5Qe6py8a5epqp7xkAnwOdWdJuCe1GC-fJsya7ChhYlmBeWsKdPJ4EGA%2BbGiWQE8ygfOhAQu4u4gLHPiDbXHBLCu9TKutLQ7XkbDSBgZv0zdEh8I6poMvev01jE%2BpBpQ5I5S058ZPumUNpKZRxSJH-Po%2BfOuw5xuqKU1VGe%2BqsGII%2BrGGRkECda5vstI9dWij582es0NRYMIfpv5zJCmJu3uU49F-RNQsoUF4B8F6YPwd%2BxuOaA2csn1PBsZhQ6J0ZimN51NEwfkJuJcu9HjIAA

But this might be a bit overkill since it uses sveltekit, and not just svelte... so there's a lot of other files too that are also shown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants