Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
66 changes: 35 additions & 31 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>⚡️ Lustre Benchmark</title>

<title>⚡️ Lustre Benchmark</title>
<link
rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Source+Sans+Pro|Source+Code+Pro"
/>
<link
rel="stylesheet"
href="https://unpkg.com/charts.css/dist/charts.min.css"
/>
<link rel="stylesheet" href="/priv/index.css" />

<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Source+Sans+Pro|Source+Code+Pro">
<link rel="stylesheet" href="https://unpkg.com/charts.css/dist/charts.min.css">
<link rel="stylesheet" href="/priv/index.css">
<script src="https://unpkg.com/query-selector-shadow-dom@1.0.1/dist/querySelectorShadowDom.js"></script>
<script type="module" src="/priv/static/lustre_benchmark.mjs"></script>

<script src="https://unpkg.com/query-selector-shadow-dom@1.0.1/dist/querySelectorShadowDom.js"></script>
<script type="module" src="/priv/static/lustre_benchmark.mjs"></script>

<script type="application/json" id="implementations">
[
{ "name": "Alpine", "version": "3.14.9", "optimised": false },
{ "name": "Elm", "version": "0.19.1", "optimised": false },
{ "name": "Elm", "version": "0.19.1", "optimised": true },
{ "name": "Gren", "version": "0.6.2", "optimised": false },
{ "name": "Gren", "version": "0.6.2", "optimised": true },
{ "name": "Lustre", "version": "4.6.4", "optimised": false },
{ "name": "Lustre", "version": "5.3.5", "optimised": false },
{ "name": "React", "version": "19.1.0", "optimised": false },
{ "name": "React", "version": "19.1.0", "optimised": true },
{ "name": "Solid", "version": "1.9.5", "optimised": false },
{ "name": "Svelte", "version": "5.25.7", "optimised": false },
{ "name": "Vue", "version": "3.5.13", "optimised": false }
]
</script>
</head>

<body>
</body>
<script type="application/json" id="implementations">
[
{ "name": "Alpine", "version": "3.14.9", "optimised": false },
{ "name": "Elm", "version": "0.19.1", "optimised": false },
{ "name": "Elm", "version": "0.19.1", "optimised": true },
{ "name": "Gren", "version": "0.6.2", "optimised": false },
{ "name": "Gren", "version": "0.6.2", "optimised": true },
{ "name": "Lustre", "version": "4.6.4", "optimised": false },
{ "name": "Lustre", "version": "5.3.5", "optimised": false },
{ "name": "React", "version": "19.1.0", "optimised": false },
{ "name": "React", "version": "19.1.0", "optimised": true },
{ "name": "Solid", "version": "1.9.5", "optimised": false },
{ "name": "Svelte", "version": "5.25.7", "optimised": false },
{ "name": "Svelte", "version": "5.25.7", "optimised": true },
{ "name": "Vue", "version": "3.5.13", "optimised": false }
]
</script>
</head>

<body></body>
</html>
23 changes: 23 additions & 0 deletions priv/implementations/svelte-5.25.7-optimised/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
47 changes: 47 additions & 0 deletions priv/implementations/svelte-5.25.7-optimised/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Svelte + Vite

This template should help get you started developing with Svelte in Vite.

## Recommended IDE Setup

[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).

## Need an official Svelte framework?

Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.

## Technical considerations

**Why use this over SvelteKit?**

- It brings its own routing solution which might not be preferable for some users.
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.

This template contains as little as possible to get started with Vite + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.

Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.

**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**

Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.

**Why include `.vscode/extensions.json`?**

Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.

**Why enable `checkJs` in the JS template?**

It is likely that most cases of changing variable types in runtime are likely to be accidental, rather than deliberate. This provides advanced typechecking out of the box. Should you like to take advantage of the dynamically-typed nature of JavaScript, it is trivial to change the configuration.

**Why is HMR not preserving my local component state?**

HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/sveltejs/svelte-hmr/tree/master/packages/svelte-hmr#preservation-of-local-state).

If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.

```js
// store.js
// An extremely simple external store
import { writable } from 'svelte/store'
export default writable(0)
```

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions priv/implementations/svelte-5.25.7-optimised/dist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Svelte</title>
<link rel="stylesheet" href="https://unpkg.com/todomvc-common/base.css">
<link rel="stylesheet" href="https://unpkg.com/todomvc-app-css/index.css">
<script src="/priv/instrumentation.js"></script>
<script type="module" crossorigin src="./assets/index-CbiSfRMN.js"></script>
</head>

<body>
<section class="todoapp"></section>
<footer class="info">
<p>Double-click to edit a todo</p>
<p>Written by <a href="https://github.com/yoshi-monster">yoshi~</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
</body>

</html>
24 changes: 24 additions & 0 deletions priv/implementations/svelte-5.25.7-optimised/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Svelte</title>
<link rel="stylesheet" href="https://unpkg.com/todomvc-common/base.css">
<link rel="stylesheet" href="https://unpkg.com/todomvc-app-css/index.css">
<script src="/priv/instrumentation.js"></script>
</head>

<body>
<section class="todoapp"></section>
<footer class="info">
<p>Double-click to edit a todo</p>
<p>Written by <a href="https://github.com/yoshi-monster">yoshi~</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script type="module" src="/src/main.js"></script>
</body>

</html>
32 changes: 32 additions & 0 deletions priv/implementations/svelte-5.25.7-optimised/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"moduleResolution": "bundler",
"target": "ESNext",
"module": "ESNext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"verbatimModuleSyntax": true,
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}
Loading