Skip to content

Commit

Permalink
chore(examples): upgrade to Svelte 5
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Nov 19, 2024
1 parent 3d184f0 commit 7bb9e30
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 31 deletions.
Binary file modified examples/rollup/bun.lockb
Binary file not shown.
9 changes: 9 additions & 0 deletions examples/rollup/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ export default {
name: "app",
file: "public/build/bundle.js",
},
// ignore Rollup warnings for d3 circular dependencies
onwarn: (warning, warn) => {
if (warning.code === "CIRCULAR_DEPENDENCY") {
if (warning.ids.some((id) => /node_modules\/(svelte)/.test(id))) {
return;
}
}
warn(warning);
},
plugins: [
svelte({
emitCss: false,
Expand Down
8 changes: 4 additions & 4 deletions examples/rollup/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@
<Time relative live />

<!-- Action -->
<time use:svelteTime />
<time use:svelteTime></time>
<time
use:svelteTime={{
timestamp: "2021-02-02",
format: "dddd @ h:mm A · MMMM D, YYYY",
}}
/>
></time>
<time
use:svelteTime={{
timestamp: "2021-02-02",
relative: true,
}}
/>
></time>
<time
data-test="action-relative-live"
use:svelteTime={{
relative: true,
live: true,
}}
/>
></time>

<span>
{time}
Expand Down
5 changes: 2 additions & 3 deletions examples/rollup/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mount } from "svelte";
import App from "./App.svelte";

const app = new App({ target: document.body });

export default app;
mount(App, { target: document.body });
Binary file modified examples/sveltekit/bun.lockb
Binary file not shown.
8 changes: 4 additions & 4 deletions examples/sveltekit/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@
<Time relative live />

<!-- Action -->
<time use:svelteTime />
<time use:svelteTime></time>
<time
use:svelteTime={{
timestamp: "2021-02-02",
format: "dddd @ h:mm A · MMMM D, YYYY",
}}
/>
></time>
<time
use:svelteTime={{
timestamp: "2021-02-02",
relative: true,
}}
/>
></time>
<time
data-test="action-relative-live"
use:svelteTime={{
relative: true,
live: true,
}}
/>
></time>

<span>
{time}
Expand Down
Binary file modified examples/vite/bun.lockb
Binary file not shown.
3 changes: 2 additions & 1 deletion examples/vite/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
</head>
<body>
<script type="module">
import { mount } from "svelte";
import App from "./src/App.svelte";

const app = new App({ target: document.body });
mount(App, { target: document.body });
</script>
</body>
</html>
8 changes: 4 additions & 4 deletions examples/vite/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@
<Time relative live />

<!-- Action -->
<time use:svelteTime />
<time use:svelteTime></time>
<time
use:svelteTime={{
timestamp: "2021-02-02",
format: "dddd @ h:mm A · MMMM D, YYYY",
}}
/>
></time>
<time
use:svelteTime={{
timestamp: "2021-02-02",
relative: true,
}}
/>
></time>
<time
data-test="action-relative-live"
use:svelteTime={{
relative: true,
live: true,
}}
/>
></time>

<span>
{time}
Expand Down
Binary file modified examples/webpack/bun.lockb
Binary file not shown.
8 changes: 4 additions & 4 deletions examples/webpack/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@
<Time relative live />

<!-- Action -->
<time use:svelteTime />
<time use:svelteTime></time>
<time
use:svelteTime={{
timestamp: "2021-02-02",
format: "dddd @ h:mm A · MMMM D, YYYY",
}}
/>
></time>
<time
use:svelteTime={{
timestamp: "2021-02-02",
relative: true,
}}
/>
></time>
<time
data-test="action-relative-live"
use:svelteTime={{
relative: true,
live: true,
}}
/>
></time>

<span>
{time}
Expand Down
5 changes: 2 additions & 3 deletions examples/webpack/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { mount } from "svelte";
import App from "./App.svelte";

const app = new App({ target: document.body });

export default app;
mount(App, { target: document.body });
8 changes: 0 additions & 8 deletions examples/webpack/webpack.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ const PROD = NODE_ENV === "production";
/** @type {import("webpack").Configuration} */
export default {
entry: { "build/bundle": ["./src/index.js"] },
resolve: {
alias: {
svelte: path.resolve("node_modules", "svelte/src/runtime"),
},
extensions: [".mjs", ".js", ".svelte"],
mainFields: ["svelte", "browser", "module", "main"],
conditionNames: ["svelte", "browser", "import"],
},
output: {
publicPath: "/",
path: path.resolve("./public"),
Expand Down

0 comments on commit 7bb9e30

Please sign in to comment.