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

WIP: Version switcher #3334

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

davepagurek
Copy link

Here's an experiment to see what a version picker could look like on the web editor.

What works so far:

  • Updating the version when index.html is edited seems stable and not super laggy!
  • The logic of detecting a version only if we see exactly one script tag that we recognize seems to feel right
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:

  • After replacing, dom.documentElement.outerHTML doesn't have quite the same formatting as before (e.g. the DOCTYPE tag is gone) -- maybe there's another attribute I can use, need to experiment more
  • Is there a good way to force CodeMirror to update when this happens? I have a commented-out attempt to replace its contents when the props change and are different than the current content, but this also has the effect of preventing people from typing.
Screen.Recording.2025-02-06.at.8.17.15.PM.mov

Copy link

welcome bot commented Feb 7, 2025

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already.

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

Successfully merging this pull request may close these issues.

1 participant