From 6df0fba6610bacced18d0607849c66ceed6aaa86 Mon Sep 17 00:00:00 2001 From: Daishi Kato Date: Tue, 21 May 2024 14:55:15 +0900 Subject: [PATCH] examples: migrate to vite (#211) * examples: migrate to vite * fix e2e --- README.md | 38 +++--- examples/01_counter/index.html | 9 ++ examples/01_counter/package.json | 19 ++- examples/01_counter/public/index.html | 8 -- examples/01_counter/src/index.tsx | 13 -- examples/01_counter/src/main.tsx | 10 ++ examples/01_counter/tsconfig.json | 14 +++ examples/02_person/index.html | 9 ++ examples/02_person/package.json | 19 ++- examples/02_person/public/index.html | 8 -- examples/02_person/src/index.tsx | 13 -- examples/02_person/src/main.tsx | 10 ++ examples/02_person/tsconfig.json | 14 +++ examples/03_usestate/index.html | 9 ++ examples/03_usestate/package.json | 19 ++- examples/03_usestate/public/index.html | 8 -- examples/03_usestate/src/index.tsx | 13 -- examples/03_usestate/src/main.tsx | 10 ++ examples/03_usestate/tsconfig.json | 14 +++ examples/04_selector/index.html | 9 ++ examples/04_selector/package.json | 19 ++- examples/04_selector/public/index.html | 8 -- examples/04_selector/src/index.tsx | 13 -- examples/04_selector/src/main.tsx | 10 ++ examples/04_selector/tsconfig.json | 14 +++ examples/05_container/index.html | 9 ++ examples/05_container/package.json | 19 ++- examples/05_container/public/index.html | 8 -- examples/05_container/src/index.tsx | 13 -- examples/05_container/src/main.tsx | 10 ++ examples/05_container/tsconfig.json | 14 +++ examples/06_customhook/index.html | 9 ++ examples/06_customhook/package.json | 19 ++- examples/06_customhook/public/index.html | 8 -- examples/06_customhook/src/index.tsx | 13 -- examples/06_customhook/src/main.tsx | 10 ++ examples/06_customhook/tsconfig.json | 14 +++ examples/07_todolist/index.html | 9 ++ examples/07_todolist/package.json | 20 ++- examples/07_todolist/public/index.html | 8 -- examples/07_todolist/src/index.tsx | 13 -- examples/07_todolist/src/main.tsx | 10 ++ examples/07_todolist/tsconfig.json | 14 +++ examples/08_comparison/index.html | 9 ++ examples/08_comparison/package.json | 19 ++- examples/08_comparison/public/index.html | 8 -- examples/08_comparison/src/index.tsx | 13 -- examples/08_comparison/src/main.tsx | 10 ++ examples/08_comparison/tsconfig.json | 14 +++ examples/09_reactmemo/index.html | 9 ++ examples/09_reactmemo/package.json | 19 ++- examples/09_reactmemo/public/index.html | 8 -- examples/09_reactmemo/src/index.tsx | 13 -- examples/09_reactmemo/src/main.tsx | 10 ++ examples/09_reactmemo/tsconfig.json | 14 +++ examples/10_untracked/index.html | 9 ++ examples/10_untracked/package.json | 19 ++- examples/10_untracked/public/index.html | 8 -- examples/10_untracked/src/index.tsx | 13 -- examples/10_untracked/src/main.tsx | 10 ++ examples/10_untracked/tsconfig.json | 14 +++ examples/11_form/index.html | 9 ++ examples/11_form/package.json | 19 ++- examples/11_form/public/index.html | 8 -- examples/11_form/src/index.tsx | 13 -- examples/11_form/src/main.tsx | 10 ++ examples/11_form/tsconfig.json | 14 +++ examples/12_async/index.html | 9 ++ examples/12_async/package.json | 17 ++- examples/12_async/public/index.html | 8 -- examples/12_async/src/app.tsx | 4 +- examples/12_async/src/index.tsx | 13 -- examples/12_async/src/main.tsx | 33 ++--- examples/12_async/src/root.tsx | 27 +++++ examples/12_async/tsconfig.json | 14 +++ examples/13_saga/index.html | 9 ++ examples/13_saga/package.json | 17 ++- examples/13_saga/public/index.html | 8 -- examples/13_saga/src/app.tsx | 4 +- examples/13_saga/src/index.tsx | 13 -- examples/13_saga/src/main.tsx | 33 ++--- examples/13_saga/src/root.tsx | 27 +++++ examples/13_saga/tsconfig.json | 14 +++ examples/14_dynamic/index.html | 9 ++ examples/14_dynamic/package.json | 19 ++- examples/14_dynamic/public/index.html | 8 -- examples/14_dynamic/src/index.tsx | 13 -- examples/14_dynamic/src/main.tsx | 10 ++ examples/14_dynamic/tsconfig.json | 14 +++ examples/15_reactmemoref/index.html | 9 ++ examples/15_reactmemoref/package.json | 19 ++- examples/15_reactmemoref/public/index.html | 8 -- examples/15_reactmemoref/src/index.tsx | 13 -- examples/15_reactmemoref/src/main.tsx | 10 ++ examples/15_reactmemoref/tsconfig.json | 14 +++ package.json | 1 + pnpm-lock.yaml | 3 + tests/e2e/01_counter.ts | 58 ++++----- tests/e2e/02_person.ts | 54 ++++----- tests/e2e/03_usestate.ts | 52 ++++---- tests/e2e/04_selector.ts | 38 +++--- tests/e2e/05_container.ts | 80 ++++++------ tests/e2e/06_customhook.ts | 32 ++--- tests/e2e/07_todolist.ts | 114 ++++++++++-------- tests/e2e/08_comparison.ts | 24 ++-- tests/e2e/09_reactmemo.ts | 24 ++-- tests/e2e/10_untracked.ts | 52 +++++--- tests/e2e/11_form.ts | 30 ++--- tests/e2e/12_async.ts | 16 ++- tests/e2e/13_saga.ts | 16 ++- tests/e2e/14_dynamic.ts | 44 ++++--- tests/e2e/15_reactmemoref.ts | 24 ++-- tests/e2e/__snapshots__/01_counter.ts.snap | 48 +++++--- tests/e2e/__snapshots__/02_person.ts.snap | 54 ++++++--- tests/e2e/__snapshots__/03_usestate.ts.snap | 45 ++++--- tests/e2e/__snapshots__/04_selector.ts.snap | 42 ++++--- tests/e2e/__snapshots__/05_container.ts.snap | 60 ++++++--- tests/e2e/__snapshots__/06_customhook.ts.snap | 24 ++-- tests/e2e/__snapshots__/07_todolist.ts.snap | 84 ++++++++----- tests/e2e/__snapshots__/08_comparison.ts.snap | 33 +++-- tests/e2e/__snapshots__/09_reactmemo.ts.snap | 18 ++- tests/e2e/__snapshots__/10_untracked.ts.snap | 33 +++-- tests/e2e/__snapshots__/11_form.ts.snap | 33 +++-- tests/e2e/__snapshots__/12_async.ts.snap | 15 ++- tests/e2e/__snapshots__/13_saga.ts.snap | 15 ++- tests/e2e/__snapshots__/14_dynamic.ts.snap | 36 ++++-- .../e2e/__snapshots__/15_reactmemoref.ts.snap | 18 ++- tsconfig.json | 1 - vite.config.ts | 39 ------ 129 files changed, 1430 insertions(+), 1068 deletions(-) create mode 100644 examples/01_counter/index.html delete mode 100644 examples/01_counter/public/index.html delete mode 100644 examples/01_counter/src/index.tsx create mode 100644 examples/01_counter/src/main.tsx create mode 100644 examples/01_counter/tsconfig.json create mode 100644 examples/02_person/index.html delete mode 100644 examples/02_person/public/index.html delete mode 100644 examples/02_person/src/index.tsx create mode 100644 examples/02_person/src/main.tsx create mode 100644 examples/02_person/tsconfig.json create mode 100644 examples/03_usestate/index.html delete mode 100644 examples/03_usestate/public/index.html delete mode 100644 examples/03_usestate/src/index.tsx create mode 100644 examples/03_usestate/src/main.tsx create mode 100644 examples/03_usestate/tsconfig.json create mode 100644 examples/04_selector/index.html delete mode 100644 examples/04_selector/public/index.html delete mode 100644 examples/04_selector/src/index.tsx create mode 100644 examples/04_selector/src/main.tsx create mode 100644 examples/04_selector/tsconfig.json create mode 100644 examples/05_container/index.html delete mode 100644 examples/05_container/public/index.html delete mode 100644 examples/05_container/src/index.tsx create mode 100644 examples/05_container/src/main.tsx create mode 100644 examples/05_container/tsconfig.json create mode 100644 examples/06_customhook/index.html delete mode 100644 examples/06_customhook/public/index.html delete mode 100644 examples/06_customhook/src/index.tsx create mode 100644 examples/06_customhook/src/main.tsx create mode 100644 examples/06_customhook/tsconfig.json create mode 100644 examples/07_todolist/index.html delete mode 100644 examples/07_todolist/public/index.html delete mode 100644 examples/07_todolist/src/index.tsx create mode 100644 examples/07_todolist/src/main.tsx create mode 100644 examples/07_todolist/tsconfig.json create mode 100644 examples/08_comparison/index.html delete mode 100644 examples/08_comparison/public/index.html delete mode 100644 examples/08_comparison/src/index.tsx create mode 100644 examples/08_comparison/src/main.tsx create mode 100644 examples/08_comparison/tsconfig.json create mode 100644 examples/09_reactmemo/index.html delete mode 100644 examples/09_reactmemo/public/index.html delete mode 100644 examples/09_reactmemo/src/index.tsx create mode 100644 examples/09_reactmemo/src/main.tsx create mode 100644 examples/09_reactmemo/tsconfig.json create mode 100644 examples/10_untracked/index.html delete mode 100644 examples/10_untracked/public/index.html delete mode 100644 examples/10_untracked/src/index.tsx create mode 100644 examples/10_untracked/src/main.tsx create mode 100644 examples/10_untracked/tsconfig.json create mode 100644 examples/11_form/index.html delete mode 100644 examples/11_form/public/index.html delete mode 100644 examples/11_form/src/index.tsx create mode 100644 examples/11_form/src/main.tsx create mode 100644 examples/11_form/tsconfig.json create mode 100644 examples/12_async/index.html delete mode 100644 examples/12_async/public/index.html delete mode 100644 examples/12_async/src/index.tsx create mode 100644 examples/12_async/src/root.tsx create mode 100644 examples/12_async/tsconfig.json create mode 100644 examples/13_saga/index.html delete mode 100644 examples/13_saga/public/index.html delete mode 100644 examples/13_saga/src/index.tsx create mode 100644 examples/13_saga/src/root.tsx create mode 100644 examples/13_saga/tsconfig.json create mode 100644 examples/14_dynamic/index.html delete mode 100644 examples/14_dynamic/public/index.html delete mode 100644 examples/14_dynamic/src/index.tsx create mode 100644 examples/14_dynamic/src/main.tsx create mode 100644 examples/14_dynamic/tsconfig.json create mode 100644 examples/15_reactmemoref/index.html delete mode 100644 examples/15_reactmemoref/public/index.html delete mode 100644 examples/15_reactmemoref/src/index.tsx create mode 100644 examples/15_reactmemoref/src/main.tsx create mode 100644 examples/15_reactmemoref/tsconfig.json diff --git a/README.md b/README.md index 986e6bdf..23b7877e 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,7 @@ that provide useSelector-like hooks. This package requires some peer dependencies, which you need to install by yourself. ```bash -yarn add react-tracked react scheduler react-dom -``` - -For React Native users: - -```bash -yarn add react-tracked react scheduler react-native +npm add react-tracked react scheduler ``` ## Usage @@ -231,25 +225,25 @@ The [examples](examples) folder contains working examples. You can run one of them with ```bash -PORT=8080 yarn run examples:01_minimal +PORT=8080 pnpm run examples:01_minimal ``` and open in your web browser. -You can also try them in codesandbox.io: -[01](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/01_minimal) -[02](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/02_typescript) -[03](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/03_usestate) -[04](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/04_selector) -[05](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/05_container) -[06](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/06_customhook) -[07](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/07_todolist) -[08](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/08_comparison) -[09](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/09_reactmemo) -[10](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/10_untracked) -[11](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/11_form) -[12](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/12_async) -[13](https://codesandbox.io/s/github/dai-shi/react-tracked/tree/main/examples/13_saga) +You can also try them directly: +[01](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/01_minimal) +[02](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/02_typescript) +[03](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/03_usestate) +[04](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/04_selector) +[05](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/05_container) +[06](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/06_customhook) +[07](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/07_todolist) +[08](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/08_comparison) +[09](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/09_reactmemo) +[10](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/10_untracked) +[11](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/11_form) +[12](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/12_async) +[13](https://stackblitz.com/github/dai-shi/react-tracked/tree/main/examples/13_saga) ## Benchmarks diff --git a/examples/01_counter/index.html b/examples/01_counter/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/01_counter/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/01_counter/package.json b/examples/01_counter/package.json index bba01aef..021bbef4 100644 --- a/examples/01_counter/package.json +++ b/examples/01_counter/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/01_counter/public/index.html b/examples/01_counter/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/01_counter/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/01_counter/src/index.tsx b/examples/01_counter/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/01_counter/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/01_counter/src/main.tsx b/examples/01_counter/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/01_counter/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/01_counter/tsconfig.json b/examples/01_counter/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/01_counter/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/02_person/index.html b/examples/02_person/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/02_person/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/02_person/package.json b/examples/02_person/package.json index bba01aef..021bbef4 100644 --- a/examples/02_person/package.json +++ b/examples/02_person/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/02_person/public/index.html b/examples/02_person/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/02_person/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/02_person/src/index.tsx b/examples/02_person/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/02_person/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/02_person/src/main.tsx b/examples/02_person/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/02_person/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/02_person/tsconfig.json b/examples/02_person/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/02_person/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/03_usestate/index.html b/examples/03_usestate/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/03_usestate/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/03_usestate/package.json b/examples/03_usestate/package.json index bba01aef..021bbef4 100644 --- a/examples/03_usestate/package.json +++ b/examples/03_usestate/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/03_usestate/public/index.html b/examples/03_usestate/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/03_usestate/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/03_usestate/src/index.tsx b/examples/03_usestate/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/03_usestate/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/03_usestate/src/main.tsx b/examples/03_usestate/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/03_usestate/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/03_usestate/tsconfig.json b/examples/03_usestate/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/03_usestate/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/04_selector/index.html b/examples/04_selector/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/04_selector/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/04_selector/package.json b/examples/04_selector/package.json index bba01aef..021bbef4 100644 --- a/examples/04_selector/package.json +++ b/examples/04_selector/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/04_selector/public/index.html b/examples/04_selector/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/04_selector/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/04_selector/src/index.tsx b/examples/04_selector/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/04_selector/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/04_selector/src/main.tsx b/examples/04_selector/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/04_selector/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/04_selector/tsconfig.json b/examples/04_selector/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/04_selector/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/05_container/index.html b/examples/05_container/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/05_container/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/05_container/package.json b/examples/05_container/package.json index bba01aef..021bbef4 100644 --- a/examples/05_container/package.json +++ b/examples/05_container/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/05_container/public/index.html b/examples/05_container/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/05_container/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/05_container/src/index.tsx b/examples/05_container/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/05_container/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/05_container/src/main.tsx b/examples/05_container/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/05_container/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/05_container/tsconfig.json b/examples/05_container/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/05_container/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/06_customhook/index.html b/examples/06_customhook/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/06_customhook/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/06_customhook/package.json b/examples/06_customhook/package.json index bba01aef..021bbef4 100644 --- a/examples/06_customhook/package.json +++ b/examples/06_customhook/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/06_customhook/public/index.html b/examples/06_customhook/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/06_customhook/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/06_customhook/src/index.tsx b/examples/06_customhook/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/06_customhook/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/06_customhook/src/main.tsx b/examples/06_customhook/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/06_customhook/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/06_customhook/tsconfig.json b/examples/06_customhook/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/06_customhook/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/07_todolist/index.html b/examples/07_todolist/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/07_todolist/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/07_todolist/package.json b/examples/07_todolist/package.json index 95a0efd0..021bbef4 100644 --- a/examples/07_todolist/package.json +++ b/examples/07_todolist/package.json @@ -2,21 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", - "immer": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/07_todolist/public/index.html b/examples/07_todolist/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/07_todolist/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/07_todolist/src/index.tsx b/examples/07_todolist/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/07_todolist/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/07_todolist/src/main.tsx b/examples/07_todolist/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/07_todolist/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/07_todolist/tsconfig.json b/examples/07_todolist/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/07_todolist/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/08_comparison/index.html b/examples/08_comparison/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/08_comparison/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/08_comparison/package.json b/examples/08_comparison/package.json index bba01aef..021bbef4 100644 --- a/examples/08_comparison/package.json +++ b/examples/08_comparison/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/08_comparison/public/index.html b/examples/08_comparison/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/08_comparison/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/08_comparison/src/index.tsx b/examples/08_comparison/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/08_comparison/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/08_comparison/src/main.tsx b/examples/08_comparison/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/08_comparison/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/08_comparison/tsconfig.json b/examples/08_comparison/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/08_comparison/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/09_reactmemo/index.html b/examples/09_reactmemo/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/09_reactmemo/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/09_reactmemo/package.json b/examples/09_reactmemo/package.json index bba01aef..021bbef4 100644 --- a/examples/09_reactmemo/package.json +++ b/examples/09_reactmemo/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/09_reactmemo/public/index.html b/examples/09_reactmemo/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/09_reactmemo/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/09_reactmemo/src/index.tsx b/examples/09_reactmemo/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/09_reactmemo/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/09_reactmemo/src/main.tsx b/examples/09_reactmemo/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/09_reactmemo/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/09_reactmemo/tsconfig.json b/examples/09_reactmemo/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/09_reactmemo/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/10_untracked/index.html b/examples/10_untracked/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/10_untracked/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/10_untracked/package.json b/examples/10_untracked/package.json index bba01aef..021bbef4 100644 --- a/examples/10_untracked/package.json +++ b/examples/10_untracked/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/10_untracked/public/index.html b/examples/10_untracked/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/10_untracked/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/10_untracked/src/index.tsx b/examples/10_untracked/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/10_untracked/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/10_untracked/src/main.tsx b/examples/10_untracked/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/10_untracked/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/10_untracked/tsconfig.json b/examples/10_untracked/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/10_untracked/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/11_form/index.html b/examples/11_form/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/11_form/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/11_form/package.json b/examples/11_form/package.json index bba01aef..021bbef4 100644 --- a/examples/11_form/package.json +++ b/examples/11_form/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/11_form/public/index.html b/examples/11_form/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/11_form/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/11_form/src/index.tsx b/examples/11_form/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/11_form/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/11_form/src/main.tsx b/examples/11_form/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/11_form/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/11_form/tsconfig.json b/examples/11_form/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/11_form/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/12_async/index.html b/examples/12_async/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/12_async/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/12_async/package.json b/examples/12_async/package.json index aaa7635b..a4c6b09a 100644 --- a/examples/12_async/package.json +++ b/examples/12_async/package.json @@ -2,21 +2,20 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", "react-tracked": "latest", - "typescript": "latest", "use-reducer-async": "latest" }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" + }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/12_async/public/index.html b/examples/12_async/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/12_async/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/12_async/src/app.tsx b/examples/12_async/src/app.tsx index 305afd67..40e044b5 100644 --- a/examples/12_async/src/app.tsx +++ b/examples/12_async/src/app.tsx @@ -1,9 +1,9 @@ import { Provider } from './store'; -import Main from './main'; +import Root from './root'; const App = () => ( -
+ ); diff --git a/examples/12_async/src/index.tsx b/examples/12_async/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/12_async/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/12_async/src/main.tsx b/examples/12_async/src/main.tsx index 7f5eb621..1a72c017 100644 --- a/examples/12_async/src/main.tsx +++ b/examples/12_async/src/main.tsx @@ -1,27 +1,10 @@ -import { useState } from 'react'; +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; -import { useTrackedState } from './store'; -import Person from './person'; -import Counter from './counter'; +import App from './app'; -const Main = () => { - const state = useTrackedState(); - const [id, setId] = useState('3'); - return ( -
-

Person

-
- User ID: - setId(e.target.value)} /> -
- {state.loadingState !== 'idle' ? ( - {state.loadingState}... - ) : ( - - )} - -
- ); -}; - -export default Main; +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/12_async/src/root.tsx b/examples/12_async/src/root.tsx new file mode 100644 index 00000000..608064ab --- /dev/null +++ b/examples/12_async/src/root.tsx @@ -0,0 +1,27 @@ +import { useState } from 'react'; + +import { useTrackedState } from './store'; +import Person from './person'; +import Counter from './counter'; + +const Root = () => { + const state = useTrackedState(); + const [id, setId] = useState('3'); + return ( +
+

Person

+
+ User ID: + setId(e.target.value)} /> +
+ {state.loadingState !== 'idle' ? ( + {state.loadingState}... + ) : ( + + )} + +
+ ); +}; + +export default Root; diff --git a/examples/12_async/tsconfig.json b/examples/12_async/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/12_async/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/13_saga/index.html b/examples/13_saga/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/13_saga/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/13_saga/package.json b/examples/13_saga/package.json index 05e52f39..7aa1881e 100644 --- a/examples/13_saga/package.json +++ b/examples/13_saga/package.json @@ -2,22 +2,21 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", "react-tracked": "latest", "redux-saga": "latest", - "typescript": "latest", "use-saga-reducer": "latest" }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" + }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/13_saga/public/index.html b/examples/13_saga/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/13_saga/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/13_saga/src/app.tsx b/examples/13_saga/src/app.tsx index 305afd67..40e044b5 100644 --- a/examples/13_saga/src/app.tsx +++ b/examples/13_saga/src/app.tsx @@ -1,9 +1,9 @@ import { Provider } from './store'; -import Main from './main'; +import Root from './root'; const App = () => ( -
+ ); diff --git a/examples/13_saga/src/index.tsx b/examples/13_saga/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/13_saga/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/13_saga/src/main.tsx b/examples/13_saga/src/main.tsx index 7f5eb621..1a72c017 100644 --- a/examples/13_saga/src/main.tsx +++ b/examples/13_saga/src/main.tsx @@ -1,27 +1,10 @@ -import { useState } from 'react'; +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; -import { useTrackedState } from './store'; -import Person from './person'; -import Counter from './counter'; +import App from './app'; -const Main = () => { - const state = useTrackedState(); - const [id, setId] = useState('3'); - return ( -
-

Person

-
- User ID: - setId(e.target.value)} /> -
- {state.loadingState !== 'idle' ? ( - {state.loadingState}... - ) : ( - - )} - -
- ); -}; - -export default Main; +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/13_saga/src/root.tsx b/examples/13_saga/src/root.tsx new file mode 100644 index 00000000..608064ab --- /dev/null +++ b/examples/13_saga/src/root.tsx @@ -0,0 +1,27 @@ +import { useState } from 'react'; + +import { useTrackedState } from './store'; +import Person from './person'; +import Counter from './counter'; + +const Root = () => { + const state = useTrackedState(); + const [id, setId] = useState('3'); + return ( +
+

Person

+
+ User ID: + setId(e.target.value)} /> +
+ {state.loadingState !== 'idle' ? ( + {state.loadingState}... + ) : ( + + )} + +
+ ); +}; + +export default Root; diff --git a/examples/13_saga/tsconfig.json b/examples/13_saga/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/13_saga/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/14_dynamic/index.html b/examples/14_dynamic/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/14_dynamic/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/14_dynamic/package.json b/examples/14_dynamic/package.json index bba01aef..021bbef4 100644 --- a/examples/14_dynamic/package.json +++ b/examples/14_dynamic/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/14_dynamic/public/index.html b/examples/14_dynamic/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/14_dynamic/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/14_dynamic/src/index.tsx b/examples/14_dynamic/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/14_dynamic/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/14_dynamic/src/main.tsx b/examples/14_dynamic/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/14_dynamic/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/14_dynamic/tsconfig.json b/examples/14_dynamic/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/14_dynamic/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/examples/15_reactmemoref/index.html b/examples/15_reactmemoref/index.html new file mode 100644 index 00000000..ec005a3c --- /dev/null +++ b/examples/15_reactmemoref/index.html @@ -0,0 +1,9 @@ + + + example + + +
+ + + diff --git a/examples/15_reactmemoref/package.json b/examples/15_reactmemoref/package.json index bba01aef..021bbef4 100644 --- a/examples/15_reactmemoref/package.json +++ b/examples/15_reactmemoref/package.json @@ -2,20 +2,19 @@ "name": "example", "version": "0.0.0", "private": true, - "type": "commonjs", + "type": "module", "dependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", "react": "latest", "react-dom": "latest", - "react-scripts": "latest", - "react-tracked": "latest", - "typescript": "latest" + "react-tracked": "latest" + }, + "devDependencies": { + "@types/react": "latest", + "@types/react-dom": "latest", + "typescript": "latest", + "vite": "latest" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject" + "dev": "vite" } } diff --git a/examples/15_reactmemoref/public/index.html b/examples/15_reactmemoref/public/index.html deleted file mode 100644 index ad4c7826..00000000 --- a/examples/15_reactmemoref/public/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - example - - -
- - diff --git a/examples/15_reactmemoref/src/index.tsx b/examples/15_reactmemoref/src/index.tsx deleted file mode 100644 index 10774d1c..00000000 --- a/examples/15_reactmemoref/src/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { StrictMode } from 'react'; -import { createRoot } from 'react-dom/client'; - -import App from './app'; - -const ele = document.getElementById('app'); -if (ele) { - createRoot(ele).render( - - - , - ); -} diff --git a/examples/15_reactmemoref/src/main.tsx b/examples/15_reactmemoref/src/main.tsx new file mode 100644 index 00000000..1a72c017 --- /dev/null +++ b/examples/15_reactmemoref/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; + +import App from './app'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/examples/15_reactmemoref/tsconfig.json b/examples/15_reactmemoref/tsconfig.json new file mode 100644 index 00000000..f9e0a7e2 --- /dev/null +++ b/examples/15_reactmemoref/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "target": "es2018", + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "bundler", + "skipLibCheck": true, + "allowJs": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "jsx": "react-jsx" + } +} diff --git a/package.json b/package.json index 2341b910..8aefa2d0 100644 --- a/package.json +++ b/package.json @@ -111,6 +111,7 @@ "puppeteer": "^22.8.0", "react": "^18.3.1", "react-dom": "^18.3.1", + "react-tracked": "link:.", "redux-saga": "^1.3.0", "start-server-and-test": "^2.0.3", "ts-expect": "^1.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e078f552..e47a5070 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -82,6 +82,9 @@ devDependencies: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) + react-tracked: + specifier: link:. + version: 'link:' redux-saga: specifier: ^1.3.0 version: 1.3.0 diff --git a/tests/e2e/01_counter.ts b/tests/e2e/01_counter.ts index e00abc94..a0ec5a85 100644 --- a/tests/e2e/01_counter.ts +++ b/tests/e2e/01_counter.ts @@ -11,142 +11,142 @@ describe('01_minimal', () => { await page.goto(`http://localhost:${port}/`); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(5) > div > input'); - await page.click('body > #app > div:nth-child(5) > div > input'); + await page.waitForSelector('body > #root > div:nth-child(5) > div > input'); + await page.click('body > #root > div:nth-child(5) > div > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(5) > div > input', '1'); + await page.type('body > #root > div:nth-child(5) > div > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(5) > div > input', '2'); + await page.type('body > #root > div:nth-child(5) > div > input', '2'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(5) > div > input', '3'); + await page.type('body > #root > div:nth-child(5) > div > input', '3'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/02_person.ts b/tests/e2e/02_person.ts index cb193406..6576b4ea 100644 --- a/tests/e2e/02_person.ts +++ b/tests/e2e/02_person.ts @@ -11,97 +11,97 @@ describe('02_typescript', () => { await page.goto(`http://localhost:${port}/`); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - '#app > div:nth-child(5) > div > div > button:nth-child(2)', + '#root > div:nth-child(5) > div > div > button:nth-child(2)', ); await page.click( - '#app > div:nth-child(5) > div > div > button:nth-child(2)', + '#root > div:nth-child(5) > div > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - '#app > div:nth-child(5) > div > div > button:nth-child(2)', + '#root > div:nth-child(5) > div > div > button:nth-child(2)', ); await page.click( - '#app > div:nth-child(5) > div > div > button:nth-child(2)', + '#root > div:nth-child(5) > div > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - '#app > div:nth-child(5) > div > div > button:nth-child(3)', + '#root > div:nth-child(5) > div > div > button:nth-child(3)', ); await page.click( - '#app > div:nth-child(5) > div > div > button:nth-child(3)', + '#root > div:nth-child(5) > div > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - '#app > div:nth-child(5) > div > div > button:nth-child(3)', + '#root > div:nth-child(5) > div > div > button:nth-child(3)', ); await page.click( - '#app > div:nth-child(5) > div > div > button:nth-child(3)', + '#root > div:nth-child(5) > div > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', ); await page.click( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'a', ); expect( @@ -109,7 +109,7 @@ describe('02_typescript', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'b', ); expect( @@ -117,7 +117,7 @@ describe('02_typescript', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'c', ); expect( @@ -125,7 +125,7 @@ describe('02_typescript', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', 'd', ); expect( @@ -133,7 +133,7 @@ describe('02_typescript', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', 'e', ); expect( @@ -141,7 +141,7 @@ describe('02_typescript', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', 'f', ); expect( @@ -149,7 +149,7 @@ describe('02_typescript', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(4) > input', + 'body > #root > div:nth-child(5) > div:nth-child(4) > input', '1', ); expect( @@ -157,7 +157,7 @@ describe('02_typescript', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(4) > input', + 'body > #root > div:nth-child(5) > div:nth-child(4) > input', '2', ); expect( @@ -165,7 +165,7 @@ describe('02_typescript', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(4) > input', + 'body > #root > div:nth-child(5) > div:nth-child(4) > input', '3', ); expect( diff --git a/tests/e2e/03_usestate.ts b/tests/e2e/03_usestate.ts index 45f18f86..7f951135 100644 --- a/tests/e2e/03_usestate.ts +++ b/tests/e2e/03_usestate.ts @@ -10,48 +10,58 @@ describe('03_usestate', () => { const page = await browser.newPage(); await page.goto(`http://localhost:${port}/`); - await page.waitForSelector('body > #app > div:nth-child(2) > div > button'); - await page.click('body > #app > div:nth-child(2) > div > button'); + await page.waitForSelector( + 'body > #root > div:nth-child(2) > div > button', + ); + await page.click('body > #root > div:nth-child(2) > div > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(2) > div > button'); - await page.click('body > #app > div:nth-child(2) > div > button'); + await page.waitForSelector( + 'body > #root > div:nth-child(2) > div > button', + ); + await page.click('body > #root > div:nth-child(2) > div > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(3) > div > button'); - await page.click('body > #app > div:nth-child(3) > div > button'); + await page.waitForSelector( + 'body > #root > div:nth-child(3) > div > button', + ); + await page.click('body > #root > div:nth-child(3) > div > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(3) > div > button'); - await page.click('body > #app > div:nth-child(3) > div > button'); + await page.waitForSelector( + 'body > #root > div:nth-child(3) > div > button', + ); + await page.click('body > #root > div:nth-child(3) > div > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(3) > div > button'); - await page.click('body > #app > div:nth-child(3) > div > button'); + await page.waitForSelector( + 'body > #root > div:nth-child(3) > div > button', + ); + await page.click('body > #root > div:nth-child(3) > div > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', ); await page.click( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', 'a', ); expect( @@ -59,7 +69,7 @@ describe('03_usestate', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', 'a', ); expect( @@ -67,7 +77,7 @@ describe('03_usestate', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', 'a', ); expect( @@ -75,7 +85,7 @@ describe('03_usestate', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'b', ); expect( @@ -83,7 +93,7 @@ describe('03_usestate', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'b', ); expect( @@ -91,7 +101,7 @@ describe('03_usestate', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'b', ); expect( @@ -99,7 +109,7 @@ describe('03_usestate', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', '1', ); expect( @@ -107,7 +117,7 @@ describe('03_usestate', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', '1', ); expect( @@ -115,7 +125,7 @@ describe('03_usestate', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', '1', ); expect( diff --git a/tests/e2e/04_selector.ts b/tests/e2e/04_selector.ts index f9f9a940..3f7a27f0 100644 --- a/tests/e2e/04_selector.ts +++ b/tests/e2e/04_selector.ts @@ -11,57 +11,57 @@ describe('04_selector', () => { await page.goto(`http://localhost:${port}/`); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', ); await page.click( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', 'a', ); expect( @@ -69,7 +69,7 @@ describe('04_selector', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', 'a', ); expect( @@ -77,7 +77,7 @@ describe('04_selector', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', 'a', ); expect( @@ -85,7 +85,7 @@ describe('04_selector', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'b', ); expect( @@ -93,7 +93,7 @@ describe('04_selector', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'b', ); expect( @@ -101,7 +101,7 @@ describe('04_selector', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(2) > input', + 'body > #root > div:nth-child(5) > div:nth-child(2) > input', 'b', ); expect( @@ -109,7 +109,7 @@ describe('04_selector', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', '1', ); expect( @@ -117,7 +117,7 @@ describe('04_selector', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', '1', ); expect( @@ -125,7 +125,7 @@ describe('04_selector', () => { ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(3) > input', + 'body > #root > div:nth-child(5) > div:nth-child(3) > input', '1', ); expect( diff --git a/tests/e2e/05_container.ts b/tests/e2e/05_container.ts index d944b06b..ffb7909c 100644 --- a/tests/e2e/05_container.ts +++ b/tests/e2e/05_container.ts @@ -11,200 +11,200 @@ describe('05_container', () => { await page.goto(`http://localhost:${port}/`); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(2)', + 'body > #root > div:nth-child(3) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(3) > div > button:nth-child(3)', + 'body > #root > div:nth-child(3) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(5) > div > button:nth-child(2)', + 'body > #root > div:nth-child(5) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(5) > div > button:nth-child(2)', + 'body > #root > div:nth-child(5) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(5) > div > button:nth-child(3)', + 'body > #root > div:nth-child(5) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(5) > div > button:nth-child(3)', + 'body > #root > div:nth-child(5) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(5) > div > button:nth-child(3)', + 'body > #root > div:nth-child(5) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(5) > div > button:nth-child(3)', + 'body > #root > div:nth-child(5) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(6) > div > button:nth-child(2)', + 'body > #root > div:nth-child(6) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(6) > div > button:nth-child(2)', + 'body > #root > div:nth-child(6) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(6) > div > button:nth-child(2)', + 'body > #root > div:nth-child(6) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(6) > div > button:nth-child(2)', + 'body > #root > div:nth-child(6) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(6) > div > button:nth-child(2)', + 'body > #root > div:nth-child(6) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(6) > div > button:nth-child(2)', + 'body > #root > div:nth-child(6) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(6) > div > button:nth-child(3)', + 'body > #root > div:nth-child(6) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(6) > div > button:nth-child(3)', + 'body > #root > div:nth-child(6) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(6) > div > button:nth-child(3)', + 'body > #root > div:nth-child(6) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(6) > div > button:nth-child(3)', + 'body > #root > div:nth-child(6) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(6) > div > button:nth-child(3)', + 'body > #root > div:nth-child(6) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(6) > div > button:nth-child(3)', + 'body > #root > div:nth-child(6) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(6) > div > button:nth-child(3)', + 'body > #root > div:nth-child(6) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(6) > div > button:nth-child(3)', + 'body > #root > div:nth-child(6) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), diff --git a/tests/e2e/06_customhook.ts b/tests/e2e/06_customhook.ts index d96d0ea7..02e704c8 100644 --- a/tests/e2e/06_customhook.ts +++ b/tests/e2e/06_customhook.ts @@ -11,65 +11,65 @@ describe('06_customhook', () => { await page.goto(`http://localhost:${port}/`); await page.waitForSelector( - 'body > #app > div:nth-child(1) > button:nth-child(2)', + 'body > #root > div:nth-child(1) > button:nth-child(2)', ); - await page.click('body > #app > div:nth-child(1) > button:nth-child(2)'); + await page.click('body > #root > div:nth-child(1) > button:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(1) > button:nth-child(2)', + 'body > #root > div:nth-child(1) > button:nth-child(2)', ); - await page.click('body > #app > div:nth-child(1) > button:nth-child(2)'); + await page.click('body > #root > div:nth-child(1) > button:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(1) > button:nth-child(3)', + 'body > #root > div:nth-child(1) > button:nth-child(3)', ); - await page.click('body > #app > div:nth-child(1) > button:nth-child(3)'); + await page.click('body > #root > div:nth-child(1) > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(1) > button:nth-child(3)', + 'body > #root > div:nth-child(1) > button:nth-child(3)', ); - await page.click('body > #app > div:nth-child(1) > button:nth-child(3)'); + await page.click('body > #root > div:nth-child(1) > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > button:nth-child(2)', + 'body > #root > div:nth-child(2) > button:nth-child(2)', ); - await page.click('body > #app > div:nth-child(2) > button:nth-child(2)'); + await page.click('body > #root > div:nth-child(2) > button:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > button:nth-child(2)', + 'body > #root > div:nth-child(2) > button:nth-child(2)', ); - await page.click('body > #app > div:nth-child(2) > button:nth-child(2)'); + await page.click('body > #root > div:nth-child(2) > button:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > button:nth-child(3)', + 'body > #root > div:nth-child(2) > button:nth-child(3)', ); - await page.click('body > #app > div:nth-child(2) > button:nth-child(3)'); + await page.click('body > #root > div:nth-child(2) > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > button:nth-child(3)', + 'body > #root > div:nth-child(2) > button:nth-child(3)', ); - await page.click('body > #app > div:nth-child(2) > button:nth-child(3)'); + await page.click('body > #root > div:nth-child(2) > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/07_todolist.ts b/tests/e2e/07_todolist.ts index 21b2adcb..e6712b9e 100644 --- a/tests/e2e/07_todolist.ts +++ b/tests/e2e/07_todolist.ts @@ -10,161 +10,181 @@ describe('07_todolist', () => { const page = await browser.newPage(); await page.goto(`http://localhost:${port}/`); - await page.waitForSelector('#app > div > div > form > input'); - await page.click('#app > div > div > form > input'); + await page.waitForSelector('#root > div > div > form > input'); + await page.click('#root > div > div > form > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'a'); + await page.type('#root > div > div > form > input', 'a'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'a'); + await page.type('#root > div > div > form > input', 'a'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'a'); + await page.type('#root > div > div > form > input', 'a'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('#app > div > div > form > button'); - await page.click('#app > div > div > form > button'); + await page.waitForSelector('#root > div > div > form > button'); + await page.click('#root > div > div > form > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('#app > div > div > form > input'); - await page.click('#app > div > div > form > input'); + await page.waitForSelector('#root > div > div > form > input'); + await page.click('#root > div > div > form > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'b'); + await page.type('#root > div > div > form > input', 'b'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'b'); + await page.type('#root > div > div > form > input', 'b'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'b'); + await page.type('#root > div > div > form > input', 'b'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('#app > div > div > form > button'); - await page.click('#app > div > div > form > button'); + await page.waitForSelector('#root > div > div > form > button'); + await page.click('#root > div > div > form > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('#app > div > div > form > input'); - await page.click('#app > div > div > form > input'); + await page.waitForSelector('#root > div > div > form > input'); + await page.click('#root > div > div > form > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'c'); + await page.type('#root > div > div > form > input', 'c'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'c'); + await page.type('#root > div > div > form > input', 'c'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > div > div > form > input', 'c'); + await page.type('#root > div > div > form > input', 'c'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('#app > div > div > form > button'); - await page.click('#app > div > div > form > button'); + await page.waitForSelector('#root > div > div > form > button'); + await page.click('#root > div > div > form > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(3)'); - await page.click('body > #app > div > div > button:nth-child(3)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(3)', + ); + await page.click('body > #root > div > div > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(4)'); - await page.click('body > #app > div > div > button:nth-child(4)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(4)', + ); + await page.click('body > #root > div > div > button:nth-child(4)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(2)'); - await page.click('body > #app > div > div > button:nth-child(2)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(2)', + ); + await page.click('body > #root > div > div > button:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > ul > li:nth-child(2)'); - await page.click('body > #app > div > ul > li:nth-child(2)'); + await page.waitForSelector('body > #root > div > ul > li:nth-child(2)'); + await page.click('body > #root > div > ul > li:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(3)'); - await page.click('body > #app > div > div > button:nth-child(3)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(3)', + ); + await page.click('body > #root > div > div > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(4)'); - await page.click('body > #app > div > div > button:nth-child(4)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(4)', + ); + await page.click('body > #root > div > div > button:nth-child(4)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(2)'); - await page.click('body > #app > div > div > button:nth-child(2)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(2)', + ); + await page.click('body > #root > div > div > button:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > ul > li:nth-child(3)'); - await page.click('body > #app > div > ul > li:nth-child(3)'); + await page.waitForSelector('body > #root > div > ul > li:nth-child(3)'); + await page.click('body > #root > div > ul > li:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(3)'); - await page.click('body > #app > div > div > button:nth-child(3)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(3)', + ); + await page.click('body > #root > div > div > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(4)'); - await page.click('body > #app > div > div > button:nth-child(4)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(4)', + ); + await page.click('body > #root > div > div > button:nth-child(4)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > ul > li:nth-child(1)'); - await page.click('body > #app > div > ul > li:nth-child(1)'); + await page.waitForSelector('body > #root > div > ul > li:nth-child(1)'); + await page.click('body > #root > div > ul > li:nth-child(1)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(2)'); - await page.click('body > #app > div > div > button:nth-child(2)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(2)', + ); + await page.click('body > #root > div > div > button:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(3)'); - await page.click('body > #app > div > div > button:nth-child(3)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(3)', + ); + await page.click('body > #root > div > div > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/08_comparison.ts b/tests/e2e/08_comparison.ts index 6614b690..c4d81cce 100644 --- a/tests/e2e/08_comparison.ts +++ b/tests/e2e/08_comparison.ts @@ -10,58 +10,58 @@ describe('08_comparison', () => { const page = await browser.newPage(); await page.goto(`http://localhost:${port}/`); - await page.waitForSelector('body > #app > div:nth-child(2) > input'); - await page.click('body > #app > div:nth-child(2) > input'); + await page.waitForSelector('body > #root > div:nth-child(2) > input'); + await page.click('body > #root > div:nth-child(2) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(2) > input', '1'); + await page.type('body > #root > div:nth-child(2) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(3) > input', '1'); + await page.type('body > #root > div:nth-child(3) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(5) > input', '1'); + await page.type('body > #root > div:nth-child(5) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(6) > input', '1'); + await page.type('body > #root > div:nth-child(6) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(8) > input', '1'); + await page.type('body > #root > div:nth-child(8) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(9) > input', '1'); + await page.type('body > #root > div:nth-child(9) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(11) > input', '1'); + await page.type('body > #root > div:nth-child(11) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(12) > input', '1'); + await page.type('body > #root > div:nth-child(12) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(14) > input', '1'); + await page.type('body > #root > div:nth-child(14) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(15) > input', '1'); + await page.type('body > #root > div:nth-child(15) > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/09_reactmemo.ts b/tests/e2e/09_reactmemo.ts index ab26d5ed..f6a43d05 100644 --- a/tests/e2e/09_reactmemo.ts +++ b/tests/e2e/09_reactmemo.ts @@ -10,38 +10,38 @@ describe('09_reactmemo', () => { const page = await browser.newPage(); await page.goto(`http://localhost:${port}/`); - await page.waitForSelector('body > #app > ul > li:nth-child(1) > input'); - await page.click('body > #app > ul > li:nth-child(1) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(1) > input'); + await page.click('body > #root > ul > li:nth-child(1) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(2) > input'); - await page.click('body > #app > ul > li:nth-child(2) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(2) > input'); + await page.click('body > #root > ul > li:nth-child(2) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(3) > input'); - await page.click('body > #app > ul > li:nth-child(3) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(3) > input'); + await page.click('body > #root > ul > li:nth-child(3) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(1) > input'); - await page.click('body > #app > ul > li:nth-child(1) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(1) > input'); + await page.click('body > #root > ul > li:nth-child(1) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(2) > input'); - await page.click('body > #app > ul > li:nth-child(2) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(2) > input'); + await page.click('body > #root > ul > li:nth-child(2) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(3) > input'); - await page.click('body > #app > ul > li:nth-child(3) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(3) > input'); + await page.click('body > #root > ul > li:nth-child(3) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/10_untracked.ts b/tests/e2e/10_untracked.ts index 982f5a0c..a697e21e 100644 --- a/tests/e2e/10_untracked.ts +++ b/tests/e2e/10_untracked.ts @@ -11,15 +11,17 @@ describe('10_untracked', () => { await page.goto(`http://localhost:${port}/`); await page.waitForSelector( - 'body > #app > ul > li:nth-child(2) > input:nth-child(2)', + 'body > #root > ul > li:nth-child(2) > input:nth-child(2)', + ); + await page.click( + 'body > #root > ul > li:nth-child(2) > input:nth-child(2)', ); - await page.click('body > #app > ul > li:nth-child(2) > input:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.type( - 'body > #app > ul > li:nth-child(2) > input:nth-child(2)', + 'body > #root > ul > li:nth-child(2) > input:nth-child(2)', '2', ); expect( @@ -27,15 +29,17 @@ describe('10_untracked', () => { ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > ul > li:nth-child(3) > input:nth-child(2)', + 'body > #root > ul > li:nth-child(3) > input:nth-child(2)', + ); + await page.click( + 'body > #root > ul > li:nth-child(3) > input:nth-child(2)', ); - await page.click('body > #app > ul > li:nth-child(3) > input:nth-child(2)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.type( - 'body > #app > ul > li:nth-child(3) > input:nth-child(2)', + 'body > #root > ul > li:nth-child(3) > input:nth-child(2)', '3', ); expect( @@ -43,62 +47,70 @@ describe('10_untracked', () => { ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > ul > li:nth-child(2) > input:nth-child(1)', + 'body > #root > ul > li:nth-child(2) > input:nth-child(1)', + ); + await page.click( + 'body > #root > ul > li:nth-child(2) > input:nth-child(1)', ); - await page.click('body > #app > ul > li:nth-child(2) > input:nth-child(1)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > ul > li:nth-child(3) > input:nth-child(1)', + 'body > #root > ul > li:nth-child(3) > input:nth-child(1)', + ); + await page.click( + 'body > #root > ul > li:nth-child(3) > input:nth-child(1)', ); - await page.click('body > #app > ul > li:nth-child(3) > input:nth-child(1)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > ul > li:nth-child(1) > input:nth-child(1)', + 'body > #root > ul > li:nth-child(1) > input:nth-child(1)', + ); + await page.click( + 'body > #root > ul > li:nth-child(1) > input:nth-child(1)', ); - await page.click('body > #app > ul > li:nth-child(1) > input:nth-child(1)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > ul > li:nth-child(2) > button:nth-child(4)', + 'body > #root > ul > li:nth-child(2) > button:nth-child(4)', ); await page.click( - 'body > #app > ul > li:nth-child(2) > button:nth-child(4)', + 'body > #root > ul > li:nth-child(2) > button:nth-child(4)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > ul > li:nth-child(3) > button:nth-child(3)', + 'body > #root > ul > li:nth-child(3) > button:nth-child(3)', ); await page.click( - 'body > #app > ul > li:nth-child(3) > button:nth-child(3)', + 'body > #root > ul > li:nth-child(3) > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > ul > li:nth-child(3) > input:nth-child(1)', + 'body > #root > ul > li:nth-child(3) > input:nth-child(1)', + ); + await page.click( + 'body > #root > ul > li:nth-child(3) > input:nth-child(1)', ); - await page.click('body > #app > ul > li:nth-child(3) > input:nth-child(1)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > ul > li:nth-child(2) > button:nth-child(3)', + 'body > #root > ul > li:nth-child(2) > button:nth-child(3)', ); await page.click( - 'body > #app > ul > li:nth-child(2) > button:nth-child(3)', + 'body > #root > ul > li:nth-child(2) > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), diff --git a/tests/e2e/11_form.ts b/tests/e2e/11_form.ts index 134e0de6..54e211e8 100644 --- a/tests/e2e/11_form.ts +++ b/tests/e2e/11_form.ts @@ -10,61 +10,61 @@ describe('11_form', () => { const page = await browser.newPage(); await page.goto(`http://localhost:${port}/`); - await page.waitForSelector('#app > form > div:nth-child(3) > div > input'); - await page.click('#app > form > div:nth-child(3) > div > input'); + await page.waitForSelector('#root > form > div:nth-child(3) > div > input'); + await page.click('#root > form > div:nth-child(3) > div > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > form > div:nth-child(3) > div > input', '1'); + await page.type('#root > form > div:nth-child(3) > div > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > form > div:nth-child(3) > div > input', '1'); + await page.type('#root > form > div:nth-child(3) > div > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > form > div:nth-child(3) > div > input', '1'); + await page.type('#root > form > div:nth-child(3) > div > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > form > div:nth-child(5) > div > input', '2'); + await page.type('#root > form > div:nth-child(5) > div > input', '2'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > form > div:nth-child(5) > div > input', '2'); + await page.type('#root > form > div:nth-child(5) > div > input', '2'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('#app > form > div:nth-child(5) > div > input', '2'); + await page.type('#root > form > div:nth-child(5) > div > input', '2'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('#app > form > div > div > select'); - await page.click('#app > form > div > div > select'); + await page.waitForSelector('#root > form > div > div > select'); + await page.click('#root > form > div > div > select'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.select('#app > form > div > div > select', 'male'); + await page.select('#root > form > div > div > select', 'male'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('#app > form > div:nth-child(9) > div > input'); - await page.click('#app > form > div:nth-child(9) > div > input'); + await page.waitForSelector('#root > form > div:nth-child(9) > div > input'); + await page.click('#root > form > div:nth-child(9) > div > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > form > button'); - await page.click('body > #app > form > button'); + await page.waitForSelector('body > #root > form > button'); + await page.click('body > #root > form > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/12_async.ts b/tests/e2e/12_async.ts index baae0358..ce3d08e4 100644 --- a/tests/e2e/12_async.ts +++ b/tests/e2e/12_async.ts @@ -15,8 +15,10 @@ describe('12_async', () => { const page = await browser.newPage(); await page.goto(`http://localhost:${port}/`); - await page.waitForSelector('body > #app > div > div:nth-child(3) > button'); - await page.click('body > #app > div > div:nth-child(3) > button'); + await page.waitForSelector( + 'body > #root > div > div:nth-child(3) > button', + ); + await page.click('body > #root > div > div:nth-child(3) > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); @@ -27,17 +29,19 @@ describe('12_async', () => { ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div > div:nth-child(4) > button:nth-child(2)', + 'body > #root > div > div:nth-child(4) > button:nth-child(2)', ); await page.click( - 'body > #app > div > div:nth-child(4) > button:nth-child(2)', + 'body > #root > div > div:nth-child(4) > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(3)'); - await page.click('body > #app > div > div > button:nth-child(3)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(3)', + ); + await page.click('body > #root > div > div > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/13_saga.ts b/tests/e2e/13_saga.ts index 5536265a..ea549b5f 100644 --- a/tests/e2e/13_saga.ts +++ b/tests/e2e/13_saga.ts @@ -15,8 +15,10 @@ describe('13_saga', () => { const page = await browser.newPage(); await page.goto(`http://localhost:${port}/`); - await page.waitForSelector('body > #app > div > div:nth-child(3) > button'); - await page.click('body > #app > div > div:nth-child(3) > button'); + await page.waitForSelector( + 'body > #root > div > div:nth-child(3) > button', + ); + await page.click('body > #root > div > div:nth-child(3) > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); @@ -27,17 +29,19 @@ describe('13_saga', () => { ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div > div:nth-child(4) > button:nth-child(2)', + 'body > #root > div > div:nth-child(4) > button:nth-child(2)', ); await page.click( - 'body > #app > div > div:nth-child(4) > button:nth-child(2)', + 'body > #root > div > div:nth-child(4) > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div > div > button:nth-child(3)'); - await page.click('body > #app > div > div > button:nth-child(3)'); + await page.waitForSelector( + 'body > #root > div > div > button:nth-child(3)', + ); + await page.click('body > #root > div > div > button:nth-child(3)'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/14_dynamic.ts b/tests/e2e/14_dynamic.ts index 07cac6cc..ea8b1334 100644 --- a/tests/e2e/14_dynamic.ts +++ b/tests/e2e/14_dynamic.ts @@ -11,91 +11,95 @@ describe('14_dynamic', () => { await page.goto(`http://localhost:${port}/`); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(2)', + 'body > #root > div:nth-child(2) > div > button:nth-child(2)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(2) > div > input'); - await page.click('body > #app > div:nth-child(2) > div > input'); + await page.waitForSelector('body > #root > div:nth-child(2) > div > input'); + await page.click('body > #root > div:nth-child(2) > div > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(2) > div > input', '1'); + await page.type('body > #root > div:nth-child(2) > div > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); await page.click( - 'body > #app > div:nth-child(2) > div > button:nth-child(3)', + 'body > #root > div:nth-child(2) > div > button:nth-child(3)', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(3) > div > input'); - await page.click('body > #app > div:nth-child(3) > div > input'); + await page.waitForSelector('body > #root > div:nth-child(3) > div > input'); + await page.click('body > #root > div:nth-child(3) > div > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.type('body > #app > div:nth-child(3) > div > input', '1'); + await page.type('body > #root > div:nth-child(3) > div > input', '1'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', ); await page.click( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', 'a', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(5) > div > button'); - await page.click('body > #app > div:nth-child(5) > div > button'); + await page.waitForSelector( + 'body > #root > div:nth-child(5) > div > button', + ); + await page.click('body > #root > div:nth-child(5) > div > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.waitForSelector( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', ); await page.click( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); await page.type( - 'body > #app > div:nth-child(5) > div:nth-child(1) > input', + 'body > #root > div:nth-child(5) > div:nth-child(1) > input', 'b', ); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > div:nth-child(6) > div > button'); - await page.click('body > #app > div:nth-child(6) > div > button'); + await page.waitForSelector( + 'body > #root > div:nth-child(6) > div > button', + ); + await page.click('body > #root > div:nth-child(6) > div > button'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/15_reactmemoref.ts b/tests/e2e/15_reactmemoref.ts index 68850b69..a2781156 100644 --- a/tests/e2e/15_reactmemoref.ts +++ b/tests/e2e/15_reactmemoref.ts @@ -10,38 +10,38 @@ describe('15_reactmemoref', () => { const page = await browser.newPage(); await page.goto(`http://localhost:${port}/`); - await page.waitForSelector('body > #app > ul > li:nth-child(1) > input'); - await page.click('body > #app > ul > li:nth-child(1) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(1) > input'); + await page.click('body > #root > ul > li:nth-child(1) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(2) > input'); - await page.click('body > #app > ul > li:nth-child(2) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(2) > input'); + await page.click('body > #root > ul > li:nth-child(2) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(3) > input'); - await page.click('body > #app > ul > li:nth-child(3) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(3) > input'); + await page.click('body > #root > ul > li:nth-child(3) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(1) > input'); - await page.click('body > #app > ul > li:nth-child(1) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(1) > input'); + await page.click('body > #root > ul > li:nth-child(1) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(2) > input'); - await page.click('body > #app > ul > li:nth-child(2) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(2) > input'); + await page.click('body > #root > ul > li:nth-child(2) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); - await page.waitForSelector('body > #app > ul > li:nth-child(3) > input'); - await page.click('body > #app > ul > li:nth-child(3) > input'); + await page.waitForSelector('body > #root > ul > li:nth-child(3) > input'); + await page.click('body > #root > ul > li:nth-child(3) > input'); expect( await page.evaluate(() => document.body.innerHTML), ).toMatchSnapshot(); diff --git a/tests/e2e/__snapshots__/01_counter.ts.snap b/tests/e2e/__snapshots__/01_counter.ts.snap index ae585683..7ffa112a 100644 --- a/tests/e2e/__snapshots__/01_counter.ts.snap +++ b/tests/e2e/__snapshots__/01_counter.ts.snap @@ -2,7 +2,8 @@ exports[`01_minimal > should work with recorded events 1`] = ` " -

Counter

numRendered: 26
Count: 1
numRendered: 28
Count: 1

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 26
Count: 1
numRendered: 28
Count: 1

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -10,7 +11,8 @@ exports[`01_minimal > should work with recorded events 1`] = ` exports[`01_minimal > should work with recorded events 2`] = ` " -

Counter

numRendered: 34
Count: 2
numRendered: 36
Count: 2

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 34
Count: 2
numRendered: 36
Count: 2

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -18,7 +20,8 @@ exports[`01_minimal > should work with recorded events 2`] = ` exports[`01_minimal > should work with recorded events 3`] = ` " -

Counter

numRendered: 42
Count: 3
numRendered: 44
Count: 3

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 42
Count: 3
numRendered: 44
Count: 3

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -26,7 +29,8 @@ exports[`01_minimal > should work with recorded events 3`] = ` exports[`01_minimal > should work with recorded events 4`] = ` " -

Counter

numRendered: 50
Count: 2
numRendered: 52
Count: 2

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 50
Count: 2
numRendered: 52
Count: 2

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -34,7 +38,8 @@ exports[`01_minimal > should work with recorded events 4`] = ` exports[`01_minimal > should work with recorded events 5`] = ` " -

Counter

numRendered: 58
Count: 1
numRendered: 60
Count: 1

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 58
Count: 1
numRendered: 60
Count: 1

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -42,7 +47,8 @@ exports[`01_minimal > should work with recorded events 5`] = ` exports[`01_minimal > should work with recorded events 6`] = ` " -

Counter

numRendered: 66
Count: 0
numRendered: 68
Count: 0

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 66
Count: 0
numRendered: 68
Count: 0

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -50,7 +56,8 @@ exports[`01_minimal > should work with recorded events 6`] = ` exports[`01_minimal > should work with recorded events 7`] = ` " -

Counter

numRendered: 74
Count: -1
numRendered: 76
Count: -1

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 74
Count: -1
numRendered: 76
Count: -1

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -58,7 +65,8 @@ exports[`01_minimal > should work with recorded events 7`] = ` exports[`01_minimal > should work with recorded events 8`] = ` " -

Counter

numRendered: 82
Count: -2
numRendered: 84
Count: -2

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 82
Count: -2
numRendered: 84
Count: -2

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -66,7 +74,8 @@ exports[`01_minimal > should work with recorded events 8`] = ` exports[`01_minimal > should work with recorded events 9`] = ` " -

Counter

numRendered: 90
Count: -3
numRendered: 92
Count: -3

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 90
Count: -3
numRendered: 92
Count: -3

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -74,7 +83,8 @@ exports[`01_minimal > should work with recorded events 9`] = ` exports[`01_minimal > should work with recorded events 10`] = ` " -

Counter

numRendered: 98
Count: -2
numRendered: 100
Count: -2

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 98
Count: -2
numRendered: 100
Count: -2

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -82,7 +92,8 @@ exports[`01_minimal > should work with recorded events 10`] = ` exports[`01_minimal > should work with recorded events 11`] = ` " -

Counter

numRendered: 106
Count: -1
numRendered: 108
Count: -1

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 106
Count: -1
numRendered: 108
Count: -1

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -90,7 +101,8 @@ exports[`01_minimal > should work with recorded events 11`] = ` exports[`01_minimal > should work with recorded events 12`] = ` " -

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -98,7 +110,8 @@ exports[`01_minimal > should work with recorded events 12`] = ` exports[`01_minimal > should work with recorded events 13`] = ` " -

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 6
Text: hello
numRendered: 8
Text: hello
+ " @@ -106,7 +119,8 @@ exports[`01_minimal > should work with recorded events 13`] = ` exports[`01_minimal > should work with recorded events 14`] = ` " -

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 126
Text: hello1
numRendered: 128
Text: hello1
+

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 126
Text: hello1
numRendered: 128
Text: hello1
+ " @@ -114,7 +128,8 @@ exports[`01_minimal > should work with recorded events 14`] = ` exports[`01_minimal > should work with recorded events 15`] = ` " -

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 134
Text: hello12
numRendered: 136
Text: hello12
+

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 134
Text: hello12
numRendered: 136
Text: hello12
+ " @@ -122,7 +137,8 @@ exports[`01_minimal > should work with recorded events 15`] = ` exports[`01_minimal > should work with recorded events 16`] = ` " -

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 142
Text: hello123
numRendered: 144
Text: hello123
+

Counter

numRendered: 114
Count: 0
numRendered: 116
Count: 0

TextBox

numRendered: 142
Text: hello123
numRendered: 144
Text: hello123
+ " diff --git a/tests/e2e/__snapshots__/02_person.ts.snap b/tests/e2e/__snapshots__/02_person.ts.snap index e11f07a1..8debbd10 100644 --- a/tests/e2e/__snapshots__/02_person.ts.snap +++ b/tests/e2e/__snapshots__/02_person.ts.snap @@ -2,7 +2,8 @@ exports[`02_typescript > should work with recorded events 1`] = ` " -

Counter

numRendered: 18
Count: 1
numRendered: 20
Count: 1

Person

numRendered: 2
numRendered: 36
Count: 1
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 40
Count: 1
First Name:
Last Name:
Age:
+

Counter

numRendered: 18
Count: 1
numRendered: 20
Count: 1

Person

numRendered: 2
numRendered: 36
Count: 1
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 40
Count: 1
First Name:
Last Name:
Age:
+ " @@ -10,7 +11,8 @@ exports[`02_typescript > should work with recorded events 1`] = ` exports[`02_typescript > should work with recorded events 2`] = ` " -

Counter

numRendered: 26
Count: 2
numRendered: 28
Count: 2

Person

numRendered: 2
numRendered: 52
Count: 2
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 56
Count: 2
First Name:
Last Name:
Age:
+

Counter

numRendered: 26
Count: 2
numRendered: 28
Count: 2

Person

numRendered: 2
numRendered: 52
Count: 2
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 56
Count: 2
First Name:
Last Name:
Age:
+ " @@ -18,7 +20,8 @@ exports[`02_typescript > should work with recorded events 2`] = ` exports[`02_typescript > should work with recorded events 3`] = ` " -

Counter

numRendered: 34
Count: 1
numRendered: 36
Count: 1

Person

numRendered: 2
numRendered: 68
Count: 1
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 72
Count: 1
First Name:
Last Name:
Age:
+

Counter

numRendered: 34
Count: 1
numRendered: 36
Count: 1

Person

numRendered: 2
numRendered: 68
Count: 1
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 72
Count: 1
First Name:
Last Name:
Age:
+ " @@ -26,7 +29,8 @@ exports[`02_typescript > should work with recorded events 3`] = ` exports[`02_typescript > should work with recorded events 4`] = ` " -

Counter

numRendered: 42
Count: 0
numRendered: 44
Count: 0

Person

numRendered: 2
numRendered: 84
Count: 0
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 88
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 42
Count: 0
numRendered: 44
Count: 0

Person

numRendered: 2
numRendered: 84
Count: 0
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 88
Count: 0
First Name:
Last Name:
Age:
+ " @@ -34,7 +38,8 @@ exports[`02_typescript > should work with recorded events 4`] = ` exports[`02_typescript > should work with recorded events 5`] = ` " -

Counter

numRendered: 50
Count: 1
numRendered: 52
Count: 1

Person

numRendered: 2
numRendered: 100
Count: 1
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 104
Count: 1
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 1
numRendered: 52
Count: 1

Person

numRendered: 2
numRendered: 100
Count: 1
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 104
Count: 1
First Name:
Last Name:
Age:
+ " @@ -42,7 +47,8 @@ exports[`02_typescript > should work with recorded events 5`] = ` exports[`02_typescript > should work with recorded events 6`] = ` " -

Counter

numRendered: 58
Count: 2
numRendered: 60
Count: 2

Person

numRendered: 2
numRendered: 116
Count: 2
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 120
Count: 2
First Name:
Last Name:
Age:
+

Counter

numRendered: 58
Count: 2
numRendered: 60
Count: 2

Person

numRendered: 2
numRendered: 116
Count: 2
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 120
Count: 2
First Name:
Last Name:
Age:
+ " @@ -50,7 +56,8 @@ exports[`02_typescript > should work with recorded events 6`] = ` exports[`02_typescript > should work with recorded events 7`] = ` " -

Counter

numRendered: 66
Count: 1
numRendered: 68
Count: 1

Person

numRendered: 2
numRendered: 132
Count: 1
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 136
Count: 1
First Name:
Last Name:
Age:
+

Counter

numRendered: 66
Count: 1
numRendered: 68
Count: 1

Person

numRendered: 2
numRendered: 132
Count: 1
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 136
Count: 1
First Name:
Last Name:
Age:
+ " @@ -58,7 +65,8 @@ exports[`02_typescript > should work with recorded events 7`] = ` exports[`02_typescript > should work with recorded events 8`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 2
numRendered: 148
Count: 0
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 152
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 2
numRendered: 148
Count: 0
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 152
Count: 0
First Name:
Last Name:
Age:
+ " @@ -66,7 +74,8 @@ exports[`02_typescript > should work with recorded events 8`] = ` exports[`02_typescript > should work with recorded events 9`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 2
numRendered: 148
Count: 0
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 152
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 2
numRendered: 148
Count: 0
First Name:
Last Name:
Age:
numRendered: 6
numRendered: 152
Count: 0
First Name:
Last Name:
Age:
+ " @@ -74,7 +83,8 @@ exports[`02_typescript > should work with recorded events 9`] = ` exports[`02_typescript > should work with recorded events 10`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 162
numRendered: 164a
Count: 0
First Name:
Last Name:
Age:
numRendered: 166
numRendered: 168a
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 162
numRendered: 164a
Count: 0
First Name:
Last Name:
Age:
numRendered: 166
numRendered: 168a
Count: 0
First Name:
Last Name:
Age:
+ " @@ -82,7 +92,8 @@ exports[`02_typescript > should work with recorded events 10`] = ` exports[`02_typescript > should work with recorded events 11`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 178
numRendered: 180ab
Count: 0
First Name:
Last Name:
Age:
numRendered: 182
numRendered: 184ab
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 178
numRendered: 180ab
Count: 0
First Name:
Last Name:
Age:
numRendered: 182
numRendered: 184ab
Count: 0
First Name:
Last Name:
Age:
+ " @@ -90,7 +101,8 @@ exports[`02_typescript > should work with recorded events 11`] = ` exports[`02_typescript > should work with recorded events 12`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 194
numRendered: 196abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 198
numRendered: 200abc
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 194
numRendered: 196abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 198
numRendered: 200abc
Count: 0
First Name:
Last Name:
Age:
+ " @@ -98,7 +110,8 @@ exports[`02_typescript > should work with recorded events 12`] = ` exports[`02_typescript > should work with recorded events 13`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 210
numRendered: 212abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 214
numRendered: 216abc
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 210
numRendered: 212abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 214
numRendered: 216abc
Count: 0
First Name:
Last Name:
Age:
+ " @@ -106,7 +119,8 @@ exports[`02_typescript > should work with recorded events 13`] = ` exports[`02_typescript > should work with recorded events 14`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 226
numRendered: 228abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 230
numRendered: 232abc
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 226
numRendered: 228abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 230
numRendered: 232abc
Count: 0
First Name:
Last Name:
Age:
+ " @@ -114,7 +128,8 @@ exports[`02_typescript > should work with recorded events 14`] = ` exports[`02_typescript > should work with recorded events 15`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 242
numRendered: 244abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 246
numRendered: 248abc
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 242
numRendered: 244abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 246
numRendered: 248abc
Count: 0
First Name:
Last Name:
Age:
+ " @@ -122,7 +137,8 @@ exports[`02_typescript > should work with recorded events 15`] = ` exports[`02_typescript > should work with recorded events 16`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 258
numRendered: 260abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 262
numRendered: 264abc
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 258
numRendered: 260abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 262
numRendered: 264abc
Count: 0
First Name:
Last Name:
Age:
+ " @@ -130,7 +146,8 @@ exports[`02_typescript > should work with recorded events 16`] = ` exports[`02_typescript > should work with recorded events 17`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 274
numRendered: 276abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 278
numRendered: 280abc
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 274
numRendered: 276abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 278
numRendered: 280abc
Count: 0
First Name:
Last Name:
Age:
+ " @@ -138,7 +155,8 @@ exports[`02_typescript > should work with recorded events 17`] = ` exports[`02_typescript > should work with recorded events 18`] = ` " -

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 290
numRendered: 292abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 294
numRendered: 296abc
Count: 0
First Name:
Last Name:
Age:
+

Counter

numRendered: 74
Count: 0
numRendered: 76
Count: 0

Person

numRendered: 290
numRendered: 292abc
Count: 0
First Name:
Last Name:
Age:
numRendered: 294
numRendered: 296abc
Count: 0
First Name:
Last Name:
Age:
+ " diff --git a/tests/e2e/__snapshots__/03_usestate.ts.snap b/tests/e2e/__snapshots__/03_usestate.ts.snap index 26fe44bb..259da77f 100644 --- a/tests/e2e/__snapshots__/03_usestate.ts.snap +++ b/tests/e2e/__snapshots__/03_usestate.ts.snap @@ -2,7 +2,8 @@ exports[`03_usestate > should work with recorded events 1`] = ` " -

Counter

numRendered: 18
Count: 1
numRendered: 20
Count: 1

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 18
Count: 1
numRendered: 20
Count: 1

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -10,7 +11,8 @@ exports[`03_usestate > should work with recorded events 1`] = ` exports[`03_usestate > should work with recorded events 2`] = ` " -

Counter

numRendered: 26
Count: 2
numRendered: 28
Count: 2

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 26
Count: 2
numRendered: 28
Count: 2

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -18,7 +20,8 @@ exports[`03_usestate > should work with recorded events 2`] = ` exports[`03_usestate > should work with recorded events 3`] = ` " -

Counter

numRendered: 34
Count: 3
numRendered: 36
Count: 3

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 34
Count: 3
numRendered: 36
Count: 3

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -26,7 +29,8 @@ exports[`03_usestate > should work with recorded events 3`] = ` exports[`03_usestate > should work with recorded events 4`] = ` " -

Counter

numRendered: 42
Count: 4
numRendered: 44
Count: 4

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 42
Count: 4
numRendered: 44
Count: 4

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -34,7 +38,8 @@ exports[`03_usestate > should work with recorded events 4`] = ` exports[`03_usestate > should work with recorded events 5`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -42,7 +47,8 @@ exports[`03_usestate > should work with recorded events 5`] = ` exports[`03_usestate > should work with recorded events 6`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -50,7 +56,8 @@ exports[`03_usestate > should work with recorded events 6`] = ` exports[`03_usestate > should work with recorded events 7`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 58
First Name:
Last Name:
Age:
numRendered: 60
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 58
First Name:
Last Name:
Age:
numRendered: 60
First Name:
Last Name:
Age:
+ " @@ -58,7 +65,8 @@ exports[`03_usestate > should work with recorded events 7`] = ` exports[`03_usestate > should work with recorded events 8`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 66
First Name:
Last Name:
Age:
numRendered: 68
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 66
First Name:
Last Name:
Age:
numRendered: 68
First Name:
Last Name:
Age:
+ " @@ -66,7 +74,8 @@ exports[`03_usestate > should work with recorded events 8`] = ` exports[`03_usestate > should work with recorded events 9`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 74
First Name:
Last Name:
Age:
numRendered: 76
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 74
First Name:
Last Name:
Age:
numRendered: 76
First Name:
Last Name:
Age:
+ " @@ -74,7 +83,8 @@ exports[`03_usestate > should work with recorded events 9`] = ` exports[`03_usestate > should work with recorded events 10`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 82
First Name:
Last Name:
Age:
numRendered: 84
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 82
First Name:
Last Name:
Age:
numRendered: 84
First Name:
Last Name:
Age:
+ " @@ -82,7 +92,8 @@ exports[`03_usestate > should work with recorded events 10`] = ` exports[`03_usestate > should work with recorded events 11`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 90
First Name:
Last Name:
Age:
numRendered: 92
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 90
First Name:
Last Name:
Age:
numRendered: 92
First Name:
Last Name:
Age:
+ " @@ -90,7 +101,8 @@ exports[`03_usestate > should work with recorded events 11`] = ` exports[`03_usestate > should work with recorded events 12`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 98
First Name:
Last Name:
Age:
numRendered: 100
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 98
First Name:
Last Name:
Age:
numRendered: 100
First Name:
Last Name:
Age:
+ " @@ -98,7 +110,8 @@ exports[`03_usestate > should work with recorded events 12`] = ` exports[`03_usestate > should work with recorded events 13`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 106
First Name:
Last Name:
Age:
numRendered: 108
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 106
First Name:
Last Name:
Age:
numRendered: 108
First Name:
Last Name:
Age:
+ " @@ -106,7 +119,8 @@ exports[`03_usestate > should work with recorded events 13`] = ` exports[`03_usestate > should work with recorded events 14`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 114
First Name:
Last Name:
Age:
numRendered: 116
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 114
First Name:
Last Name:
Age:
numRendered: 116
First Name:
Last Name:
Age:
+ " @@ -114,7 +128,8 @@ exports[`03_usestate > should work with recorded events 14`] = ` exports[`03_usestate > should work with recorded events 15`] = ` " -

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 122
First Name:
Last Name:
Age:
numRendered: 124
First Name:
Last Name:
Age:
+

Counter

numRendered: 50
Count: 5
numRendered: 52
Count: 5

Person

numRendered: 122
First Name:
Last Name:
Age:
numRendered: 124
First Name:
Last Name:
Age:
+ " diff --git a/tests/e2e/__snapshots__/04_selector.ts.snap b/tests/e2e/__snapshots__/04_selector.ts.snap index e49ec5d9..8e2c4fc4 100644 --- a/tests/e2e/__snapshots__/04_selector.ts.snap +++ b/tests/e2e/__snapshots__/04_selector.ts.snap @@ -2,7 +2,8 @@ exports[`04_selector > should work with recorded events 1`] = ` " -

Counter

numRendered: 14
Count: 1
numRendered: 16
Count: 1

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 14
Count: 1
numRendered: 16
Count: 1

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -10,7 +11,8 @@ exports[`04_selector > should work with recorded events 1`] = ` exports[`04_selector > should work with recorded events 2`] = ` " -

Counter

numRendered: 22
Count: 0
numRendered: 24
Count: 0

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 22
Count: 0
numRendered: 24
Count: 0

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -18,7 +20,8 @@ exports[`04_selector > should work with recorded events 2`] = ` exports[`04_selector > should work with recorded events 3`] = ` " -

Counter

numRendered: 30
Count: 1
numRendered: 32
Count: 1

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 30
Count: 1
numRendered: 32
Count: 1

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -26,7 +29,8 @@ exports[`04_selector > should work with recorded events 3`] = ` exports[`04_selector > should work with recorded events 4`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -34,7 +38,8 @@ exports[`04_selector > should work with recorded events 4`] = ` exports[`04_selector > should work with recorded events 5`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 2
First Name:
Last Name:
Age:
numRendered: 4
First Name:
Last Name:
Age:
+ " @@ -42,7 +47,8 @@ exports[`04_selector > should work with recorded events 5`] = ` exports[`04_selector > should work with recorded events 6`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 46
First Name:
Last Name:
Age:
numRendered: 48
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 46
First Name:
Last Name:
Age:
numRendered: 48
First Name:
Last Name:
Age:
+ " @@ -50,7 +56,8 @@ exports[`04_selector > should work with recorded events 6`] = ` exports[`04_selector > should work with recorded events 7`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 54
First Name:
Last Name:
Age:
numRendered: 56
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 54
First Name:
Last Name:
Age:
numRendered: 56
First Name:
Last Name:
Age:
+ " @@ -58,7 +65,8 @@ exports[`04_selector > should work with recorded events 7`] = ` exports[`04_selector > should work with recorded events 8`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 62
First Name:
Last Name:
Age:
numRendered: 64
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 62
First Name:
Last Name:
Age:
numRendered: 64
First Name:
Last Name:
Age:
+ " @@ -66,7 +74,8 @@ exports[`04_selector > should work with recorded events 8`] = ` exports[`04_selector > should work with recorded events 9`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 70
First Name:
Last Name:
Age:
numRendered: 72
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 70
First Name:
Last Name:
Age:
numRendered: 72
First Name:
Last Name:
Age:
+ " @@ -74,7 +83,8 @@ exports[`04_selector > should work with recorded events 9`] = ` exports[`04_selector > should work with recorded events 10`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 78
First Name:
Last Name:
Age:
numRendered: 80
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 78
First Name:
Last Name:
Age:
numRendered: 80
First Name:
Last Name:
Age:
+ " @@ -82,7 +92,8 @@ exports[`04_selector > should work with recorded events 10`] = ` exports[`04_selector > should work with recorded events 11`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 86
First Name:
Last Name:
Age:
numRendered: 88
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 86
First Name:
Last Name:
Age:
numRendered: 88
First Name:
Last Name:
Age:
+ " @@ -90,7 +101,8 @@ exports[`04_selector > should work with recorded events 11`] = ` exports[`04_selector > should work with recorded events 12`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 94
First Name:
Last Name:
Age:
numRendered: 96
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 94
First Name:
Last Name:
Age:
numRendered: 96
First Name:
Last Name:
Age:
+ " @@ -98,7 +110,8 @@ exports[`04_selector > should work with recorded events 12`] = ` exports[`04_selector > should work with recorded events 13`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 102
First Name:
Last Name:
Age:
numRendered: 104
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 102
First Name:
Last Name:
Age:
numRendered: 104
First Name:
Last Name:
Age:
+ " @@ -106,7 +119,8 @@ exports[`04_selector > should work with recorded events 13`] = ` exports[`04_selector > should work with recorded events 14`] = ` " -

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 110
First Name:
Last Name:
Age:
numRendered: 112
First Name:
Last Name:
Age:
+

Counter

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Person

numRendered: 110
First Name:
Last Name:
Age:
numRendered: 112
First Name:
Last Name:
Age:
+ " diff --git a/tests/e2e/__snapshots__/05_container.ts.snap b/tests/e2e/__snapshots__/05_container.ts.snap index 0b378b78..1e629e7c 100644 --- a/tests/e2e/__snapshots__/05_container.ts.snap +++ b/tests/e2e/__snapshots__/05_container.ts.snap @@ -2,7 +2,8 @@ exports[`05_container > should work with recorded events 1`] = ` " -

First container

numRendered: 30
Count: 1
numRendered: 32
Count: 1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 30
Count: 1
numRendered: 32
Count: 1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -10,7 +11,8 @@ exports[`05_container > should work with recorded events 1`] = ` exports[`05_container > should work with recorded events 2`] = ` " -

First container

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 38
Count: 0
numRendered: 40
Count: 0

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -18,7 +20,8 @@ exports[`05_container > should work with recorded events 2`] = ` exports[`05_container > should work with recorded events 3`] = ` " -

First container

numRendered: 46
Count: -1
numRendered: 48
Count: -1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 46
Count: -1
numRendered: 48
Count: -1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -26,7 +29,8 @@ exports[`05_container > should work with recorded events 3`] = ` exports[`05_container > should work with recorded events 4`] = ` " -

First container

numRendered: 54
Count: 0
numRendered: 56
Count: 0

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 54
Count: 0
numRendered: 56
Count: 0

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -34,7 +38,8 @@ exports[`05_container > should work with recorded events 4`] = ` exports[`05_container > should work with recorded events 5`] = ` " -

First container

numRendered: 62
Count: 1
numRendered: 64
Count: 1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 62
Count: 1
numRendered: 64
Count: 1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -42,7 +47,8 @@ exports[`05_container > should work with recorded events 5`] = ` exports[`05_container > should work with recorded events 6`] = ` " -

First container

numRendered: 70
Count: 2
numRendered: 72
Count: 2

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 70
Count: 2
numRendered: 72
Count: 2

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -50,7 +56,8 @@ exports[`05_container > should work with recorded events 6`] = ` exports[`05_container > should work with recorded events 7`] = ` " -

First container

numRendered: 78
Count: 1
numRendered: 80
Count: 1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 78
Count: 1
numRendered: 80
Count: 1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -58,7 +65,8 @@ exports[`05_container > should work with recorded events 7`] = ` exports[`05_container > should work with recorded events 8`] = ` " -

First container

numRendered: 86
Count: 0
numRendered: 88
Count: 0

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 86
Count: 0
numRendered: 88
Count: 0

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -66,7 +74,8 @@ exports[`05_container > should work with recorded events 8`] = ` exports[`05_container > should work with recorded events 9`] = ` " -

First container

numRendered: 94
Count: -1
numRendered: 96
Count: -1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 94
Count: -1
numRendered: 96
Count: -1

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -74,7 +83,8 @@ exports[`05_container > should work with recorded events 9`] = ` exports[`05_container > should work with recorded events 10`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 6
Count: 0
numRendered: 8
Count: 0
+ " @@ -82,7 +92,8 @@ exports[`05_container > should work with recorded events 10`] = ` exports[`05_container > should work with recorded events 11`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 110
Count: 1
numRendered: 112
Count: 1
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 110
Count: 1
numRendered: 112
Count: 1
+ " @@ -90,7 +101,8 @@ exports[`05_container > should work with recorded events 11`] = ` exports[`05_container > should work with recorded events 12`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 118
Count: 0
numRendered: 120
Count: 0
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 118
Count: 0
numRendered: 120
Count: 0
+ " @@ -98,7 +110,8 @@ exports[`05_container > should work with recorded events 12`] = ` exports[`05_container > should work with recorded events 13`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 126
Count: -1
numRendered: 128
Count: -1
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 126
Count: -1
numRendered: 128
Count: -1
+ " @@ -106,7 +119,8 @@ exports[`05_container > should work with recorded events 13`] = ` exports[`05_container > should work with recorded events 14`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 134
Count: 0
numRendered: 136
Count: 0
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 134
Count: 0
numRendered: 136
Count: 0
+ " @@ -114,7 +128,8 @@ exports[`05_container > should work with recorded events 14`] = ` exports[`05_container > should work with recorded events 15`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 142
Count: 1
numRendered: 144
Count: 1
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 142
Count: 1
numRendered: 144
Count: 1
+ " @@ -122,7 +137,8 @@ exports[`05_container > should work with recorded events 15`] = ` exports[`05_container > should work with recorded events 16`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 150
Count: 2
numRendered: 152
Count: 2
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 150
Count: 2
numRendered: 152
Count: 2
+ " @@ -130,7 +146,8 @@ exports[`05_container > should work with recorded events 16`] = ` exports[`05_container > should work with recorded events 17`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 158
Count: 1
numRendered: 160
Count: 1
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 158
Count: 1
numRendered: 160
Count: 1
+ " @@ -138,7 +155,8 @@ exports[`05_container > should work with recorded events 17`] = ` exports[`05_container > should work with recorded events 18`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 166
Count: 0
numRendered: 168
Count: 0
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 166
Count: 0
numRendered: 168
Count: 0
+ " @@ -146,7 +164,8 @@ exports[`05_container > should work with recorded events 18`] = ` exports[`05_container > should work with recorded events 19`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 174
Count: -1
numRendered: 176
Count: -1
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 174
Count: -1
numRendered: 176
Count: -1
+ " @@ -154,7 +173,8 @@ exports[`05_container > should work with recorded events 19`] = ` exports[`05_container > should work with recorded events 20`] = ` " -

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 182
Count: -2
numRendered: 184
Count: -2
+

First container

numRendered: 102
Count: -2
numRendered: 104
Count: -2

Second container

numRendered: 182
Count: -2
numRendered: 184
Count: -2
+ " diff --git a/tests/e2e/__snapshots__/06_customhook.ts.snap b/tests/e2e/__snapshots__/06_customhook.ts.snap index cf2a213f..3d5ec5b5 100644 --- a/tests/e2e/__snapshots__/06_customhook.ts.snap +++ b/tests/e2e/__snapshots__/06_customhook.ts.snap @@ -2,7 +2,8 @@ exports[`06_customhook > should work with recorded events 1`] = ` " -
Count: 1
Count: 1
+
Count: 1
Count: 1
+ " @@ -10,7 +11,8 @@ exports[`06_customhook > should work with recorded events 1`] = ` exports[`06_customhook > should work with recorded events 2`] = ` " -
Count: 2
Count: 2
+
Count: 2
Count: 2
+ " @@ -18,7 +20,8 @@ exports[`06_customhook > should work with recorded events 2`] = ` exports[`06_customhook > should work with recorded events 3`] = ` " -
Count: 1
Count: 1
+
Count: 1
Count: 1
+ " @@ -26,7 +29,8 @@ exports[`06_customhook > should work with recorded events 3`] = ` exports[`06_customhook > should work with recorded events 4`] = ` " -
Count: 0
Count: 0
+
Count: 0
Count: 0
+ " @@ -34,7 +38,8 @@ exports[`06_customhook > should work with recorded events 4`] = ` exports[`06_customhook > should work with recorded events 5`] = ` " -
Count: 1
Count: 1
+
Count: 1
Count: 1
+ " @@ -42,7 +47,8 @@ exports[`06_customhook > should work with recorded events 5`] = ` exports[`06_customhook > should work with recorded events 6`] = ` " -
Count: 2
Count: 2
+
Count: 2
Count: 2
+ " @@ -50,7 +56,8 @@ exports[`06_customhook > should work with recorded events 6`] = ` exports[`06_customhook > should work with recorded events 7`] = ` " -
Count: 1
Count: 1
+
Count: 1
Count: 1
+ " @@ -58,7 +65,8 @@ exports[`06_customhook > should work with recorded events 7`] = ` exports[`06_customhook > should work with recorded events 8`] = ` " -
Count: 0
Count: 0
+
Count: 0
Count: 0
+ " diff --git a/tests/e2e/__snapshots__/07_todolist.ts.snap b/tests/e2e/__snapshots__/07_todolist.ts.snap index 2f3f81fa..a24a3354 100644 --- a/tests/e2e/__snapshots__/07_todolist.ts.snap +++ b/tests/e2e/__snapshots__/07_todolist.ts.snap @@ -2,7 +2,8 @@ exports[`07_todolist > should work with recorded events 1`] = ` " -
    Show:
    +
      Show:
      + " @@ -10,7 +11,8 @@ exports[`07_todolist > should work with recorded events 1`] = ` exports[`07_todolist > should work with recorded events 2`] = ` " -
        Show:
        +
          Show:
          + " @@ -18,7 +20,8 @@ exports[`07_todolist > should work with recorded events 2`] = ` exports[`07_todolist > should work with recorded events 3`] = ` " -
            Show:
            +
              Show:
              + " @@ -26,7 +29,8 @@ exports[`07_todolist > should work with recorded events 3`] = ` exports[`07_todolist > should work with recorded events 4`] = ` " -
                Show:
                +
                  Show:
                  + " @@ -34,7 +38,8 @@ exports[`07_todolist > should work with recorded events 4`] = ` exports[`07_todolist > should work with recorded events 5`] = ` " -
                  • aaa
                  Show:
                  +
                  • aaa
                  Show:
                  + " @@ -42,7 +47,8 @@ exports[`07_todolist > should work with recorded events 5`] = ` exports[`07_todolist > should work with recorded events 6`] = ` " -
                  • aaa
                  Show:
                  +
                  • aaa
                  Show:
                  + " @@ -50,7 +56,8 @@ exports[`07_todolist > should work with recorded events 6`] = ` exports[`07_todolist > should work with recorded events 7`] = ` " -
                  • aaa
                  Show:
                  +
                  • aaa
                  Show:
                  + " @@ -58,7 +65,8 @@ exports[`07_todolist > should work with recorded events 7`] = ` exports[`07_todolist > should work with recorded events 8`] = ` " -
                  • aaa
                  Show:
                  +
                  • aaa
                  Show:
                  + " @@ -66,7 +74,8 @@ exports[`07_todolist > should work with recorded events 8`] = ` exports[`07_todolist > should work with recorded events 9`] = ` " -
                  • aaa
                  Show:
                  +
                  • aaa
                  Show:
                  + " @@ -74,7 +83,8 @@ exports[`07_todolist > should work with recorded events 9`] = ` exports[`07_todolist > should work with recorded events 10`] = ` " -
                  • aaa
                  • bbb
                  Show:
                  +
                  • aaa
                  • bbb
                  Show:
                  + " @@ -82,7 +92,8 @@ exports[`07_todolist > should work with recorded events 10`] = ` exports[`07_todolist > should work with recorded events 11`] = ` " -
                  • aaa
                  • bbb
                  Show:
                  +
                  • aaa
                  • bbb
                  Show:
                  + " @@ -90,7 +101,8 @@ exports[`07_todolist > should work with recorded events 11`] = ` exports[`07_todolist > should work with recorded events 12`] = ` " -
                  • aaa
                  • bbb
                  Show:
                  +
                  • aaa
                  • bbb
                  Show:
                  + " @@ -98,7 +110,8 @@ exports[`07_todolist > should work with recorded events 12`] = ` exports[`07_todolist > should work with recorded events 13`] = ` " -
                  • aaa
                  • bbb
                  Show:
                  +
                  • aaa
                  • bbb
                  Show:
                  + " @@ -106,7 +119,8 @@ exports[`07_todolist > should work with recorded events 13`] = ` exports[`07_todolist > should work with recorded events 14`] = ` " -
                  • aaa
                  • bbb
                  Show:
                  +
                  • aaa
                  • bbb
                  Show:
                  + " @@ -114,7 +128,8 @@ exports[`07_todolist > should work with recorded events 14`] = ` exports[`07_todolist > should work with recorded events 15`] = ` " -
                  • aaa
                  • bbb
                  • ccc
                  Show:
                  +
                  • aaa
                  • bbb
                  • ccc
                  Show:
                  + " @@ -122,7 +137,8 @@ exports[`07_todolist > should work with recorded events 15`] = ` exports[`07_todolist > should work with recorded events 16`] = ` " -
                  • aaa
                  • bbb
                  • ccc
                  Show:
                  +
                  • aaa
                  • bbb
                  • ccc
                  Show:
                  + " @@ -130,7 +146,8 @@ exports[`07_todolist > should work with recorded events 16`] = ` exports[`07_todolist > should work with recorded events 17`] = ` " -
                    Show:
                    +
                      Show:
                      + " @@ -138,7 +155,8 @@ exports[`07_todolist > should work with recorded events 17`] = ` exports[`07_todolist > should work with recorded events 18`] = ` " -
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      +
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      + " @@ -146,7 +164,8 @@ exports[`07_todolist > should work with recorded events 18`] = ` exports[`07_todolist > should work with recorded events 19`] = ` " -
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      +
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      + " @@ -154,7 +173,8 @@ exports[`07_todolist > should work with recorded events 19`] = ` exports[`07_todolist > should work with recorded events 20`] = ` " -
                      • aaa
                      • ccc
                      Show:
                      +
                      • aaa
                      • ccc
                      Show:
                      + " @@ -162,7 +182,8 @@ exports[`07_todolist > should work with recorded events 20`] = ` exports[`07_todolist > should work with recorded events 21`] = ` " -
                      • bbb
                      Show:
                      +
                      • bbb
                      Show:
                      + " @@ -170,7 +191,8 @@ exports[`07_todolist > should work with recorded events 21`] = ` exports[`07_todolist > should work with recorded events 22`] = ` " -
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      +
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      + " @@ -178,7 +200,8 @@ exports[`07_todolist > should work with recorded events 22`] = ` exports[`07_todolist > should work with recorded events 23`] = ` " -
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      +
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      + " @@ -186,7 +209,8 @@ exports[`07_todolist > should work with recorded events 23`] = ` exports[`07_todolist > should work with recorded events 24`] = ` " -
                      • aaa
                      Show:
                      +
                      • aaa
                      Show:
                      + " @@ -194,7 +218,8 @@ exports[`07_todolist > should work with recorded events 24`] = ` exports[`07_todolist > should work with recorded events 25`] = ` " -
                      • bbb
                      • ccc
                      Show:
                      +
                      • bbb
                      • ccc
                      Show:
                      + " @@ -202,7 +227,8 @@ exports[`07_todolist > should work with recorded events 25`] = ` exports[`07_todolist > should work with recorded events 26`] = ` " -
                      • ccc
                      Show:
                      +
                      • ccc
                      Show:
                      + " @@ -210,7 +236,8 @@ exports[`07_todolist > should work with recorded events 26`] = ` exports[`07_todolist > should work with recorded events 27`] = ` " -
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      +
                      • aaa
                      • bbb
                      • ccc
                      Show:
                      + " @@ -218,7 +245,8 @@ exports[`07_todolist > should work with recorded events 27`] = ` exports[`07_todolist > should work with recorded events 28`] = ` " -
                      • aaa
                      • bbb
                      Show:
                      +
                      • aaa
                      • bbb
                      Show:
                      + " diff --git a/tests/e2e/__snapshots__/08_comparison.ts.snap b/tests/e2e/__snapshots__/08_comparison.ts.snap index ccb3f1c4..4c3df0f6 100644 --- a/tests/e2e/__snapshots__/08_comparison.ts.snap +++ b/tests/e2e/__snapshots__/08_comparison.ts.snap @@ -2,7 +2,8 @@ exports[`08_comparison > should work with recorded events 1`] = ` " -

                      Naive Context

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Split Context

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Split Context

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -10,7 +11,8 @@ exports[`08_comparison > should work with recorded events 1`] = ` exports[`08_comparison > should work with recorded events 2`] = ` " -

                      Naive Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Split Context

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Split Context

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -18,7 +20,8 @@ exports[`08_comparison > should work with recorded events 2`] = ` exports[`08_comparison > should work with recorded events 3`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -26,7 +29,8 @@ exports[`08_comparison > should work with recorded events 3`] = ` exports[`08_comparison > should work with recorded events 4`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:1)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:1)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -34,7 +38,8 @@ exports[`08_comparison > should work with recorded events 4`] = ` exports[`08_comparison > should work with recorded events 5`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:1)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -42,7 +47,8 @@ exports[`08_comparison > should work with recorded events 5`] = ` exports[`08_comparison > should work with recorded events 6`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:1)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -50,7 +56,8 @@ exports[`08_comparison > should work with recorded events 6`] = ` exports[`08_comparison > should work with recorded events 7`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:2)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -58,7 +65,8 @@ exports[`08_comparison > should work with recorded events 7`] = ` exports[`08_comparison > should work with recorded events 8`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:4)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:4)
                      Family Name:(renders:2)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -66,7 +74,8 @@ exports[`08_comparison > should work with recorded events 8`] = ` exports[`08_comparison > should work with recorded events 9`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      react-tracked

                      First Name:(renders:1)
                      Family Name:(renders:1)
                      + " @@ -74,7 +83,8 @@ exports[`08_comparison > should work with recorded events 9`] = ` exports[`08_comparison > should work with recorded events 10`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      react-tracked

                      First Name:(renders:3)
                      Family Name:(renders:1)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      react-tracked

                      First Name:(renders:3)
                      Family Name:(renders:1)
                      + " @@ -82,7 +92,8 @@ exports[`08_comparison > should work with recorded events 10`] = ` exports[`08_comparison > should work with recorded events 11`] = ` " -

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      react-tracked

                      First Name:(renders:3)
                      Family Name:(renders:3)
                      +

                      Naive Context

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      Split Context

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with React.memo

                      First Name:(renders:3)
                      Family Name:(renders:3)

                      Context with useMemo

                      First Name:(renders:4)
                      Family Name:(renders:4)

                      react-tracked

                      First Name:(renders:3)
                      Family Name:(renders:3)
                      + " diff --git a/tests/e2e/__snapshots__/09_reactmemo.ts.snap b/tests/e2e/__snapshots__/09_reactmemo.ts.snap index ceeb9bbd..d98808bb 100644 --- a/tests/e2e/__snapshots__/09_reactmemo.ts.snap +++ b/tests/e2e/__snapshots__/09_reactmemo.ts.snap @@ -2,7 +2,8 @@ exports[`09_reactmemo > should work with recorded events 1`] = ` " -
                      • numRendered: 8Wash dishes
                      • numRendered: 4Study JS
                      • numRendered: 6Buy ticket
                      +
                      • numRendered: 8Wash dishes
                      • numRendered: 4Study JS
                      • numRendered: 6Buy ticket
                      + " @@ -10,7 +11,8 @@ exports[`09_reactmemo > should work with recorded events 1`] = ` exports[`09_reactmemo > should work with recorded events 2`] = ` " -
                      • numRendered: 8Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 6Buy ticket
                      +
                      • numRendered: 8Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 6Buy ticket
                      + " @@ -18,7 +20,8 @@ exports[`09_reactmemo > should work with recorded events 2`] = ` exports[`09_reactmemo > should work with recorded events 3`] = ` " -
                      • numRendered: 8Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 12Buy ticket
                      +
                      • numRendered: 8Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 12Buy ticket
                      + " @@ -26,7 +29,8 @@ exports[`09_reactmemo > should work with recorded events 3`] = ` exports[`09_reactmemo > should work with recorded events 4`] = ` " -
                      • numRendered: 14Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 12Buy ticket
                      +
                      • numRendered: 14Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 12Buy ticket
                      + " @@ -34,7 +38,8 @@ exports[`09_reactmemo > should work with recorded events 4`] = ` exports[`09_reactmemo > should work with recorded events 5`] = ` " -
                      • numRendered: 14Wash dishes
                      • numRendered: 16Study JS
                      • numRendered: 12Buy ticket
                      +
                      • numRendered: 14Wash dishes
                      • numRendered: 16Study JS
                      • numRendered: 12Buy ticket
                      + " @@ -42,7 +47,8 @@ exports[`09_reactmemo > should work with recorded events 5`] = ` exports[`09_reactmemo > should work with recorded events 6`] = ` " -
                      • numRendered: 14Wash dishes
                      • numRendered: 16Study JS
                      • numRendered: 18Buy ticket
                      +
                      • numRendered: 14Wash dishes
                      • numRendered: 16Study JS
                      • numRendered: 18Buy ticket
                      + " diff --git a/tests/e2e/__snapshots__/10_untracked.ts.snap b/tests/e2e/__snapshots__/10_untracked.ts.snap index 0e5073aa..62383f20 100644 --- a/tests/e2e/__snapshots__/10_untracked.ts.snap +++ b/tests/e2e/__snapshots__/10_untracked.ts.snap @@ -2,7 +2,8 @@ exports[`10_untracked > should work with recorded events 1`] = ` " -
                      +
                      + " @@ -10,7 +11,8 @@ exports[`10_untracked > should work with recorded events 1`] = ` exports[`10_untracked > should work with recorded events 2`] = ` " -
                      +
                      + " @@ -18,7 +20,8 @@ exports[`10_untracked > should work with recorded events 2`] = ` exports[`10_untracked > should work with recorded events 3`] = ` " -
                      +
                      + " @@ -26,7 +29,8 @@ exports[`10_untracked > should work with recorded events 3`] = ` exports[`10_untracked > should work with recorded events 4`] = ` " -
                      +
                      + " @@ -34,7 +38,8 @@ exports[`10_untracked > should work with recorded events 4`] = ` exports[`10_untracked > should work with recorded events 5`] = ` " -
                      +
                      + " @@ -42,7 +47,8 @@ exports[`10_untracked > should work with recorded events 5`] = ` exports[`10_untracked > should work with recorded events 6`] = ` " -
                      +
                      + " @@ -50,7 +56,8 @@ exports[`10_untracked > should work with recorded events 6`] = ` exports[`10_untracked > should work with recorded events 7`] = ` " -
                      +
                      + " @@ -58,7 +65,8 @@ exports[`10_untracked > should work with recorded events 7`] = ` exports[`10_untracked > should work with recorded events 8`] = ` " -
                      +
                      + " @@ -66,7 +74,8 @@ exports[`10_untracked > should work with recorded events 8`] = ` exports[`10_untracked > should work with recorded events 9`] = ` " -
                      +
                      + " @@ -74,7 +83,8 @@ exports[`10_untracked > should work with recorded events 9`] = ` exports[`10_untracked > should work with recorded events 10`] = ` " -
                      +
                      + " @@ -82,7 +92,8 @@ exports[`10_untracked > should work with recorded events 10`] = ` exports[`10_untracked > should work with recorded events 11`] = ` " -
                      +
                      + " diff --git a/tests/e2e/__snapshots__/11_form.ts.snap b/tests/e2e/__snapshots__/11_form.ts.snap index aabe61b9..dc342aee 100644 --- a/tests/e2e/__snapshots__/11_form.ts.snap +++ b/tests/e2e/__snapshots__/11_form.ts.snap @@ -2,7 +2,8 @@ exports[`11_form > should work with recorded events 1`] = ` " -
                      numRendered: 42

                      First Name

                      numRendered: 44
                      First Name:name is required

                      Family Name

                      numRendered: 46
                      Family Name:name is required

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 42

                      First Name

                      numRendered: 44
                      First Name:name is required

                      Family Name

                      numRendered: 46
                      Family Name:name is required

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -10,7 +11,8 @@ exports[`11_form > should work with recorded events 1`] = ` exports[`11_form > should work with recorded events 2`] = ` " -
                      numRendered: 62

                      First Name

                      numRendered: 64
                      First Name:

                      Family Name

                      numRendered: 46
                      Family Name:name is required

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 62

                      First Name

                      numRendered: 64
                      First Name:

                      Family Name

                      numRendered: 46
                      Family Name:name is required

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -18,7 +20,8 @@ exports[`11_form > should work with recorded events 2`] = ` exports[`11_form > should work with recorded events 3`] = ` " -
                      numRendered: 82

                      First Name

                      numRendered: 84
                      First Name:

                      Family Name

                      numRendered: 46
                      Family Name:name is required

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 82

                      First Name

                      numRendered: 84
                      First Name:

                      Family Name

                      numRendered: 46
                      Family Name:name is required

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -26,7 +29,8 @@ exports[`11_form > should work with recorded events 3`] = ` exports[`11_form > should work with recorded events 4`] = ` " -
                      numRendered: 102

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 46
                      Family Name:name is required

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 102

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 46
                      Family Name:name is required

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -34,7 +38,8 @@ exports[`11_form > should work with recorded events 4`] = ` exports[`11_form > should work with recorded events 5`] = ` " -
                      numRendered: 122

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 126
                      Family Name:

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 122

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 126
                      Family Name:

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -42,7 +47,8 @@ exports[`11_form > should work with recorded events 5`] = ` exports[`11_form > should work with recorded events 6`] = ` " -
                      numRendered: 142

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 146
                      Family Name:

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 142

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 146
                      Family Name:

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -50,7 +56,8 @@ exports[`11_form > should work with recorded events 6`] = ` exports[`11_form > should work with recorded events 7`] = ` " -
                      numRendered: 162

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 162

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -58,7 +65,8 @@ exports[`11_form > should work with recorded events 7`] = ` exports[`11_form > should work with recorded events 8`] = ` " -
                      numRendered: 162

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 162

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 38
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -66,7 +74,8 @@ exports[`11_form > should work with recorded events 8`] = ` exports[`11_form > should work with recorded events 9`] = ` " -
                      numRendered: 182

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 188
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      +
                      numRendered: 182

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 188
                      Gender:

                      Teenager

                      numRendered: 40
                      Teenager:
                      + " @@ -74,7 +83,8 @@ exports[`11_form > should work with recorded events 9`] = ` exports[`11_form > should work with recorded events 10`] = ` " -
                      numRendered: 202

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 188
                      Gender:

                      Teenager

                      numRendered: 210
                      Teenager:
                      +
                      numRendered: 202

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 188
                      Gender:

                      Teenager

                      numRendered: 210
                      Teenager:
                      + " @@ -82,7 +92,8 @@ exports[`11_form > should work with recorded events 10`] = ` exports[`11_form > should work with recorded events 11`] = ` " -
                      numRendered: 202

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 188
                      Gender:

                      Teenager

                      numRendered: 210
                      Teenager:
                      +
                      numRendered: 202

                      First Name

                      numRendered: 104
                      First Name:

                      Family Name

                      numRendered: 166
                      Family Name:

                      Gender

                      numRendered: 188
                      Gender:

                      Teenager

                      numRendered: 210
                      Teenager:
                      + " diff --git a/tests/e2e/__snapshots__/12_async.ts.snap b/tests/e2e/__snapshots__/12_async.ts.snap index 12b47e1a..4a8c4712 100644 --- a/tests/e2e/__snapshots__/12_async.ts.snap +++ b/tests/e2e/__snapshots__/12_async.ts.snap @@ -2,7 +2,8 @@ exports[`12_async > should work with recorded events 1`] = ` " -

                      Person

                      User ID:
                      connecting...

                      Counter

                      Count: 0
                      +

                      Person

                      User ID:
                      connecting...

                      Counter

                      Count: 0
                      + " @@ -10,7 +11,8 @@ exports[`12_async > should work with recorded events 1`] = ` exports[`12_async > should work with recorded events 2`] = ` " -

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 0
                      +

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 0
                      + " @@ -18,7 +20,8 @@ exports[`12_async > should work with recorded events 2`] = ` exports[`12_async > should work with recorded events 3`] = ` " -

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 1
                      +

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 1
                      + " @@ -26,7 +29,8 @@ exports[`12_async > should work with recorded events 3`] = ` exports[`12_async > should work with recorded events 4`] = ` " -

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 1
                      +

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 1
                      + " @@ -34,7 +38,8 @@ exports[`12_async > should work with recorded events 4`] = ` exports[`12_async > should work with recorded events 5`] = ` " -

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 0
                      +

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 0
                      + " diff --git a/tests/e2e/__snapshots__/13_saga.ts.snap b/tests/e2e/__snapshots__/13_saga.ts.snap index 50f62cc9..ddee78b0 100644 --- a/tests/e2e/__snapshots__/13_saga.ts.snap +++ b/tests/e2e/__snapshots__/13_saga.ts.snap @@ -2,7 +2,8 @@ exports[`13_saga > should work with recorded events 1`] = ` " -

                      Person

                      User ID:
                      connecting...

                      Counter

                      Count: 0
                      +

                      Person

                      User ID:
                      connecting...

                      Counter

                      Count: 0
                      + " @@ -10,7 +11,8 @@ exports[`13_saga > should work with recorded events 1`] = ` exports[`13_saga > should work with recorded events 2`] = ` " -

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 0
                      +

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 0
                      + " @@ -18,7 +20,8 @@ exports[`13_saga > should work with recorded events 2`] = ` exports[`13_saga > should work with recorded events 3`] = ` " -

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 1
                      +

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 1
                      + " @@ -26,7 +29,8 @@ exports[`13_saga > should work with recorded events 3`] = ` exports[`13_saga > should work with recorded events 4`] = ` " -

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 1
                      +

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 1
                      + " @@ -34,7 +38,8 @@ exports[`13_saga > should work with recorded events 4`] = ` exports[`13_saga > should work with recorded events 5`] = ` " -

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 0
                      +

                      Person

                      User ID:
                      First Name: Emma

                      Counter

                      Count: 0
                      + " diff --git a/tests/e2e/__snapshots__/14_dynamic.ts.snap b/tests/e2e/__snapshots__/14_dynamic.ts.snap index 8473ae3e..2f4c3751 100644 --- a/tests/e2e/__snapshots__/14_dynamic.ts.snap +++ b/tests/e2e/__snapshots__/14_dynamic.ts.snap @@ -2,7 +2,8 @@ exports[`14_dynamic > should work with recorded events 1`] = ` " -

                      Counter

                      numRendered: 18
                      Count: 1
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 18
                      Count: 1
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      + " @@ -10,7 +11,8 @@ exports[`14_dynamic > should work with recorded events 1`] = ` exports[`14_dynamic > should work with recorded events 2`] = ` " -

                      Counter

                      numRendered: 18
                      Count: 1
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 18
                      Count: 1
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      + " @@ -18,7 +20,8 @@ exports[`14_dynamic > should work with recorded events 2`] = ` exports[`14_dynamic > should work with recorded events 3`] = ` " -

                      Counter

                      numRendered: 22
                      Count: 0
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 22
                      Count: 0
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      + " @@ -26,7 +29,8 @@ exports[`14_dynamic > should work with recorded events 3`] = ` exports[`14_dynamic > should work with recorded events 4`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      + " @@ -34,7 +38,8 @@ exports[`14_dynamic > should work with recorded events 4`] = ` exports[`14_dynamic > should work with recorded events 5`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 20
                      Count: 1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      + " @@ -42,7 +47,8 @@ exports[`14_dynamic > should work with recorded events 5`] = ` exports[`14_dynamic > should work with recorded events 6`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      + " @@ -50,7 +56,8 @@ exports[`14_dynamic > should work with recorded events 6`] = ` exports[`14_dynamic > should work with recorded events 7`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 2
                      First Name:
                      Age:
                      numRendered: 4
                      First Name:
                      Age:
                      + " @@ -58,7 +65,8 @@ exports[`14_dynamic > should work with recorded events 7`] = ` exports[`14_dynamic > should work with recorded events 8`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 34
                      First Name:
                      Age:
                      numRendered: 36
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 34
                      First Name:
                      Age:
                      numRendered: 36
                      First Name:
                      Age:
                      + " @@ -66,7 +74,8 @@ exports[`14_dynamic > should work with recorded events 8`] = ` exports[`14_dynamic > should work with recorded events 9`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 38
                      Last Name:
                      Age:
                      numRendered: 36
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 38
                      Last Name:
                      Age:
                      numRendered: 36
                      First Name:
                      Age:
                      + " @@ -74,7 +83,8 @@ exports[`14_dynamic > should work with recorded events 9`] = ` exports[`14_dynamic > should work with recorded events 10`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 38
                      Last Name:
                      Age:
                      numRendered: 36
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 38
                      Last Name:
                      Age:
                      numRendered: 36
                      First Name:
                      Age:
                      + " @@ -82,7 +92,8 @@ exports[`14_dynamic > should work with recorded events 10`] = ` exports[`14_dynamic > should work with recorded events 11`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 44
                      Last Name:
                      Age:
                      numRendered: 36
                      First Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 44
                      Last Name:
                      Age:
                      numRendered: 36
                      First Name:
                      Age:
                      + " @@ -90,7 +101,8 @@ exports[`14_dynamic > should work with recorded events 11`] = ` exports[`14_dynamic > should work with recorded events 12`] = ` " -

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 44
                      Last Name:
                      Age:
                      numRendered: 49
                      Last Name:
                      Age:
                      +

                      Counter

                      numRendered: 28
                      Count: -1
                      numRendered: 33
                      Count: -1

                      Person

                      numRendered: 44
                      Last Name:
                      Age:
                      numRendered: 49
                      Last Name:
                      Age:
                      + " diff --git a/tests/e2e/__snapshots__/15_reactmemoref.ts.snap b/tests/e2e/__snapshots__/15_reactmemoref.ts.snap index 698f9458..01ff2233 100644 --- a/tests/e2e/__snapshots__/15_reactmemoref.ts.snap +++ b/tests/e2e/__snapshots__/15_reactmemoref.ts.snap @@ -2,7 +2,8 @@ exports[`15_reactmemoref > should work with recorded events 1`] = ` " -
                      • numRendered: 8Wash dishes
                      • numRendered: 4Study JS
                      • numRendered: 6Buy ticket
                      +
                      • numRendered: 8Wash dishes
                      • numRendered: 4Study JS
                      • numRendered: 6Buy ticket
                      + " @@ -10,7 +11,8 @@ exports[`15_reactmemoref > should work with recorded events 1`] = ` exports[`15_reactmemoref > should work with recorded events 2`] = ` " -
                      • numRendered: 8Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 6Buy ticket
                      +
                      • numRendered: 8Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 6Buy ticket
                      + " @@ -18,7 +20,8 @@ exports[`15_reactmemoref > should work with recorded events 2`] = ` exports[`15_reactmemoref > should work with recorded events 3`] = ` " -
                      • numRendered: 8Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 12Buy ticket
                      +
                      • numRendered: 8Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 12Buy ticket
                      + " @@ -26,7 +29,8 @@ exports[`15_reactmemoref > should work with recorded events 3`] = ` exports[`15_reactmemoref > should work with recorded events 4`] = ` " -
                      • numRendered: 14Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 12Buy ticket
                      +
                      • numRendered: 14Wash dishes
                      • numRendered: 10Study JS
                      • numRendered: 12Buy ticket
                      + " @@ -34,7 +38,8 @@ exports[`15_reactmemoref > should work with recorded events 4`] = ` exports[`15_reactmemoref > should work with recorded events 5`] = ` " -
                      • numRendered: 14Wash dishes
                      • numRendered: 16Study JS
                      • numRendered: 12Buy ticket
                      +
                      • numRendered: 14Wash dishes
                      • numRendered: 16Study JS
                      • numRendered: 12Buy ticket
                      + " @@ -42,7 +47,8 @@ exports[`15_reactmemoref > should work with recorded events 5`] = ` exports[`15_reactmemoref > should work with recorded events 6`] = ` " -
                      • numRendered: 14Wash dishes
                      • numRendered: 16Study JS
                      • numRendered: 18Buy ticket
                      +
                      • numRendered: 14Wash dishes
                      • numRendered: 16Study JS
                      • numRendered: 18Buy ticket
                      + " diff --git a/tsconfig.json b/tsconfig.json index f53340da..ba300e68 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "strict": true, "target": "es2018", - "downlevelIteration": true, "esModuleInterop": true, "module": "nodenext", "skipLibCheck": true, diff --git a/vite.config.ts b/vite.config.ts index cd2345a1..ee0afaca 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,7 @@ /// import { resolve } from 'node:path'; -import { readFileSync } from 'node:fs'; import { defineConfig } from 'vite'; -import type { Plugin } from 'vite'; const { DIR, PORT = '8080' } = process.env; @@ -24,42 +22,5 @@ export default defineConfig(({ mode }) => { root: resolve('examples', DIR), server: { port: Number(PORT) }, resolve: { alias: { 'react-tracked': resolve('src') } }, - plugins: [indexHtml(resolve('examples', DIR, 'public', 'index.html'))], }; }); - -function indexHtml(file: string): Plugin { - const html = readFileSync(file, 'utf8'); - return { - name: 'index-html-plugin', - configureServer(server) { - return () => { - server.middlewares.use((req, res) => { - server - .transformIndexHtml(req.url || '', html) - .then((content) => { - res.statusCode = 200; - res.setHeader('content-type', 'text/html; charset=utf-8'); - res.end(content); - }) - .catch((err) => { - console.error('Error transforming index.html', err); - res.statusCode = 500; - res.end('Internal Server Error'); - }); - }); - }; - }, - config() { - return { optimizeDeps: { entries: ['src/index'] } }; - }, - transformIndexHtml() { - return [ - { - tag: 'script', - attrs: { type: 'module', src: '/src/index' }, - }, - ]; - }, - }; -}