-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
WIP: Version switcher #3334
base: develop
Are you sure you want to change the base?
WIP: Version switcher #3334
Conversation
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. |
I made some updates to put the version settings in a modal! To do that, I mostly had to switch the tabs to being controlled instead of uncontrolled so that I could make an action that sets the starting tab. Screen.Recording.2025-02-19.at.8.18.53.PM.movOne thing that isn't quite handled yet is multiple p5.sound versions, that might take a bit more thought. |
I looked into a few HTML parsing options using libraries, and.... none of them did a better job than the native DOMParser API at preserving whitespace (meaning: it doesn't do a great job.) So for now I'm just going to keep using the DOMParser API, and possibly if we want we can make it also run Tidy Code afterwards. |
Another update! Now I'm detecting p5.sound versions, and offering a button to revert back if it was something non-default and we change it at all. This is stored in React state for the IDE view, so even if you close and open the preferences modal, the revert button will still be available. Screen.Recording.2025-02-27.at.6.07.01.PM.mov |
Here's an experiment to see what a version picker could look like on the web editor.
What works so far:
index.html
is edited seems stable and not super laggy!Screen.Recording.2025-02-06.at.8.24.27.PM.mov
What does not work so far, if I uncomment the code to actually replace the contents:
dom.documentElement.outerHTML
doesn't have quite the same formatting as before (e.g. theDOCTYPE
tag is gone) -- maybe there's another attribute I can use, need to experiment moreScreen.Recording.2025-02-06.at.8.17.15.PM.mov