Comments (7)
It would take a decent amount of work to implement version-awareness with a decent UI in the REPL. I suspect that if it were well-implemented, that functionality would be accepted, but I think you'd have to be the one to implement it.
Things to consider:
- you would want to show "there's a newer version of this code" to someone viewing an older version
- you would need to list all versions/changes to a given REPL app somewhere
In the meantime, the way that I personally mitigate that kind of risk is by giving my REPL apps a name before linking to them from somewhere else. That way you have a clue as to whether or not an old REPL might be risky to change.
from sites.
I'd definitely be into that if we can come up with a good way to convey 'copy this link to share this version, copy this link to share whatever future versions you might make'.
from sites.
maybe you could just have a lock
button ("lock this code") and when you click on it the code will be saved in a different place and the "locked" pages will still be editable but they won't auto-save.
because this is different behavior you could do
// Enable navigation prompt
window.onbeforeunload = function() {
return true;
};
// Remove navigation prompt
window.onbeforeunload = null;
to make sure people know that the code is read only
from sites.
it is true that I can fork another page B and just work on that page B. But there are times I have bookmarks in my browser, or that I kept a code sample and its REPL URL in my Google docs. So I might re-visit a page without knowing that I should not modify it because 12 days ago, I sent it to somebody.
from sites.
Couldn't this be solved with a permalink to a REPL for this precise version of the code?
You use this for sharing and no problem if you break everything afterward.
Indeed, a notification that a newer version of the code exists would be a nice to have ("it might be better, worse, or completely different ¯\_(ツ)_/¯").
from sites.
The REPL used to have every saved version be a permalink. The behavior changed when the REPL switched from storing code on Gist to storing it in a database. Some people seemed fairly happy with the change in behavior, so it would probably be tough to convince everyone to switch back to the all-permalink-all-the-time implementation.
But like I said, if you're willing to implement a multiple-version-aware version of the REPL with good UI, you could probably get folks on board.
from sites.
I've seen various editors use an URL like: https://host/slug/version
So:
https://svelte.dev/repl/15200f778a624c66b59dc53b6d8f3b3c/0?version=3.20.0
is the original save,
https://svelte.dev/repl/15200f778a624c66b59dc53b6d8f3b3c/1?version=3.20.0
will be the second save
https://svelte.dev/repl/15200f778a624c66b59dc53b6d8f3b3c/2?version=3.20.0
is the next save, etc.
multiple-version-aware version of the REPL with good UI,
Just a dropdown of all the save versions would be the first round IMHO.
from sites.
Related Issues (20)
- REPL user menu is inaccessible HOT 3
- REPL breaks when deleting attributes HOT 2
- Todo app layout broken in animate tutorial
- Improve the component-binding example HOT 2
- Double clicking a filename other than `App.svelte` then clicking the editing area erases all the component
- Add emmet to the Repl HOT 1
- Svelte pages with REPLs start draining significant resources on Firefox when left open for a while
- Svelte REPL component name crash
- Allow loading a local folder when working on the repl
- Blog light mode style has red subtext
- Copy button in code blocks scrolls with overflowing content
- Svelte docs: ts-toggle button doesn't work HOT 2
- REPL: Add `HTML Output` tab
- HN: add https://news.ycombinator.com/best
- Unify Svelte and SvelteKit Websites HOT 1
- REPL broken / stuck on "loading editor"
- Store Svelte version in REPL and add it to `/apps` links
- REPL: Rename of file without changing name clears the file contents
- REPL: "noop" is not exported by "https://unpkg.com/[email protected]/internal/index.js" HOT 2
- It Is Time To Redesign Svelte and SvelteKit Websites HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sites.