Skip to content

Version Packages - #191

Merged
Rich-Harris merged 1 commit into
mainfrom
changeset-release/main
Sep 22, 2026
Merged

Rich-Harris merged 1 commit into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

[email protected]

Patch Changes

  • cc1e996: fix: remove duplicate sourcemap mappings
  • c0b3a7f: chore: remove dts-buddy

@pkg-svelte-dev

pkg-svelte-dev Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Install the latest version of esrap from 1abc1e2:

pnpm add https://pkg.svelte.dev/esrap/c/1abc1e24a82c60399356b2df2864dc2db6084ee5

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/esrap/pr/191

@Rich-Harris Rich-Harris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

huh — turns out #124 doesn't work any more. Something important drifted between when it was opened and when it was merged

@Rich-Harris

Copy link
Copy Markdown
Member

Alright, investigated. Not entirely sure what changed to cause the repro to fail, but I do at least know how to fix it.

It was failing because this code in the repro...

export async function load () {
  const loaded = await files['../../package.json']()
  state = loaded.default
}

...was being transformed thusly...

export async function load() {
  const loaded = (await $.track_reactivity_loss(files['../../package.json']()))();

  $.set(state, loaded.default, true);
}

...and the outer call expression was unmapped. Fixing it requires two changes — one in Svelte...

diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitExpression.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitExpression.js
index 9fcc33287c..a0aec96bf1 100644
--- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitExpression.js
+++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitExpression.js
@@ -18,7 +18,7 @@ export function AwaitExpression(node, context) {
 	// in dev, note which values are read inside a reactive expression,
 	// but don't track them
 	else if (dev && !is_ignored(node, 'await_reactivity_loss')) {
-		return b.call(b.await(b.call('$.track_reactivity_loss', argument)));
+		return b.call({ ...node, argument: b.call('$.track_reactivity_loss', argument) });
 	}
 
 	return argument === node.argument ? node : { ...node, argument };

...and one here:

diff --git a/src/languages/ts/index.js b/src/languages/ts/index.js
index 509e3b2..bdaa845 100644
--- a/src/languages/ts/index.js
+++ b/src/languages/ts/index.js
@@ -676,6 +676,13 @@ export default (options = {}) => {
 		 * @param {Context} context
 		 */
 		'CallExpression|NewExpression': (node, context) => {
+			const loc = node.loc ?? node.callee.loc;
+
+			if (loc) {
+				const { line, column } = loc.start;
+				context.location(line, column);
+			}
+
 			if (node.type === 'NewExpression') {
 				write_keyword(context, node, 'new', ' ');
 			}

Notably, whether or not we add a mapping for the end of a keyword has no bearing on the matter, so I now think we should revert #124 so as to preserve as much information as possible.

@github-actions
github-actions Bot force-pushed the changeset-release/main branch 2 times, most recently from d1d9e25 to 93051ab Compare September 22, 2026 20:17
@github-actions
github-actions Bot force-pushed the changeset-release/main branch from 93051ab to 1abc1e2 Compare September 22, 2026 20:27
@Rich-Harris
Rich-Harris merged commit d2e23a5 into main Sep 22, 2026
7 checks passed
@Rich-Harris
Rich-Harris deleted the changeset-release/main branch September 22, 2026 21:32
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