-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #302: use a different approach for cross-chunk assignments
- Loading branch information
Showing
6 changed files
with
207 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ test-all: | |
make -j6 test-go vet-go verify-source-map end-to-end-tests js-api-tests test-wasm | ||
|
||
# This includes tests of some 3rd-party libraries, which can be very slow | ||
test-extra: test-all test-sucrase test-esprima test-rollup | ||
test-extra: test-all test-preact-splitting test-sucrase test-esprima test-rollup | ||
|
||
test-go: | ||
go test ./internal/... | ||
|
@@ -276,6 +276,38 @@ test-rollup: esbuild | demo/rollup | |
################################################################################ | ||
# This builds Sucrase using esbuild and then uses it to run Sucrase's test suite | ||
|
||
PREACT_SPLITTING += import { h } from 'preact'; | ||
PREACT_SPLITTING += import { USE as use } from 'preact/hooks'; | ||
PREACT_SPLITTING += import { renderToString } from 'preact-render-to-string'; | ||
PREACT_SPLITTING += let Component = () => (use(() => {}), h('div')); | ||
PREACT_SPLITTING += if (renderToString(h(Component)) !== '<div></div>') throw 'fail'; | ||
|
||
PREACT_HOOKS += useCallback | ||
PREACT_HOOKS += useContext | ||
PREACT_HOOKS += useDebugValue | ||
PREACT_HOOKS += useEffect | ||
PREACT_HOOKS += useErrorBoundary | ||
PREACT_HOOKS += useImperativeHandle | ||
PREACT_HOOKS += useLayoutEffect | ||
PREACT_HOOKS += useMemo | ||
PREACT_HOOKS += useReducer | ||
PREACT_HOOKS += useRef | ||
PREACT_HOOKS += useState | ||
|
||
demo/preact-splitting: | ||
mkdir -p demo/preact-splitting/src | ||
cd demo/preact-splitting && echo '{}' > package.json && npm i [email protected] [email protected] | ||
cd demo/preact-splitting && for h in $(PREACT_HOOKS); do echo "$(PREACT_SPLITTING)" | sed s/USE/$$h/ > src/$$h.js; done | ||
|
||
test-preact-splitting: esbuild | demo/preact-splitting | ||
cd demo/preact-splitting && rm -fr out && ../../esbuild --bundle --splitting --format=esm src/*.js --outdir=out --out-extension:.js=.mjs | ||
cd demo/preact-splitting && for h in $(PREACT_HOOKS); do set -e && node --experimental-modules out/$$h.mjs; done | ||
cd demo/preact-splitting && rm -fr out && ../../esbuild --bundle --splitting --format=esm src/*.js --outdir=out --out-extension:.js=.mjs --minify | ||
cd demo/preact-splitting && for h in $(PREACT_HOOKS); do set -e && node --experimental-modules out/$$h.mjs; done | ||
|
||
################################################################################ | ||
# This builds Sucrase using esbuild and then uses it to run Sucrase's test suite | ||
|
||
github/sucrase: | ||
mkdir -p github/sucrase | ||
cd github/sucrase && git init && git remote add origin https://github.com/alangpierce/sucrase.git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters