diff --git a/benchmark/hn.svelte.dev-with-glory/.gitignore b/benchmark/hn.svelte.dev-with-glory/.gitignore new file mode 100644 index 0000000..23f354f --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +node_modules +/.svelte +/.svelte-kit +/build +/.netlify diff --git a/benchmark/hn.svelte.dev-with-glory/README.md b/benchmark/hn.svelte.dev-with-glory/README.md new file mode 100644 index 0000000..d00da6e --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/README.md @@ -0,0 +1,26 @@ +# hn.svelte.dev + +Hacker News clone built with [Svelte](https://svelte.dev) and [SvelteKit](https://kit.svelte.dev) using the [hnpwa-api](https://github.com/davideast/hnpwa-api) by David East. + +## Running locally + +This example uses a locally built version of SvelteKit, so you'll first need to build the SvelteKit library by running the following from the SvelteKit root directory: + +```bash +pnpm install +pnpm build +``` + +You can then build an run this example, which will be accessible at [localhost:3000](http://localhost:3000): + +```bash +cd examples/hn.svelte.dev +pnpm dev +``` + +To build and start in prod mode: + +```bash +pnpm build +pnpm preview +``` diff --git a/benchmark/hn.svelte.dev-with-glory/globals.d.ts b/benchmark/hn.svelte.dev-with-glory/globals.d.ts new file mode 100644 index 0000000..63908c6 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/globals.d.ts @@ -0,0 +1 @@ +/// diff --git a/benchmark/hn.svelte.dev-with-glory/netlify.toml b/benchmark/hn.svelte.dev-with-glory/netlify.toml new file mode 100644 index 0000000..ea296e2 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/netlify.toml @@ -0,0 +1,9 @@ +[build] + command = "npm run build" + publish = "build" + +[build.environment] + NPM_FLAGS="--prefix=/dev/null" + +[[plugins]] + package = "/.netlify/netlify-plugin-pnpm" diff --git a/benchmark/hn.svelte.dev-with-glory/package-lock.json b/benchmark/hn.svelte.dev-with-glory/package-lock.json new file mode 100644 index 0000000..2c9df14 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/package-lock.json @@ -0,0 +1,656 @@ +{ + "name": "hn.svelte.dev", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "hn.svelte.dev", + "version": "1.0.0", + "dependencies": { + "glory-svelte-preprocess": "^0.2.0" + }, + "devDependencies": { + "@sveltejs/adapter-netlify": "next", + "@sveltejs/kit": "next", + "svelte": "^3.40.0" + } + }, + "node_modules/@blackblock/joli-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@blackblock/joli-string/-/joli-string-1.1.0.tgz", + "integrity": "sha512-HiiC7m35FBLy3eiCO4xBQaQQoJ9kv3N7LX7hCqMrjl7VFJ4Obqm7qlkq0WNMOFS/B/ZwazBgY6CTInZM0qlstA==", + "dependencies": { + "fast-memoize": "^2.5.2" + } + }, + "node_modules/@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true + }, + "node_modules/@rollup/pluginutils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz", + "integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==", + "dev": true, + "dependencies": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/@sveltejs/adapter-netlify": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-netlify/-/adapter-netlify-1.0.0-next.29.tgz", + "integrity": "sha512-CJAdDv7p1brGKQfMPmsgDeBPygstmuN9VYO+x+nV3DfMTPg7WYwDuZ8OwSjCHE4tvsWARHKZGvsSLe1lz0T5ug==", + "dev": true, + "dependencies": { + "@iarna/toml": "^2.2.5", + "esbuild": "^0.12.5" + } + }, + "node_modules/@sveltejs/kit": { + "version": "1.0.0-next.156", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.156.tgz", + "integrity": "sha512-YHT3sbPKpBGSYYFgEpXUx7JhN682wdXhc5INYZGqFfaGqkIOrThosz8qRsLQBfRbFnu0fzgWSsfj7FKq8YeFuA==", + "dev": true, + "dependencies": { + "@sveltejs/vite-plugin-svelte": "^1.0.0-next.16", + "cheap-watch": "^1.0.3", + "sade": "^1.7.4", + "vite": "^2.5.0" + }, + "bin": { + "svelte-kit": "svelte-kit.js" + }, + "engines": { + "node": "^12.20 || >=14.13" + }, + "peerDependencies": { + "svelte": "^3.39.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "1.0.0-next.19", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-1.0.0-next.19.tgz", + "integrity": "sha512-q9hHkMzodScwDq64pNaWhekpj97vWg3wO9T0rqd8bC2EsrBQs2uD1qMJvDqlNd63AbO2uSJMGo+TQ0Xt2xgyYg==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^4.1.1", + "debug": "^4.3.2", + "kleur": "^4.1.4", + "magic-string": "^0.25.7", + "require-relative": "^0.8.7", + "svelte-hmr": "^0.14.7" + }, + "engines": { + "node": "^12.20 || ^14.13.1 || >= 16" + }, + "peerDependencies": { + "diff-match-patch": "^1.0.5", + "svelte": "^3.34.0", + "vite": "^2.3.7" + }, + "peerDependenciesMeta": { + "diff-match-patch": { + "optional": true + } + } + }, + "node_modules/cheap-watch": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cheap-watch/-/cheap-watch-1.0.3.tgz", + "integrity": "sha512-xC5CruMhLzjPwJ5ecUxGu1uGmwJQykUhqd2QrCrYbwvsFYdRyviu6jG9+pccwDXJR/OpmOTOJ9yLFunVgQu9wg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/colorette": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", + "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", + "dev": true + }, + "node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/esbuild": { + "version": "0.12.22", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.22.tgz", + "integrity": "sha512-yWCr9RoFehpqoe/+MwZXJpYOEIt7KOEvNnjIeMZpMSyQt+KCBASM3y7yViiN5dJRphf1wGdUz1+M4rTtWd/ulA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "node_modules/fast-memoize": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", + "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==" + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/glory-svelte-preprocess": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/glory-svelte-preprocess/-/glory-svelte-preprocess-0.2.0.tgz", + "integrity": "sha512-R/m4PMP06z6HeXwHHF9NLDiQOaNZGfn/J/svTIOcVCZb1R3SnkI9s4t6edQXNkzc04foWzyHncCj7mtNaZHl5g==", + "dependencies": { + "@blackblock/joli-string": "^1.1.0", + "magic-string": "^0.25.7", + "svelte": "^3.42.1" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/is-core-module": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", + "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/kleur": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", + "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dependencies": { + "sourcemap-codec": "^1.4.4" + } + }, + "node_modules/mri": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", + "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "dev": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz", + "integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==", + "dev": true, + "dependencies": { + "colorette": "^1.2.2", + "nanoid": "^3.1.23", + "source-map-js": "^0.6.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + } + }, + "node_modules/require-relative": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", + "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", + "dev": true + }, + "node_modules/resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "dependencies": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rollup": { + "version": "2.56.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.3.tgz", + "integrity": "sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=10.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/sade": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", + "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", + "dev": true, + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, + "node_modules/svelte": { + "version": "3.42.3", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.42.3.tgz", + "integrity": "sha512-pbdtdNZEx2GBqSM6XEgPoHbwtvWBwFLt/1bRmzsyXZO+i424wFnPe7O5B3GOJDPFSxPRztumAW3mL5LPzecWUg==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/svelte-hmr": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.14.7.tgz", + "integrity": "sha512-pDrzgcWSoMaK6AJkBWkmgIsecW0GChxYZSZieIYfCP0v2oPyx2CYU/zm7TBIcjLVUPP714WxmViE9Thht4etog==", + "dev": true, + "peerDependencies": { + "svelte": ">=3.19.0" + } + }, + "node_modules/vite": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.5.1.tgz", + "integrity": "sha512-FwmLbbz8MB1pBs9dKoRDgpiqoijif8hSK1+NNUYc12/cnf+pM2UFhhQ1rcpXgbMhm/5c2USZdVAf0FSkSxaFDA==", + "dev": true, + "dependencies": { + "esbuild": "^0.12.17", + "postcss": "^8.3.6", + "resolve": "^1.20.0", + "rollup": "^2.38.5" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": ">=12.2.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + } + }, + "dependencies": { + "@blackblock/joli-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@blackblock/joli-string/-/joli-string-1.1.0.tgz", + "integrity": "sha512-HiiC7m35FBLy3eiCO4xBQaQQoJ9kv3N7LX7hCqMrjl7VFJ4Obqm7qlkq0WNMOFS/B/ZwazBgY6CTInZM0qlstA==", + "requires": { + "fast-memoize": "^2.5.2" + } + }, + "@iarna/toml": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@iarna/toml/-/toml-2.2.5.tgz", + "integrity": "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==", + "dev": true + }, + "@rollup/pluginutils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.1.tgz", + "integrity": "sha512-clDjivHqWGXi7u+0d2r2sBi4Ie6VLEAzWMIkvJLnDmxoOhBYOTfzGbOQBA32THHm11/LiJbd01tJUpJsbshSWQ==", + "dev": true, + "requires": { + "estree-walker": "^2.0.1", + "picomatch": "^2.2.2" + } + }, + "@sveltejs/adapter-netlify": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-netlify/-/adapter-netlify-1.0.0-next.29.tgz", + "integrity": "sha512-CJAdDv7p1brGKQfMPmsgDeBPygstmuN9VYO+x+nV3DfMTPg7WYwDuZ8OwSjCHE4tvsWARHKZGvsSLe1lz0T5ug==", + "dev": true, + "requires": { + "@iarna/toml": "^2.2.5", + "esbuild": "^0.12.5" + } + }, + "@sveltejs/kit": { + "version": "1.0.0-next.156", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.156.tgz", + "integrity": "sha512-YHT3sbPKpBGSYYFgEpXUx7JhN682wdXhc5INYZGqFfaGqkIOrThosz8qRsLQBfRbFnu0fzgWSsfj7FKq8YeFuA==", + "dev": true, + "requires": { + "@sveltejs/vite-plugin-svelte": "^1.0.0-next.16", + "cheap-watch": "^1.0.3", + "sade": "^1.7.4", + "vite": "^2.5.0" + } + }, + "@sveltejs/vite-plugin-svelte": { + "version": "1.0.0-next.19", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-1.0.0-next.19.tgz", + "integrity": "sha512-q9hHkMzodScwDq64pNaWhekpj97vWg3wO9T0rqd8bC2EsrBQs2uD1qMJvDqlNd63AbO2uSJMGo+TQ0Xt2xgyYg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^4.1.1", + "debug": "^4.3.2", + "kleur": "^4.1.4", + "magic-string": "^0.25.7", + "require-relative": "^0.8.7", + "svelte-hmr": "^0.14.7" + } + }, + "cheap-watch": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cheap-watch/-/cheap-watch-1.0.3.tgz", + "integrity": "sha512-xC5CruMhLzjPwJ5ecUxGu1uGmwJQykUhqd2QrCrYbwvsFYdRyviu6jG9+pccwDXJR/OpmOTOJ9yLFunVgQu9wg==", + "dev": true + }, + "colorette": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz", + "integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==", + "dev": true + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "esbuild": { + "version": "0.12.22", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.12.22.tgz", + "integrity": "sha512-yWCr9RoFehpqoe/+MwZXJpYOEIt7KOEvNnjIeMZpMSyQt+KCBASM3y7yViiN5dJRphf1wGdUz1+M4rTtWd/ulA==", + "dev": true + }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "fast-memoize": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/fast-memoize/-/fast-memoize-2.5.2.tgz", + "integrity": "sha512-Ue0LwpDYErFbmNnZSF0UH6eImUwDmogUO1jyE+JbN2gsQz/jICm1Ve7t9QT0rNSsfJt+Hs4/S3GnsDVjL4HVrw==" + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "glory-svelte-preprocess": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/glory-svelte-preprocess/-/glory-svelte-preprocess-0.2.0.tgz", + "integrity": "sha512-R/m4PMP06z6HeXwHHF9NLDiQOaNZGfn/J/svTIOcVCZb1R3SnkI9s4t6edQXNkzc04foWzyHncCj7mtNaZHl5g==", + "requires": { + "@blackblock/joli-string": "^1.1.0", + "magic-string": "^0.25.7", + "svelte": "^3.42.1" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "is-core-module": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", + "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "kleur": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", + "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", + "dev": true + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "mri": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.6.tgz", + "integrity": "sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "nanoid": { + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "postcss": { + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz", + "integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==", + "dev": true, + "requires": { + "colorette": "^1.2.2", + "nanoid": "^3.1.23", + "source-map-js": "^0.6.2" + } + }, + "require-relative": { + "version": "0.8.7", + "resolved": "https://registry.npmjs.org/require-relative/-/require-relative-0.8.7.tgz", + "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", + "dev": true + }, + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, + "rollup": { + "version": "2.56.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.3.tgz", + "integrity": "sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg==", + "dev": true, + "requires": { + "fsevents": "~2.3.2" + } + }, + "sade": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.4.tgz", + "integrity": "sha512-y5yauMD93rX840MwUJr7C1ysLFBgMspsdTo4UVrDg3fXDvtwOyIqykhVAAm6fk/3au77773itJStObgK+LKaiA==", + "dev": true, + "requires": { + "mri": "^1.1.0" + } + }, + "source-map-js": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-0.6.2.tgz", + "integrity": "sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug==", + "dev": true + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, + "svelte": { + "version": "3.42.3", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.42.3.tgz", + "integrity": "sha512-pbdtdNZEx2GBqSM6XEgPoHbwtvWBwFLt/1bRmzsyXZO+i424wFnPe7O5B3GOJDPFSxPRztumAW3mL5LPzecWUg==" + }, + "svelte-hmr": { + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.14.7.tgz", + "integrity": "sha512-pDrzgcWSoMaK6AJkBWkmgIsecW0GChxYZSZieIYfCP0v2oPyx2CYU/zm7TBIcjLVUPP714WxmViE9Thht4etog==", + "dev": true, + "requires": {} + }, + "vite": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-2.5.1.tgz", + "integrity": "sha512-FwmLbbz8MB1pBs9dKoRDgpiqoijif8hSK1+NNUYc12/cnf+pM2UFhhQ1rcpXgbMhm/5c2USZdVAf0FSkSxaFDA==", + "dev": true, + "requires": { + "esbuild": "^0.12.17", + "fsevents": "~2.3.2", + "postcss": "^8.3.6", + "resolve": "^1.20.0", + "rollup": "^2.38.5" + } + } + } +} diff --git a/benchmark/hn.svelte.dev-with-glory/package.json b/benchmark/hn.svelte.dev-with-glory/package.json new file mode 100644 index 0000000..2488d83 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/package.json @@ -0,0 +1,19 @@ +{ + "name": "hn.svelte.dev", + "version": "1.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "svelte-kit dev", + "build": "svelte-kit build --verbose", + "preview": "svelte-kit preview" + }, + "devDependencies": { + "@sveltejs/adapter-netlify": "next", + "@sveltejs/kit": "next", + "svelte": "^3.40.0" + }, + "dependencies": { + "glory-svelte-preprocess": "^0.2.0" + } +} diff --git a/benchmark/hn.svelte.dev-with-glory/src/app.css b/benchmark/hn.svelte.dev-with-glory/src/app.css new file mode 100644 index 0000000..8e31348 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/app.css @@ -0,0 +1,52 @@ +html { + --bg: white; + --fg: #333; + --fg-light: #666; +} + +html.dark { + --bg: #333; + --fg: #eee; + --fg-light: #aaa; +} + +body { + margin: 0; + font-family: Roboto, -apple-system, BlinkMacSystemFont, Segoe UI, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + font-size: 14px; + line-height: 1.5; + background-color: var(--bg); + color: var(--fg); + transition: background-color 0.6s; +} + +@media (prefers-reduced-motion: reduce) { + body { + transition: none; + } +} + +h1, h2, h3, h4, h5, h6 { + margin: 0 0 0.5em 0; + font-weight: 400; + line-height: 1.2; +} + +h1 { + font-size: 2em; +} + +a { + color: inherit; +} + +code { + font-family: menlo, inconsolata, monospace; + font-size: calc(1em - 3px); +} + +@media (min-width: 400px) { + body { + font-size: 16px; + } +} \ No newline at end of file diff --git a/benchmark/hn.svelte.dev-with-glory/src/app.html b/benchmark/hn.svelte.dev-with-glory/src/app.html new file mode 100644 index 0000000..27430f9 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/app.html @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + %svelte.head% + + + +
%svelte.body%
+ + + \ No newline at end of file diff --git a/benchmark/hn.svelte.dev-with-glory/src/lib/Nav.svelte b/benchmark/hn.svelte.dev-with-glory/src/lib/Nav.svelte new file mode 100644 index 0000000..7cc7fec --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/lib/Nav.svelte @@ -0,0 +1,93 @@ + + + + + \ No newline at end of file diff --git a/benchmark/hn.svelte.dev-with-glory/src/lib/PreloadingIndicator.svelte b/benchmark/hn.svelte.dev-with-glory/src/lib/PreloadingIndicator.svelte new file mode 100644 index 0000000..42b2733 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/lib/PreloadingIndicator.svelte @@ -0,0 +1,67 @@ + + + + +{#if visible} +
+
+
+{/if} + +{#if p >= 0.4} +
+{/if} diff --git a/benchmark/hn.svelte.dev-with-glory/src/lib/ThemeToggler.svelte b/benchmark/hn.svelte.dev-with-glory/src/lib/ThemeToggler.svelte new file mode 100644 index 0000000..5806407 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/lib/ThemeToggler.svelte @@ -0,0 +1,81 @@ + + + + + \ No newline at end of file diff --git a/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/[page].svelte b/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/[page].svelte new file mode 100644 index 0000000..bf92108 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/[page].svelte @@ -0,0 +1,57 @@ + + + + + + Svelte Hacker News + + + +{#each items as item, i} + {#if item} + + + {/if} +{/each} + +{#if next} + More... +{/if} diff --git a/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/_ItemSummary.svelte b/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/_ItemSummary.svelte new file mode 100644 index 0000000..c3b2aac --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/_ItemSummary.svelte @@ -0,0 +1,65 @@ + + + + + \ No newline at end of file diff --git a/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/rss.js b/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/rss.js new file mode 100644 index 0000000..f98d0c2 --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/routes/[list]/rss.js @@ -0,0 +1,53 @@ +/** + * @param {string} list + * @param {Record[]} items + */ +const render = (list, items) => ` + + + Svelte HN (${list}) + https://hn.svelte.dev/${list}/1 + Links from the orange site + + https://hn.svelte.dev/favicon.png + Svelte HN (${list}) + https://hn.svelte.dev/${list}/1 + + ${items + .map( + (item) => ` + + ${item.title}${item.domain ? ` (${item.domain})` : ''} + https://hn.svelte.dev/item/${item.id} + link / ` : '' + }comments + ]]> + ${new Date(item.time * 1000).toUTCString()} + + ` + ) + .join('\n')} + +`; + +/** + * @type {import('@sveltejs/kit').RequestHandler} + */ +export function get({ params }) { + const list = + params.list === 'top' ? 'news' : params.list === 'new' ? 'newest' : params.list; + + fetch(`https://api.hnpwa.com/v0/${list}/1.json`) + .then((r) => r.json()) + .then((items) => { + const feed = render(list, items); + return { + body: feed, + headers: { + 'Cache-Control': `max-age=0, s-max-age=${600}`, // 10 minutes + 'Content-Type': 'application/rss+xml' + } + }; + }); +} diff --git a/benchmark/hn.svelte.dev-with-glory/src/routes/__error.svelte b/benchmark/hn.svelte.dev-with-glory/src/routes/__error.svelte new file mode 100644 index 0000000..fc4450d --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/routes/__error.svelte @@ -0,0 +1,56 @@ + + + + + + {title} + + +

{title}

+ +
{message}
+ +{#if dev && error.frame} +
{error.frame}
+{/if} +{#if dev && error.stack} +
{error.stack}
+{/if} + + diff --git a/benchmark/hn.svelte.dev-with-glory/src/routes/__layout.svelte b/benchmark/hn.svelte.dev-with-glory/src/routes/__layout.svelte new file mode 100644 index 0000000..a9e084c --- /dev/null +++ b/benchmark/hn.svelte.dev-with-glory/src/routes/__layout.svelte @@ -0,0 +1,32 @@ + + +