e2a63760aa
This PR is just a chore to prepare for future performance optimizations. Essentially I want to improve the performance of the `Menu`, `Listbox` and `Combobox` components but I want to do it in separate PRs such that reverting the improvements can be done if needed. This PR just sets up a `Machine` for state machines, and adds some helpers such as a `useSlice` to calculate parts of the state machine. Component using the `useSlice` will only re-render _if_ the slice changes. So apart from adding a library (`useSyncExternalStoreWithSelector`) and adding some setup code. Nothing in this PR changes the behavior of the components.
19 lines
413 B
Bash
Executable File
19 lines
413 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# Known variables
|
|
outdir="./dist"
|
|
name="headlessui"
|
|
input="./src/index.ts"
|
|
|
|
# Setup shared options for esbuild
|
|
sharedOptions=()
|
|
sharedOptions+=("--bundle")
|
|
sharedOptions+=("--platform=browser")
|
|
sharedOptions+=("--target=es2020")
|
|
|
|
|
|
# Generate actual builds
|
|
NODE_ENV=development npx esbuild $input --format=esm --outfile=$outdir/$name.esm.js --sourcemap ${sharedOptions[@]} $@ --watch
|
|
|