There's a regression in JS output. I happen to notice it while upgrading svelte to latest version.
Below is the screenshot from when I was trying to inspect as to why the build isn't working anymore.
I'll summarise shortly. Variable declarations inside the <script module> tag in the JS output are above the import declarations. Which is... invalid, right? Right?!
With the help of @JReinhold and his amazingly quick search skills, we've managed to narrow down when this regression happened.
```js
import * as $ from "svelte/internal/client";
import { confetti } from '@neoconfetti/svelte';
var root = $.template(``);
const result = confetti();
export default function App($$anchor, $$props) {
$.push($$props, false);
$.init();
var div = root();
$.append($$anchor, div);
$.pop();
}
```
```js
const result = confetti();
import * as $ from "svelte/internal/client";
import { confetti } from '@neoconfetti/svelte';
var root = $.template(``);
export default function App($$anchor, $$props) {
$.push($$props, false);
$.init();
var div = root();
$.append($$anchor, div);
$.pop();
}
```
Diff overview, because I'm nice (nah, I love Svelte).
```js
+ const result = confetti();
+
import * as $ from "svelte/internal/client";
import { confetti } from '@neoconfetti/svelte';
var root = $.template(`<div></div>`);
- const result = confetti();
export default function App($$anchor, $$props) {
$.push($$props, false);
$.init();
var div = root();
$.append($$anchor, div);
$.pop();
}
Describe the bug
Hi awesome Svelte maintainers!
There's a regression in JS output. I happen to notice it while upgrading
svelte
to latest version. Below is the screenshot from when I was trying to inspect as to why the build isn't working anymore.I'll summarise shortly. Variable declarations inside the
<script module>
tag in the JS output are above the import declarations. Which is... invalid, right? Right?!With the help of @JReinhold and his amazingly quick search skills, we've managed to narrow down when this regression happened.
So, latest working version is
5.0.0-next.240
Reading the changelogs, I couldn't figure out which one of PR is the culprit, sorry! 😦
Reproduction
5.0.0-next.240
5.0.0-next.243
A quick comparison in the JS output:
Diff overview, because I'm nice (nah, I love Svelte).
Logs
No response
System Info
Severity
blocking an upgrade