diff --git a/benches/cases/create-computed/index.html b/benches/cases/create-computed/index.html new file mode 100644 index 000000000..111782cde --- /dev/null +++ b/benches/cases/create-computed/index.html @@ -0,0 +1,14 @@ + + + + + + + + {%TITLE%} + + +

{%NAME%}

+ + + diff --git a/benches/cases/create-computed/index.js b/benches/cases/create-computed/index.js new file mode 100644 index 000000000..8e04c7bdd --- /dev/null +++ b/benches/cases/create-computed/index.js @@ -0,0 +1,14 @@ +import { signal, computed } from "@preact/signals-core"; +import * as bench from "../measure"; + +const count = signal(0); +const double = computed(() => count.value * 2); + +bench.start(); + +for (let i = 0; i < 20000000; i++) { + count.value++; + double.value; +} + +bench.stop(); diff --git a/benches/cases/measure.js b/benches/cases/measure.js new file mode 100644 index 000000000..8d78c91d0 --- /dev/null +++ b/benches/cases/measure.js @@ -0,0 +1,36 @@ +let startTime = 0; + +export function start() { + startTime = performance.now(); +} + +export function stop() { + const end = performance.now(); + const duration = end - startTime; + + const url = new URL(window.location.href); + const test = url.pathname; + + let memory = 0; + if ("gc" in window && "memory" in window) { + window.gc(); + memory = performance.memory.usedJSHeapSize / 1e6; + } + + // eslint-disable-next-line no-console + console.log( + `Time: %c${duration.toFixed(2)}ms ${ + memory > 0 ? `${memory}MB` : "" + }%c- done`, + "color:peachpuff", + "color:inherit" + ); + + return fetch("/results", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ test, duration, memory }), + }); +} diff --git a/benches/index.html b/benches/index.html new file mode 100644 index 000000000..8601e4c4f --- /dev/null +++ b/benches/index.html @@ -0,0 +1,25 @@ + + + + + + + + Benchmarks + + + +
+

Benchmarks

+

+ This is a list of benchmarks we use to measure the performance of + singals with. +

+

View results on the results page.

+

Cases

+ +
+ + diff --git a/benches/package.json b/benches/package.json new file mode 100644 index 000000000..27a35cacb --- /dev/null +++ b/benches/package.json @@ -0,0 +1,21 @@ +{ + "name": "demo", + "private": true, + "scripts": { + "start": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "preact": "10.9.0", + "@preact/signals-core": "workspace:../packages/core", + "@preact/signals": "workspace:../packages/preact" + }, + "devDependencies": { + "@types/connect": "^3.4.35", + "@types/express": "^4.17.14", + "express": "^4.18.1", + "tiny-glob": "^0.2.9", + "vite": "^3.0.7" + } +} diff --git a/benches/public/favicon.ico b/benches/public/favicon.ico new file mode 100644 index 000000000..4b9e9b56e Binary files /dev/null and b/benches/public/favicon.ico differ diff --git a/benches/results.html b/benches/results.html new file mode 100644 index 000000000..d34ca7de1 --- /dev/null +++ b/benches/results.html @@ -0,0 +1,32 @@ + + + + + + + + Results - Benchmarks + + + +
+

Results

+

+ The numbers will be updated whenever you run a benchmark and refresh + this page. +

+ + + + + + + + + + {%ITEMS%} + +
Benchmark NameTime RangeMemory
+
+ + diff --git a/benches/style.css b/benches/style.css new file mode 100644 index 000000000..38ef121a7 --- /dev/null +++ b/benches/style.css @@ -0,0 +1,58 @@ +body { + font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, + "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; +} + +:root { + --primary: #673ab8; + --even: #f3f3f3; +} + +@media (prefers-color-scheme: dark) { + :root { + --even: #242424; + } +} + +.page { + margin: 0 auto; + max-width: 40rem; + padding: 2rem; +} + +table { + border-collapse: collapse; + margin: 25px 0; + font-size: 0.9em; + font-family: sans-serif; + min-width: 400px; + box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); +} + +table thead tr { + background-color: var(--primary); + color: #ffffff; + text-align: left; +} + +table th, +table td { + padding: 12px 15px; +} + +table tbody tr { + border-bottom: 1px solid #dddddd; +} + +table tbody tr:nth-of-type(even) { + background-color: var(--even); +} + +table tbody tr:last-of-type { + border-bottom: 2px solid var(--primary); +} + +table tbody tr.active-row { + font-weight: bold; + color: var(--primary); +} diff --git a/benches/tsconfig.json b/benches/tsconfig.json new file mode 100644 index 000000000..e7d301c81 --- /dev/null +++ b/benches/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "preact", + "module": "esnext" + } +} diff --git a/benches/vite.config.ts b/benches/vite.config.ts new file mode 100644 index 000000000..b06411fb6 --- /dev/null +++ b/benches/vite.config.ts @@ -0,0 +1,177 @@ +import { defineConfig, Plugin } from "vite"; +import { resolve, posix } from "path"; +import fs from "fs"; +import { NextHandleFunction } from "connect"; +import * as express from "express"; + +// Automatically set up aliases for monorepo packages. +// Uses built packages in prod, "source" field in dev. +function packages(prod: boolean) { + const alias: Record = {}; + const root = resolve(__dirname, "../packages"); + for (let name of fs.readdirSync(root)) { + if (name[0] === ".") continue; + const p = resolve(root, name, "package.json"); + const pkg = JSON.parse(fs.readFileSync(p, "utf-8")); + if (pkg.private) continue; + const entry = prod ? "." : pkg.source; + alias[pkg.name] = resolve(root, name, entry); + } + return alias; +} + +export default defineConfig(env => ({ + plugins: [ + indexPlugin(), + multiSpa(["index.html", "results.html", "cases/**/*.html"]), + ], + build: { + polyfillModulePreload: false, + cssCodeSplit: false, + }, + resolve: { + extensions: [".ts", ".tsx", ".js", ".jsx", ".d.ts"], + alias: env.mode === "production" ? {} : packages(false), + }, +})); + +export interface BenchResult { + url: string; + time: number; + memory: number; +} + +function escapeHtml(unsafe: string) { + return unsafe + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/"/g, """) + .replace(/'/g, "'"); +} + +function indexPlugin(): Plugin { + const results = new Map(); + + return { + name: "index-plugin", + configureServer(server) { + server.middlewares.use(express.json()); + server.middlewares.use(async (req, res, next) => { + if (req.url === "/results") { + if (req.method === "GET") { + const cases = await getBenchCases("cases/**/*.html"); + cases.htmlUrls.forEach(url => { + if (!results.has(url)) { + results.set(url, { url, time: 0, memory: 0 }); + } + }); + + const items = Array.from(results.entries()) + .sort((a, b) => a[0].localeCompare(b[0])) + .map(entry => { + return ` + ${escapeHtml(entry[0])} + ${entry[1].time.toFixed(2)}ms + ${entry[1].memory}MB + `; + }) + .join("\n"); + + const html = fs + .readFileSync(resolve(__dirname, "results.html"), "utf-8") + .replace("{%ITEMS%}", items); + res.end(html); + return; + } else if (req.method === "POST") { + // @ts-ignore + const { test, duration, memory } = req.body; + if ( + typeof test !== "string" || + typeof duration !== "number" || + typeof memory !== "number" + ) { + throw new Error("Invalid data"); + } + results.set(test, { url: test, time: duration, memory }); + res.end(); + return; + } + } + + next(); + }); + }, + async transformIndexHtml(html, data) { + if (data.path === "/index.html") { + const cases = await getBenchCases("cases/**/*.html"); + return html.replace( + "{%LIST%}", + cases.htmlEntries.length > 0 + ? cases.htmlUrls + .map( + url => + `
  • ${escapeHtml( + url + )}
  • ` + ) + .join("\n") + : "" + ); + } + + const name = posix.basename(posix.dirname(data.path)); + return html.replace("{%TITLE%}", name).replace("{%NAME%}", name); + }, + }; +} + +// Vite plugin to serve and build multiple SPA roots (index.html dirs) +import glob from "tiny-glob"; + +async function getBenchCases(entries: string | string[]) { + let e = await Promise.all([entries].flat().map(x => glob(x))); + const htmlEntries = Array.from(new Set(e.flat())); + // sort by length, longest to shortest: + const htmlUrls = htmlEntries + .map(x => "/" + x) + .sort((a, b) => b.length - a.length); + return { htmlEntries, htmlUrls }; +} + +function multiSpa(entries: string | string[]): Plugin { + let htmlEntries: string[]; + let htmlUrls: string[]; + + const middleware: NextHandleFunction = (req, res, next) => { + const url = req.url!; + // ignore /@x and file extension URLs: + if (/(^\/@|\.[a-z]+(?:\?.*)?$)/i.test(url)) return next(); + // match the longest index.html parent path: + for (let html of htmlUrls) { + if (!html.endsWith("/index.html")) continue; + if (!url.startsWith(html.slice(0, -10))) continue; + req.url = html; + break; + } + next(); + }; + + return { + name: "multi-spa", + async config() { + const cases = await getBenchCases(entries); + htmlEntries = cases.htmlEntries; + htmlUrls = cases.htmlUrls; + }, + buildStart(options) { + options.input = htmlEntries; + }, + configurePreviewServer(server) { + server.middlewares.use(middleware); + }, + configureServer(server) { + server.middlewares.use(middleware); + }, + }; +} diff --git a/package.json b/package.json index a61d8f307..e5aec61ce 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "docs:start": "cd docs && pnpm start", "docs:build": "cd docs && pnpm build", "docs:preview": "cd docs && pnpm preview", + "bench:start": "cd benches && pnpm start", "ci:build": "pnpm build && pnpm docs:build", "ci:test": "pnpm lint && pnpm test", "release": "pnpm changeset version && pnpm install && git add -A && git commit -m 'Version Packages' && changeset tag && pnpm publish -r" diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 000000000..44019fbb4 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,207 @@ + +# Signals + +Signals is a performant state management library with two primary goals: + +1. Make it as easy as possible to write business logic for small up to complex apps. No matter how complex your logic is, your app updates should stay fast without you needing to think about it. Signals automatically optimize state updates behind the scenes to trigger the fewest updates necessary. They are lazy by default and automatically skip signals that no one listens to. +2. Integrate into frameworks as if they were native built-in primitives. You don't need any selectors, wrapper functions, or anything else. Signals can be accessed directly and your component will automatically re-render when the signal's value changes. + +Read the [announcement post](https://preactjs.com/blog/introducing-signals/) to learn more about which problems signals solves and how it came to be. + +## Installation: + +```sh +# Just the core library +npm install @preact/signals-core +# If you're using Preact +npm install @preact/signals +# If you're using React +npm install @preact/signals-react +# If you're using Svelte +npm install @preact/signals-core +``` + +- [Guide / API](#guide--api) + - [`signal(initialValue)`](#signalinitialvalue) + - [`signal.peek()`](#signalpeek) + - [`computed(fn)`](#computedfn) + - [`effect(fn)`](#effectfn) + - [`batch(fn)`](#batchfn) +- [Preact Integration](./packages/preact/README.md#preact-integration) + - [Hooks](./packages/preact/README.md#hooks) + - [Rendering optimizations](./packages/preact/README.md#rendering-optimizations) + - [Attribute optimization (experimental)](./packages/preact/README.md#attribute-optimization-experimental) +- [React Integration](./packages/react/README.md#react-integration) + - [Hooks](./packages/react/README.md#hooks) +- [License](#license) + +## Guide / API + +The signals library exposes four functions which are the building blocks to model any business logic you can think of. + +### `signal(initialValue)` + +The `signal` function creates a new signal. A signal is a container for a value that can change over time. You can read a signal's value or subscribe to value updates by accessing its `.value` property. + +```js +import { signal } from "@preact/signals-core"; + +const counter = signal(0); + +// Read value from signal, logs: 0 +console.log(counter.value); + +// Write to a signal +counter.value = 1; +``` + +Writing to a signal is done by setting its `.value` property. Changing a signal's value synchronously updates every [computed](#computedfn) and [effect](#effectfn) that depends on that signal, ensuring your app state is always consistent. + +#### `signal.peek()` + +In the rare instance that you have an effect that should write to another signal based on the previous value, but you _don't_ want the effect to be subscribed to that signal, you can read a signals's previous value via `signal.peek()`. + +```js +const counter = signal(0); +const effectCount = signal(0); + +effect(() => { + console.log(counter.value); + + // Whenever this effect is triggered, increase `effectCount`. + // But we don't want this signal to react to `effectCount` + effectCount.value = effectCount.peek() + 1; +}); +``` + +Note that you should only use `signal.peek()` if you really need it. Reading a signal's value via `signal.value` is the preferred way in most scenarios. + +### `computed(fn)` + +Data is often derived from other pieces of existing data. The `computed` function lets you combine the values of multiple signals into a new signal that can be reacted to, or even used by additional computeds. When the signals accessed from within a computed callback change, the computed callback is re-executed and its new return value becomes the computed signal's value. + +```js +import { signal, computed } from "@preact/signals-core"; + +const name = signal("Jane"); +const surname = signal("Doe"); + +const fullName = computed(() => name.value + " " + surname.value); + +// Logs: "Jane Doe" +console.log(fullName.value); + +// Updates flow through computed, but only if someone +// subscribes to it. More on that later. +name.value = "John"; +// Logs: "John Doe" +console.log(fullName.value); +``` + +Any signal that is accessed inside the `computed`'s callback function will be automatically subscribed to and tracked as a dependency of the computed signal. + +### `effect(fn)` + +The `effect` function is the last piece that makes everything reactive. When you access a signal inside its callback function, that signal and every dependency of said signal will be activated and subscribed to. In that regard it is very similar to [`computed(fn)`](#computedfn). By default all updates are lazy, so nothing will update until you access a signal inside `effect`. + +```js +import { signal, computed, effect } from "@preact/signals-core"; + +const name = signal("Jane"); +const surname = signal("Doe"); +const fullName = computed(() => name.value + " " + surname.value); + +// Logs: "Jane Doe" +effect(() => console.log(fullName.value)); + +// Updating one of its dependencies will automatically trigger +// the effect above, and will print "John Doe" to the console. +name.value = "John"; +``` + +You can destroy an effect and unsubscribe from all signals it was subscribed to, by calling the returned function. + +```js +import { signal, computed, effect } from "@preact/signals-core"; + +const name = signal("Jane"); +const surname = signal("Doe"); +const fullName = computed(() => name.value + " " + surname.value); + +// Logs: "Jane Doe" +const dispose = effect(() => console.log(fullName.value)); + +// Destroy effect and subscriptions +dispose(); + +// Update does nothing, because no one is subscribed anymore. +// Even the computed `fullName` signal won't change, because it knows +// that no one listens to it. +surname.value = "Doe 2"; +``` + +### `batch(fn)` + +The `batch` function allows you to combine multiple signal writes into one single update that is triggered at the end when the callback completes. + +```js +import { signal, computed, effect, batch } from "@preact/signals-core"; + +const name = signal("Jane"); +const surname = signal("Doe"); +const fullName = computed(() => name.value + " " + surname.value); + +// Logs: "Jane Doe" +effect(() => console.log(fullName.value)); + +// Combines both signal writes into one update. Once the callback +// returns the `effect` will trigger and we'll log "Foo Bar" +batch(() => { + name.value = "Foo"; + surname.value = "Bar"; +}); +``` + +When you access a signal that you wrote to earlier inside the callback, or access a computed signal that was invalidated by another signal, we'll only update the necessary dependencies to get the current value for the signal you read from. All other invalidated signals will update at the end of the callback function. + +```js +import { signal, computed, effect, batch } from "@preact/signals-core"; + +const counter = signal(0); +const double = computed(() => counter.value * 2); +const triple = computed(() => counter.value * 3); + +effect(() => console.log(double.value, triple.value)); + +batch(() => { + counter.value = 1; + // Logs: 2, despite being inside batch, but `triple` + // will only update once the callback is complete + console.log(double.value); +}); +// Now we reached the end of the batch and call the effect +``` + +Batches can be nested and updates will be flushed when the outermost batch call completes. + +```js +import { signal, computed, effect, batch } from "@preact/signals-core"; + +const counter = signal(0); +effect(() => console.log(counter.value)); + +batch(() => { + batch(() => { + // Signal is invalidated, but update is not flushed because + // we're still inside another batch + counter.value = 1; + }); + + // Still not updated... +}); +// Now the callback completed and we'll trigger the effect. +``` + +## License + +`MIT`, see the [LICENSE](./LICENSE) file. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 705a29c99..cd24a598c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,12 +1,12 @@ lockfileVersion: 5.4 patchedDependencies: - microbundle@0.15.1: - hash: yvstdq4ikeml4yz3a6bi3bgrvu - path: patches/microbundle@0.15.1.patch '@babel/plugin-transform-typescript@7.19.1': hash: tiqrfntt5y3ned567j2lekmz2i path: patches/@babel__plugin-transform-typescript@7.19.1.patch + microbundle@0.15.1: + hash: yvstdq4ikeml4yz3a6bi3bgrvu + path: patches/microbundle@0.15.1.patch importers: @@ -94,6 +94,27 @@ importers: sinon-chai: 3.7.0_chai@4.3.6+sinon@14.0.0 typescript: 4.7.4 + benches: + specifiers: + '@preact/signals': workspace:../packages/preact + '@preact/signals-core': workspace:../packages/core + '@types/connect': ^3.4.35 + '@types/express': ^4.17.14 + express: ^4.18.1 + preact: 10.9.0 + tiny-glob: ^0.2.9 + vite: ^3.0.7 + dependencies: + '@preact/signals': link:../packages/preact + '@preact/signals-core': link:../packages/core + preact: 10.9.0 + devDependencies: + '@types/connect': 3.4.35 + '@types/express': 4.17.14 + express: 4.18.1 + tiny-glob: 0.2.9 + vite: 3.0.7 + docs: specifiers: '@babel/core': ^7.18.10 @@ -2186,6 +2207,13 @@ packages: engines: {node: '>=10.13.0'} dev: true + /@types/body-parser/1.19.2: + resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} + dependencies: + '@types/connect': 3.4.35 + '@types/node': 18.6.5 + dev: true + /@types/chai/4.3.3: resolution: {integrity: sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==} dev: true @@ -2194,6 +2222,12 @@ packages: resolution: {integrity: sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==} dev: true + /@types/connect/3.4.35: + resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + dependencies: + '@types/node': 18.6.5 + dev: true + /@types/cookie/0.4.1: resolution: {integrity: sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==} dev: true @@ -2210,6 +2244,23 @@ packages: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: true + /@types/express-serve-static-core/4.17.31: + resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} + dependencies: + '@types/node': 18.6.5 + '@types/qs': 6.9.7 + '@types/range-parser': 1.2.4 + dev: true + + /@types/express/4.17.14: + resolution: {integrity: sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==} + dependencies: + '@types/body-parser': 1.19.2 + '@types/express-serve-static-core': 4.17.31 + '@types/qs': 6.9.7 + '@types/serve-static': 1.15.0 + dev: true + /@types/is-ci/3.0.0: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: @@ -2220,6 +2271,10 @@ packages: resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} dev: true + /@types/mime/3.0.1: + resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} + dev: true + /@types/minimist/1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true @@ -2248,6 +2303,14 @@ packages: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} dev: true + /@types/qs/6.9.7: + resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} + dev: true + + /@types/range-parser/1.2.4: + resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} + dev: true + /@types/react-dom/18.0.6: resolution: {integrity: sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==} dependencies: @@ -2276,6 +2339,13 @@ packages: resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} dev: true + /@types/serve-static/1.15.0: + resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} + dependencies: + '@types/mime': 3.0.1 + '@types/node': 18.6.5 + dev: true + /@types/sinon-chai/3.2.8: resolution: {integrity: sha512-d4ImIQbT/rKMG8+AXpmcan5T2/PNeSjrYhvkwet6z0p8kzYtfgA32xzOBlbU0yqJfq+/0Ml805iFoODO0LP5/g==} dependencies: @@ -2545,6 +2615,10 @@ packages: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: true + /array-flatten/1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + dev: true + /array-union/2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} @@ -3037,6 +3111,13 @@ packages: - supports-color dev: true + /content-disposition/0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: true + /content-type/1.0.4: resolution: {integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==} engines: {node: '>= 0.6'} @@ -3048,11 +3129,20 @@ packages: safe-buffer: 5.1.2 dev: true + /cookie-signature/1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + dev: true + /cookie/0.4.2: resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==} engines: {node: '>= 0.6'} dev: true + /cookie/0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: true + /core-js-compat/3.25.1: resolution: {integrity: sha512-pOHS7O0i8Qt4zlPW/eIFjwp+NrTPx+wTL0ctgI2fHn31sZOq89rDsmtc/A2vAX7r6shl+bmVI+678He46jgBlw==} dependencies: @@ -3931,6 +4021,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /etag/1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: true + /eventemitter3/4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} dev: true @@ -3950,6 +4045,45 @@ packages: strip-final-newline: 3.0.0 dev: true + /express/4.18.1: + resolution: {integrity: sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.0 + content-disposition: 0.5.4 + content-type: 1.0.4 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.10.3 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + /extend/3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} dev: true @@ -4044,6 +4178,21 @@ packages: - supports-color dev: true + /finalhandler/1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /find-cache-dir/3.3.2: resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} engines: {node: '>=8'} @@ -4103,10 +4252,20 @@ packages: optional: true dev: true + /forwarded/0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: true + /fraction.js/4.2.0: resolution: {integrity: sha512-MhLuK+2gUcnZe8ZHlaaINnQLl0xRIGRfcGk2yl8xoQAfHrSsL3rYu6FCmBdkdbhc9EPlwyGHewaRsvwRMJtAlA==} dev: true + /fresh/0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: true + /fs-extra/10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} engines: {node: '>=12'} @@ -4482,6 +4641,11 @@ packages: side-channel: 1.0.4 dev: true + /ipaddr.js/1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: true + /is-arrayish/0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true @@ -5170,6 +5334,10 @@ packages: yargs-parser: 18.1.3 dev: true + /merge-descriptors/1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + dev: true + /merge-stream/2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true @@ -5179,6 +5347,11 @@ packages: engines: {node: '>= 8'} dev: true + /methods/1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + dev: true + /microbundle/0.15.1_yvstdq4ikeml4yz3a6bi3bgrvu: resolution: {integrity: sha512-aAF+nwFbkSIJGfrJk+HyzmJOq3KFaimH6OIFBU6J2DPjQeg1jXIYlIyEv81Gyisb9moUkudn+wj7zLNYMOv75Q==} hasBin: true @@ -5252,6 +5425,12 @@ packages: mime-db: 1.52.0 dev: true + /mime/1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: true + /mime/2.6.0: resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} engines: {node: '>=4.0.0'} @@ -5353,7 +5532,7 @@ packages: dev: true /ms/2.0.0: - resolution: {integrity: sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=} + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: true /ms/2.1.2: @@ -5659,6 +5838,10 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true + /path-to-regexp/0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + dev: true + /path-to-regexp/1.8.0: resolution: {integrity: sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==} dependencies: @@ -6172,6 +6355,14 @@ packages: engines: {node: '>=0.12'} dev: true + /proxy-addr/2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: true + /pseudomap/1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: true @@ -6540,6 +6731,27 @@ packages: lru-cache: 6.0.0 dev: true + /send/0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /serialize-javascript/4.0.0: resolution: {integrity: sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==} dependencies: @@ -6552,6 +6764,18 @@ packages: randombytes: 2.1.0 dev: true + /serve-static/1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: true + /set-blocking/2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 060d3f67b..ea653b60d 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,5 +3,7 @@ packages: - "packages/*" # all packages in subdirs of components/ - "docs/**" + # all packages in subdirs of components/ + - "benches/**" # exclude packages that are inside test directories - "!**/test/**"