Skip to content

Conversation

paoloricciuti
Copy link
Member

The update to this.#current is needed when the value doesn't come from codemirror (like the migrate button) or else codemirror will not update.

This also updated to svelte 5 and fixes a typing issue in +page.svelte

Copy link

vercel bot commented Oct 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
omnisite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 20, 2024 5:25pm

"satori": "^0.10.13",
"satori-html": "^0.3.2",
"svelte": "5.0.0-next.269",
"svelte": "5.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe there's more Svelte package references in the repo, best to bump them all

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the rest of the packages and also the tutorial

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also run a pnpm dedupe and make sure everything still works after that. There are a number of dependencies that now exist multiple times in different versions in the tree.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh i need to pay attention to this more. Run dedupe i'll check now that it's deployed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm I think something broke

@Rich-Harris
Copy link
Member

Do we have any theory as to why the editor is losing focus? I think ideally we'd fix the bug at that point, rather than adding a boolean trap, if we can avoid it

@paoloricciuti
Copy link
Member Author

Do we have any theory as to why the editor is losing focus? I think ideally we'd fix the bug at that point, rather than adding a boolean trap, if we can avoid it

I think it's because by changing the file you are triggering a new "state" for code mirror which re-compute...we fixed in neo code mirror by refocusing the host if I'm not mistaken...let me check

@Rich-Harris
Copy link
Member

States are set explicitly, and only from within the Workspace class — we're setting state inside update_file regardless of whether the update came from CodeMirror. So I think it must be something else — something responding to workspace.current changing

@paoloricciuti
Copy link
Member Author

States are set explicitly, and only from within the Workspace class — we're setting state inside update_file regardless of whether the update came from CodeMirror. So I think it must be something else — something responding to workspace.current changing

Found the culprit...link was run in an effect and this.#current was accessed there...we were basically re-creating the editor view on every change.

@paoloricciuti
Copy link
Member Author

Uh but now the example selectors doesn't work...let me see

@paoloricciuti
Copy link
Member Author

Ok now it should be for real...man Codemirror is such a mess.

@Rich-Harris Rich-Harris merged commit b98cb8e into main Oct 20, 2024
3 checks passed
@Rich-Harris Rich-Harris deleted the fix-migrate-button branch October 20, 2024 18:36
@Rich-Harris
Copy link
Member

fantastic sleuthing!

@paoloricciuti
Copy link
Member Author

sleuthing

[pretends to know what this word means without searching google] Oh yeah...sleuthing!

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.

4 participants