@avgz/react-contract-renderer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,233 @@
1
+ # React Contract Renderer
2
+
3
+ Test the contracts between React components with typed assertions. Check which children a component renders and which props it passes to them. Use shallow rendering to run these checks without a DOM renderer.
4
+
5
+ ## Why does this library exist?
6
+
7
+ Mostly because I disagree with React Testing Library's approach. Testing how users use an application is a good goal. I prefer browser tests with Playwright or Cypress for that job.
8
+
9
+ RTL treats props and effects as implementation details that tests should avoid. As an application grows, those details become contracts between components and I want tests for those contracts.
10
+
11
+ > "The ability to improve a design occurs primarily at the interfaces. This is also the prime location for screwing it up."
12
+
13
+ — Akin's law #15
14
+
15
+ ### DOM assertions can still couple a test to composition
16
+
17
+ React Testing Library (RTL) lets you find elements by role and accessible name and these queries help you check accessibility. A test that renders `App` can also depend on several layers of components just to effectively check a prop passed between two of them.
18
+
19
+ For example, `App` passes a session to `AppLayout`. The layout passes it to `Header`, which sets the label for `UserMenu`:
20
+
21
+ > [!NOTE]
22
+ > This might also be context or something like redux state but the idea is that a top level component passes down to a child.
23
+
24
+ ```tsx
25
+ function App() {
26
+ const session = useSession();
27
+ return <AppLayout session={session} />;
28
+ }
29
+
30
+ function AppLayout({ session }: { session: Session | null }) {
31
+ return <Header session={session} />;
32
+ }
33
+
34
+ function Header({ session }: { session: Session | null }) {
35
+ return (
36
+ <UserMenu
37
+ aria-label={session?.isAdmin ? "Logged in as admin" : "Not logged in"}
38
+ />
39
+ );
40
+ }
41
+ ```
42
+
43
+ An RTL test might render the whole app and find the button by role and name:
44
+
45
+ ```tsx
46
+ render(<App />);
47
+
48
+ expect(
49
+ screen.getByRole("button", { name: "Logged in as admin" }),
50
+ ).toBeInTheDocument();
51
+ ```
52
+
53
+ This assertion depends on the rendered button and its name. The test runs through `App`, `AppLayout`, `Header`, and `UserMenu` and a failure could start anywhere along that chain. Replacing the button with a link would also break the test, even if the administrator can still see that they are signed in.
54
+
55
+ > [!NOTE]
56
+ > Rendering the whole tree can also require providers, mock stores, and other setup. That is a lot of furniture to move just to check one prop.
57
+
58
+ The same issue occurs when a test renders a large tree to infer session state from labels:
59
+
60
+ ```tsx
61
+ render(<App />);
62
+
63
+ expect(screen.queryByLabelText("Not logged in")).not.toBeInTheDocument();
64
+ expect(screen.getByLabelText("Logged in as admin")).toBeInTheDocument();
65
+ ```
66
+
67
+ Choose the test based on the behavior you want to check:
68
+
69
+ - Use a browser test to check that an administrator can tell they are signed in.
70
+ - Use a focused RTL test to check the menu's role and accessible name.
71
+ - Use component-contract tests to check how `App`, `AppLayout`, `Header`, and `UserMenu` pass session data and derive the label.
72
+
73
+ ### Test each interface and then the leaf's DOM contract
74
+
75
+ Split the checks by component. This can work well if you use a Connected & Presentational pattern. Each shallow test runs the component under test and inspects the props it gives its children. You can test that a Connected component maps or passes along data without having to worry about the internals of the Presentational bits.
76
+
77
+ ```tsx
78
+ const admin = { isAdmin: true } as Session;
79
+
80
+ test("AppLayout passes the session to Header", () => {
81
+ const { subject } = getComponentRenderer(AppLayout, {
82
+ session: admin,
83
+ }).shallow();
84
+
85
+ expect(subject.find(Header).prop("session")).toBe(admin);
86
+ });
87
+
88
+ test("Header gives UserMenu the administrator label", () => {
89
+ const { subject } = getComponentRenderer(Header, {
90
+ session: admin,
91
+ }).shallow();
92
+
93
+ expect(subject.find(UserMenu).prop("aria-label")).toBe("Logged in as admin");
94
+ });
95
+
96
+ test("UserMenu exposes its label on a button", () => {
97
+ const { subject } = getComponentRenderer(UserMenu, {
98
+ "aria-label": "Logged in as admin",
99
+ }).mount();
100
+ const button = subject.find("button").getDOMNode();
101
+
102
+ // A native button supplies the accessible role "button".
103
+ expect(button.tagName).toBe("BUTTON");
104
+ expect(button.getAttribute("aria-label")).toBe("Logged in as admin");
105
+ });
106
+ ```
107
+
108
+ ## Install
109
+
110
+ ```sh
111
+ pnpm add -D @avgz/react-contract-renderer
112
+ ```
113
+
114
+ React and React DOM are peer dependencies. The package supports matching stable versions of React 17.0.2, React 18.2–18.3, and React 19.0–19.3. Node.js 22 or newer is required.
115
+
116
+ ## Quick start
117
+
118
+ ```ts
119
+ import { afterEach, expect, test } from "vitest";
120
+ import { cleanup, getComponentRenderer } from "@avgz/react-contract-renderer";
121
+
122
+ afterEach(cleanup);
123
+
124
+ const renderer = getComponentRenderer(AccountPage, { accountId: "default" });
125
+
126
+ test("passes the active account to its panel", () => {
127
+ const { subject } = renderer.shallow({ accountId: "active" });
128
+
129
+ expect(subject.find(AccountPanel).prop("accountId")).toBe("active");
130
+ });
131
+ ```
132
+
133
+ `find(AccountPanel)` infers `AccountPanel`'s props, so TypeScript checks both the prop name and the asserted value.
134
+
135
+ Use `mount()` to check DOM output:
136
+
137
+ ```ts
138
+ const session = getComponentRenderer(SaveButton, { label: "Save" }).mount();
139
+
140
+ expect(session.subject.find("button").getDOMNode().textContent).toBe("Save");
141
+ ```
142
+
143
+ ## Rendering modes
144
+
145
+ | Mode | Use it for | What runs |
146
+ | ----------- | ------------------------------------------- | ---------------------------------------------------- |
147
+ | `shallow()` | Child components and the props they receive | The target runs. Custom child components do not run. |
148
+ | `mount()` | DOM output, refs, and host behavior | The component tree renders into a DOM container. |
149
+
150
+ Both modes wait until you access `subject` to start rendering. This lets you add providers first:
151
+
152
+ ```tsx
153
+ const session = renderer.shallow().with(OuterProvider, InnerProvider);
154
+
155
+ expect(session.subject.find(AccountPanel).exists()).toBe(true);
156
+ ```
157
+
158
+ Providers nest in argument order; the first provider is outermost. `mount()` requires a DOM environment such as Vitest's `jsdom` environment.
159
+
160
+ Register `cleanup` with your test runner's `afterEach` to unmount all sessions after each test.
161
+
162
+ ## API at a glance
163
+
164
+ ```ts
165
+ const session = getComponentRenderer(Component, defaultProps).shallow(
166
+ overrides,
167
+ );
168
+
169
+ session.with(Provider);
170
+ session.subject.find(Child).prop("value");
171
+ session.subject.findAll("li");
172
+ session.rerender(partialProps);
173
+ await session.act(async () => {
174
+ await request;
175
+ });
176
+ session.flush();
177
+ session.unmount();
178
+ ```
179
+
180
+ A `Subject` is live: an existing selection reads the latest committed render after state changes or `rerender()`. Available inspections are `find`, `findAll`, `exists`, `props`, `prop`, `className`, `type`, `element`, `text`, and, after `mount()`, `getDOMNode`.
181
+
182
+ ## Why choose it over React Testing Library?
183
+
184
+ [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/) is a good choice for testing individual UI components. Use it to check roles, text, form input, and focus.
185
+
186
+ Use React Contract Renderer when you need to:
187
+
188
+ - Check that a parent renders a specific child with the expected, type-checked props.
189
+ - Run a component's own hooks and effects during a shallow test.
190
+ - Query components in both shallow and mounted tests with the same `Subject` API.
191
+
192
+ Both libraries can earn a place in the same test suite. Use RTL for user-facing behavior and accessibility checks. Use React Contract Renderer for component relationships and props that your application relies on.
193
+
194
+ ## How is it different from Enzyme?
195
+
196
+ Enzyme established the useful idea of shallow-rendering a component as a unit and inspecting its children. React Contract Renderer keeps that narrow capability instead of recreating Enzyme's wrapper API.
197
+
198
+ Queries use component identities or intrinsic tag names rather than CSS selectors. Props are inferred by TypeScript rather than exposed through untyped string keys. Hooks and effects run in shallow tests on supported React versions.
199
+
200
+ There are no component-instance, state-mutation, selector-language, or simulated-event APIs. This is not a drop-in Enzyme replacement.
201
+
202
+ ## Benchmarks
203
+
204
+ The included benchmark compares complete render-and-cleanup operations with `@testing-library/react/pure`. Each fixture gets 60 warm-ups and reports the median of 11 rounds. The three small fixtures run 1,000 operations per round. The application fixture runs 25 because each full render commits thousands of DOM nodes. The benchmark checks each renderer's output before timing it.
205
+
206
+ The application fixture is modeled on a large strategy game's board: a 20×24 map with three layers, 1,440 material tiles, units, mechanisms, environmental effects, fog of war, placed items, portraits, navigation, an action bar, a message log, an inventory dialog, and a combat forecast.
207
+
208
+ One local run on an Apple M4 Pro with Node 24.11.1, React 19.3.0, and jsdom 26.1.0 produced:
209
+
210
+ | Fixture | Shallow | Mount | React Testing Library | Shallow vs. RTL | Mount vs. RTL |
211
+ | -------------------- | -------: | --------: | --------------------: | --------------: | ------------: |
212
+ | Leaf component | 0.017 ms | 0.049 ms | 0.070 ms | 4.1× faster | 30% faster |
213
+ | Effect-driven update | 0.024 ms | 0.057 ms | 0.082 ms | 3.4× faster | 30% faster |
214
+ | 24-child tree | 0.033 ms | 0.222 ms | 0.242 ms | 7.3× faster | 8% faster |
215
+ | Strategy game board | 0.112 ms | 42.717 ms | 42.385 ms | 377× faster | 0.8% slower |
216
+
217
+ On the application fixture, shallow rendering runs `GameBoard` and records its immediate component contracts without rendering the thousands of descendant nodes. Mount and RTL both render the complete tree and finish within 1% of each other. The benchmark requires shallow to remain faster than RTL and allows mount a 10% margin around RTL for timing noise.
218
+
219
+ Run it on your hardware:
220
+
221
+ ```sh
222
+ pnpm install --frozen-lockfile
223
+ pnpm build
224
+ pnpm benchmark
225
+ ```
226
+
227
+ See [`scripts/benchmark.mjs`](scripts/benchmark.mjs) for the measurement method and [`scripts/benchmark-fixtures/strategy-game.mjs`](scripts/benchmark-fixtures/strategy-game.mjs) for the application fixture.
228
+
229
+ ## Scope and tradeoffs
230
+
231
+ Use this library when component composition is a contract you deliberately want to maintain. Do not use it to prove accessibility, styling, layout, real browser behavior, or an end-to-end user flow.
232
+
233
+ Shallow rendering couples a test to component boundaries. That coupling is the feature, but it should be intentional: test stable application interfaces, not every wrapper or incidental implementation detail.
@@ -0,0 +1,334 @@
1
+ object-assign@4.1.1
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
23
+
24
+
25
+ -----
26
+
27
+ react-reconciler@0.26.2
28
+ MIT License
29
+
30
+ Copyright (c) Facebook, Inc. and its affiliates.
31
+
32
+ Permission is hereby granted, free of charge, to any person obtaining a copy
33
+ of this software and associated documentation files (the "Software"), to deal
34
+ in the Software without restriction, including without limitation the rights
35
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
36
+ copies of the Software, and to permit persons to whom the Software is
37
+ furnished to do so, subject to the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be included in all
40
+ copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
43
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
44
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
45
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
46
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
47
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
+ SOFTWARE.
49
+
50
+
51
+ -----
52
+
53
+ react-reconciler@0.29.0
54
+ MIT License
55
+
56
+ Copyright (c) Facebook, Inc. and its affiliates.
57
+
58
+ Permission is hereby granted, free of charge, to any person obtaining a copy
59
+ of this software and associated documentation files (the "Software"), to deal
60
+ in the Software without restriction, including without limitation the rights
61
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
62
+ copies of the Software, and to permit persons to whom the Software is
63
+ furnished to do so, subject to the following conditions:
64
+
65
+ The above copyright notice and this permission notice shall be included in all
66
+ copies or substantial portions of the Software.
67
+
68
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
73
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
74
+ SOFTWARE.
75
+
76
+
77
+ -----
78
+
79
+ react-reconciler@0.31.0
80
+ MIT License
81
+
82
+ Copyright (c) Meta Platforms, Inc. and affiliates.
83
+
84
+ Permission is hereby granted, free of charge, to any person obtaining a copy
85
+ of this software and associated documentation files (the "Software"), to deal
86
+ in the Software without restriction, including without limitation the rights
87
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
88
+ copies of the Software, and to permit persons to whom the Software is
89
+ furnished to do so, subject to the following conditions:
90
+
91
+ The above copyright notice and this permission notice shall be included in all
92
+ copies or substantial portions of the Software.
93
+
94
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
95
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
96
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
97
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
98
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
99
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
100
+ SOFTWARE.
101
+
102
+
103
+ -----
104
+
105
+ react-reconciler@0.32.0
106
+ MIT License
107
+
108
+ Copyright (c) Meta Platforms, Inc. and affiliates.
109
+
110
+ Permission is hereby granted, free of charge, to any person obtaining a copy
111
+ of this software and associated documentation files (the "Software"), to deal
112
+ in the Software without restriction, including without limitation the rights
113
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
114
+ copies of the Software, and to permit persons to whom the Software is
115
+ furnished to do so, subject to the following conditions:
116
+
117
+ The above copyright notice and this permission notice shall be included in all
118
+ copies or substantial portions of the Software.
119
+
120
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
121
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
122
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
123
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
124
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
125
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
126
+ SOFTWARE.
127
+
128
+
129
+ -----
130
+
131
+ react-reconciler@0.33.0
132
+ MIT License
133
+
134
+ Copyright (c) Meta Platforms, Inc. and affiliates.
135
+
136
+ Permission is hereby granted, free of charge, to any person obtaining a copy
137
+ of this software and associated documentation files (the "Software"), to deal
138
+ in the Software without restriction, including without limitation the rights
139
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
140
+ copies of the Software, and to permit persons to whom the Software is
141
+ furnished to do so, subject to the following conditions:
142
+
143
+ The above copyright notice and this permission notice shall be included in all
144
+ copies or substantial portions of the Software.
145
+
146
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
148
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
149
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
150
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
151
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
152
+ SOFTWARE.
153
+
154
+
155
+ -----
156
+
157
+ react-reconciler@0.34.0
158
+ MIT License
159
+
160
+ Copyright (c) Meta Platforms, Inc. and affiliates.
161
+
162
+ Permission is hereby granted, free of charge, to any person obtaining a copy
163
+ of this software and associated documentation files (the "Software"), to deal
164
+ in the Software without restriction, including without limitation the rights
165
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
166
+ copies of the Software, and to permit persons to whom the Software is
167
+ furnished to do so, subject to the following conditions:
168
+
169
+ The above copyright notice and this permission notice shall be included in all
170
+ copies or substantial portions of the Software.
171
+
172
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
173
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
174
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
175
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
176
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
177
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
178
+ SOFTWARE.
179
+
180
+
181
+ -----
182
+
183
+ scheduler@0.20.2
184
+ MIT License
185
+
186
+ Copyright (c) Facebook, Inc. and its affiliates.
187
+
188
+ Permission is hereby granted, free of charge, to any person obtaining a copy
189
+ of this software and associated documentation files (the "Software"), to deal
190
+ in the Software without restriction, including without limitation the rights
191
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
192
+ copies of the Software, and to permit persons to whom the Software is
193
+ furnished to do so, subject to the following conditions:
194
+
195
+ The above copyright notice and this permission notice shall be included in all
196
+ copies or substantial portions of the Software.
197
+
198
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
199
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
200
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
201
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
202
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
203
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
204
+ SOFTWARE.
205
+
206
+
207
+ -----
208
+
209
+ scheduler@0.23.2
210
+ MIT License
211
+
212
+ Copyright (c) Facebook, Inc. and its affiliates.
213
+
214
+ Permission is hereby granted, free of charge, to any person obtaining a copy
215
+ of this software and associated documentation files (the "Software"), to deal
216
+ in the Software without restriction, including without limitation the rights
217
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
218
+ copies of the Software, and to permit persons to whom the Software is
219
+ furnished to do so, subject to the following conditions:
220
+
221
+ The above copyright notice and this permission notice shall be included in all
222
+ copies or substantial portions of the Software.
223
+
224
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
225
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
226
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
227
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
228
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
229
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
230
+ SOFTWARE.
231
+
232
+
233
+ -----
234
+
235
+ scheduler@0.25.0
236
+ MIT License
237
+
238
+ Copyright (c) Meta Platforms, Inc. and affiliates.
239
+
240
+ Permission is hereby granted, free of charge, to any person obtaining a copy
241
+ of this software and associated documentation files (the "Software"), to deal
242
+ in the Software without restriction, including without limitation the rights
243
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
244
+ copies of the Software, and to permit persons to whom the Software is
245
+ furnished to do so, subject to the following conditions:
246
+
247
+ The above copyright notice and this permission notice shall be included in all
248
+ copies or substantial portions of the Software.
249
+
250
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
251
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
252
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
253
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
254
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
255
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
256
+ SOFTWARE.
257
+
258
+
259
+ -----
260
+
261
+ scheduler@0.26.0
262
+ MIT License
263
+
264
+ Copyright (c) Meta Platforms, Inc. and affiliates.
265
+
266
+ Permission is hereby granted, free of charge, to any person obtaining a copy
267
+ of this software and associated documentation files (the "Software"), to deal
268
+ in the Software without restriction, including without limitation the rights
269
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
270
+ copies of the Software, and to permit persons to whom the Software is
271
+ furnished to do so, subject to the following conditions:
272
+
273
+ The above copyright notice and this permission notice shall be included in all
274
+ copies or substantial portions of the Software.
275
+
276
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
277
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
278
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
279
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
280
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
281
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
282
+ SOFTWARE.
283
+
284
+
285
+ -----
286
+
287
+ scheduler@0.27.0
288
+ MIT License
289
+
290
+ Copyright (c) Meta Platforms, Inc. and affiliates.
291
+
292
+ Permission is hereby granted, free of charge, to any person obtaining a copy
293
+ of this software and associated documentation files (the "Software"), to deal
294
+ in the Software without restriction, including without limitation the rights
295
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
296
+ copies of the Software, and to permit persons to whom the Software is
297
+ furnished to do so, subject to the following conditions:
298
+
299
+ The above copyright notice and this permission notice shall be included in all
300
+ copies or substantial portions of the Software.
301
+
302
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
303
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
304
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
305
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
306
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
307
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
308
+ SOFTWARE.
309
+
310
+
311
+ -----
312
+
313
+ scheduler@0.28.0
314
+ MIT License
315
+
316
+ Copyright (c) Meta Platforms, Inc. and affiliates.
317
+
318
+ Permission is hereby granted, free of charge, to any person obtaining a copy
319
+ of this software and associated documentation files (the "Software"), to deal
320
+ in the Software without restriction, including without limitation the rights
321
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
322
+ copies of the Software, and to permit persons to whom the Software is
323
+ furnished to do so, subject to the following conditions:
324
+
325
+ The above copyright notice and this permission notice shall be included in all
326
+ copies or substantial portions of the Software.
327
+
328
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
329
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
330
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
331
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
332
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
333
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
334
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ import type { ElementType } from 'react';
2
+ import type { InspectionNode } from '../internal.cjs';
3
+ export type DOMReactVersion = 17 | 18 | 19;
4
+ export declare function selectDOMReactVersion(version: string): DOMReactVersion;
5
+ export declare function inspectDOMRoot(version: DOMReactVersion, container: Element, publicRoot: unknown, boundary: ElementType): InspectionNode | null;
@@ -0,0 +1,5 @@
1
+ import type { ElementType } from 'react';
2
+ import type { InspectionNode } from '../internal.js';
3
+ export type DOMReactVersion = 17 | 18 | 19;
4
+ export declare function selectDOMReactVersion(version: string): DOMReactVersion;
5
+ export declare function inspectDOMRoot(version: DOMReactVersion, container: Element, publicRoot: unknown, boundary: ElementType): InspectionNode | null;