Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/svelte.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"prettier-plugin-svelte": "^3.2.4",
"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

"svelte-check": "^4.0.0",
"svelte-preprocess": "^5.1.4",
"tiny-glob": "^0.2.9",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

let { data } = $props();

let repl = $state() as Repl;
let repl = $state() as ReturnType<typeof Repl>;
let name = $state(data.gist.name);
let modified = $state(false);
let version = data.version;
Expand Down
23 changes: 12 additions & 11 deletions packages/editor/src/lib/Workspace.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,11 @@ export class Workspace {
this.#view = null;
}

update_file(file: File) {
if (file.name === this.#current.name) {
// TODO this line causes the editor to keep losign
// focus and I have no idea why. It seems important,
// but it also doesn't appear to break anything
// if we comment it out?
// this.#current = file;
update_file(file: File, from_codemirror = false) {
if (file.name === this.#current.name && !from_codemirror) {
// we don't want to update the file if the update comes from
// codemirror or it will loose focus
this.#current = file;
}

this.#files = this.#files.map((old) => {
Expand Down Expand Up @@ -364,10 +362,13 @@ export class Workspace {
if (update.docChanged) {
const state = this.#view!.state!;

this.update_file({
...this.#current,
contents: state.doc.toString()
});
this.update_file(
{
...this.#current,
contents: state.doc.toString()
},
true
);

// preserve undo/redo across files
this.states.set(this.#current.name, state);
Expand Down
133 changes: 98 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading