cypress 16.2.0 → 16.3.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.
Files changed (53) hide show
  1. package/angular/dist/index.js +10 -12
  2. package/angular/package.json +7 -22
  3. package/dist/bin/cypress +8 -8
  4. package/dist/{cli-AgTnS5LO.js → cli-y9Bb9Y77.js} +215 -40
  5. package/dist/cli.js +6 -6
  6. package/dist/{cypress-CdDm9AVa.js → cypress-CvEs5adm.js} +2 -2
  7. package/dist/cypress.js +8 -8
  8. package/dist/exec/spawn.js +4 -4
  9. package/dist/exec/xvfb.js +7 -4
  10. package/dist/index.js +8 -8
  11. package/dist/{spawn-DElwyZHC.js → spawn-Bx99tBTm.js} +529 -69
  12. package/dist/{tap-WHD3nHJC.js → tap-BMFGLoCT.js} +108 -26
  13. package/dist/{xvfb-CbW2_YXR.js → xvfb-DxbcANVl.js} +238 -25
  14. package/mount-utils/dist/index.js +1 -1
  15. package/mount-utils/package.json +15 -14
  16. package/package.json +5 -5
  17. package/react/dist/cypress-react.cjs.js +9 -7
  18. package/react/dist/cypress-react.esm-bundler.js +9 -7
  19. package/react/package.json +26 -46
  20. package/svelte/dist/cypress-svelte.cjs.js +3 -2
  21. package/svelte/dist/cypress-svelte.esm-bundler.js +3 -2
  22. package/svelte/package.json +24 -22
  23. package/types/cy-bluebird.d.ts +1 -0
  24. package/types/cy-chai.d.ts +99 -2
  25. package/types/cypress.d.ts +216 -43
  26. package/types/net-stubbing.d.ts +1 -1
  27. package/vue/dist/cypress-vue.cjs.js +4 -2
  28. package/vue/dist/cypress-vue.esm-bundler.js +4 -2
  29. package/vue/dist/index.d.ts +3 -3
  30. package/vue/package.json +35 -42
  31. package/angular/angular/README.md +0 -18
  32. package/angular/angular/dist/index.d.ts +0 -120
  33. package/angular/angular/dist/index.js +0 -479
  34. package/angular/angular/package.json +0 -82
  35. package/mount-utils/mount-utils/README.md +0 -140
  36. package/mount-utils/mount-utils/dist/index.d.ts +0 -12
  37. package/mount-utils/mount-utils/dist/index.js +0 -41
  38. package/mount-utils/mount-utils/package.json +0 -52
  39. package/react/react/README.md +0 -19
  40. package/react/react/dist/cypress-react.cjs.js +0 -293
  41. package/react/react/dist/cypress-react.esm-bundler.js +0 -268
  42. package/react/react/dist/index.d.ts +0 -95
  43. package/react/react/package.json +0 -113
  44. package/svelte/svelte/README.md +0 -19
  45. package/svelte/svelte/dist/cypress-svelte.cjs.js +0 -122
  46. package/svelte/svelte/dist/cypress-svelte.esm-bundler.js +0 -120
  47. package/svelte/svelte/dist/index.d.ts +0 -31
  48. package/svelte/svelte/package.json +0 -63
  49. package/vue/vue/README.md +0 -14
  50. package/vue/vue/dist/cypress-vue.cjs.js +0 -8692
  51. package/vue/vue/dist/cypress-vue.esm-bundler.js +0 -8671
  52. package/vue/vue/dist/index.d.ts +0 -1413
  53. package/vue/vue/package.json +0 -97
@@ -1,140 +0,0 @@
1
- # @cypress/mount-utils
2
-
3
- > **Note** this package is not meant to be used outside of cypress component testing.
4
-
5
- This library exports some shared types and utility functions designed to build adapters for components frameworks.
6
-
7
- It is used in:
8
-
9
- - [`@cypress/react`](https://github.com/cypress-io/cypress/tree/develop/npm/react)
10
- - [`@cypress/vue`](https://github.com/cypress-io/cypress/tree/develop/npm/vue)
11
- - [`@cypress/svelte`](https://github.com/cypress-io/cypress/tree/develop/npm/svelte)
12
- - [`@cypress/angular`](https://github.com/cypress-io/cypress/tree/develop/npm/angular)
13
-
14
- ## What is a Mount Adapter?
15
-
16
- All Component Tests require a component to be **mounted**. This is generally done with a custom command, `cy.mount` by default.
17
-
18
-
19
- ### Requirements
20
-
21
- All the functionality used to create the first party Mount adapters is available to support third parties adapters. At minimum, a Mount Adapter must:
22
-
23
- - Receive a component as the first argument. This could be class, function etc - depends on the framework.
24
- - Return a Cypress Chainable (for example using `cy.wrap`) that resolves whatever is idiomatic for your framework
25
- - Call `getContainerEl` to access the root DOM element
26
-
27
- In addition, we recommend that Mount Adapters:
28
-
29
- - call `setupHooks` to register the required lifecycle hooks for `@cypress/mount-utils` to work
30
-
31
- ### Example Mount Adapter: Web Components
32
-
33
- Here's a simple yet realistic example of Mount Adapter targeting Web Components. It uses utilities from this package (`@cypress/mount-utils`) This is recommended, so your adapter behaves similar to the first party Mount Adapters.
34
-
35
- ```ts
36
- import {
37
- ROOT_SELECTOR,
38
- setupHooks,
39
- getContainerEl
40
- } from "@cypress/mount-utils";
41
-
42
- Cypress.on("run:start", () => {
43
- // Consider doing a check to ensure your adapter only runs in Component Testing mode.
44
- if (Cypress.testingType !== "component") {
45
- return;
46
- }
47
-
48
- Cypress.on("test:before:run", () => {
49
- // Do some cleanup from previous test - for example, clear the DOM.
50
- getContainerEl().innerHTML = "";
51
- });
52
- });
53
-
54
- function maybeRegisterComponent<T extends CustomElementConstructor>(
55
- name: string,
56
- webComponent: T
57
- ) {
58
- // Avoid double-registering a Web Component.
59
- if (window.customElements.get(name)) {
60
- return;
61
- }
62
-
63
- window.customElements.define(name, webComponent);
64
- }
65
-
66
- export function mount(
67
- webComponent: CustomElementConstructor
68
- ): Cypress.Chainable {
69
- // Get root selector defined in `cypress/support.component-index.html
70
- const $root = document.querySelector(ROOT_SELECTOR)!;
71
-
72
- // Change to kebab-case to comply with Web Component naming convention
73
- const name = webComponent.name
74
- .replace(/([a-z0–9])([A-Z])/g, "$1-$2")
75
- .toLowerCase();
76
-
77
- /// Register Web Component
78
- maybeRegisterComponent(name, webComponent);
79
-
80
- // Render HTML containing component.
81
- $root.innerHTML = `<${name} id="root"></${name}>`;
82
-
83
- // Log a messsage in the Command Log.
84
- Cypress.log({
85
- name: "mount",
86
- message: [`<${name} ... />`],
87
- });
88
-
89
- // Return a `Cypress.Chainable` that returns whatever is idiomatic
90
- // in the framework your mount adapter targets.
91
- return cy.wrap(document.querySelector("#root"), { log: false });
92
- }
93
-
94
- // Setup Cypress lifecycle hooks.
95
- setupHooks();
96
- ```
97
-
98
- Usage:
99
-
100
- ```ts
101
- // User will generally register a `cy.mount` command in `cypress/support/component.js`:
102
-
103
- import { mount } from '@package/cypress-web-components'
104
-
105
- Cypress.Commands.add('mount', mount)
106
-
107
- // Test
108
- export class WebCounter extends HTMLElement {
109
- constructor() {
110
- super();
111
- }
112
-
113
- connectedCallback() {
114
- this.innerHTML = `
115
- <div>
116
- <button>Counter</button>
117
- </div>`;
118
- }
119
- }
120
-
121
-
122
- describe('web-component.cy.ts', () => {
123
- it('playground', () => {
124
- cy.mount(WebCounter)
125
- })
126
- })
127
- ```
128
-
129
- For more robust, production ready examples, check out our first party adapters.
130
-
131
- ## Compatibility
132
-
133
- | @cypress/mount-utils | cypress |
134
- | -------------------- | ------- |
135
- | <= v1 | <= v9 |
136
- | >= v2 | >= v10 |
137
-
138
- ## Changelog
139
-
140
- [Changelog](./CHANGELOG.md)
@@ -1,12 +0,0 @@
1
- export declare const ROOT_SELECTOR = "[data-cy-root]";
2
- /**
3
- * Gets the root element used to mount the component.
4
- * @returns {HTMLElement} The root element
5
- * @throws {Error} If the root element is not found
6
- */
7
- export declare const getContainerEl: () => HTMLElement;
8
- /**
9
- * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
10
- * @param optionalCallback Callback to be called before the next test runs
11
- */
12
- export declare function setupHooks(optionalCallback?: Function): void;
@@ -1,41 +0,0 @@
1
- export const ROOT_SELECTOR = '[data-cy-root]';
2
- /**
3
- * Gets the root element used to mount the component.
4
- * @returns {HTMLElement} The root element
5
- * @throws {Error} If the root element is not found
6
- */
7
- export const getContainerEl = () => {
8
- const el = document.querySelector(ROOT_SELECTOR);
9
- if (el) {
10
- return el;
11
- }
12
- throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
13
- };
14
- /**
15
- * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
16
- * @param optionalCallback Callback to be called before the next test runs
17
- */
18
- export function setupHooks(optionalCallback) {
19
- // We don't want CT side effects to run when e2e
20
- // testing so we early return.
21
- // System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
22
- if (Cypress.testingType !== 'component') {
23
- return;
24
- }
25
- // When running component specs, we cannot allow "cy.visit"
26
- // because it will wipe out our preparation work, and does not make much sense
27
- // thus we overwrite "cy.visit" to throw an error
28
- Cypress.Commands.overwrite('visit', () => {
29
- throw new Error('cy.visit from a component spec is not allowed');
30
- });
31
- Cypress.Commands.overwrite('session', () => {
32
- throw new Error('cy.session from a component spec is not allowed');
33
- });
34
- Cypress.Commands.overwrite('origin', () => {
35
- throw new Error('cy.origin from a component spec is not allowed');
36
- });
37
- // @ts-ignore
38
- Cypress.on('test:before:after:run:async', () => {
39
- optionalCallback?.();
40
- });
41
- }
@@ -1,52 +0,0 @@
1
- {
2
- "name": "@cypress/mount-utils",
3
- "version": "0.0.0-development",
4
- "description": "Shared utilities for the various component testing adapters",
5
- "main": "dist/index.js",
6
- "scripts": {
7
- "build": "tsc || echo 'built, with type errors'",
8
- "postbuild": "node ../../scripts/sync-exported-npm-with-cli.js",
9
- "check-ts": "tsc --noEmit",
10
- "lint": "eslint",
11
- "watch": "tsc -w"
12
- },
13
- "dependencies": {},
14
- "devDependencies": {
15
- "@packages/eslint-config": "0.0.0-development",
16
- "@rollup/plugin-commonjs": "^29.0.2",
17
- "@rollup/plugin-node-resolve": "^16.0.3",
18
- "eslint": "^9.31.0",
19
- "lodash": "^4.17.21",
20
- "rollup": "4.60.2",
21
- "rollup-plugin-dts": "6.4.1",
22
- "rollup-plugin-typescript2": "^0.37.0",
23
- "typescript": "~5.4.5"
24
- },
25
- "files": [
26
- "dist"
27
- ],
28
- "types": "dist/index.d.ts",
29
- "license": "MIT",
30
- "repository": {
31
- "type": "git",
32
- "url": "https://github.com/cypress-io/cypress.git"
33
- },
34
- "homepage": "https://github.com/cypress-io/cypress/tree/develop/npm/mount-utils#readme",
35
- "bugs": "https://github.com/cypress-io/cypress/issues/new?template=1-bug-report.md",
36
- "lint-staged": {
37
- "**/*.{js,jsx,ts,tsx,json}": "eslint --fix"
38
- },
39
- "publishConfig": {
40
- "access": "public"
41
- },
42
- "nx": {
43
- "targets": {
44
- "build": {
45
- "outputs": [
46
- "{workspaceRoot}/cli/mount-utils",
47
- "{projectRoot}/dist"
48
- ]
49
- }
50
- }
51
- }
52
- }
@@ -1,19 +0,0 @@
1
- # @cypress/react
2
-
3
- Mount React components in the open source [Cypress.io](https://www.cypress.io/) test runner
4
-
5
- > **Note:** This package is bundled with the `cypress` package and should not need to be installed separately. See the [React Component Testing Docs](https://docs.cypress.io/guides/component-testing/react/overview) for mounting React components. Installing and importing `mount` from `@cypress/react` should only be done for advanced use-cases.
6
-
7
- ## Requirements
8
-
9
- - React 18.0.0+ (Cypress 13 and under supports React 16 and 17)
10
-
11
- ## Development
12
-
13
- Run `yarn build` to compile and sync packages to the `cypress` cli package.
14
-
15
- Run `yarn cy:open` to open Cypress component testing against real-world examples.
16
-
17
- Run `yarn test` to execute headless Cypress tests.
18
-
19
- ## [Changelog](./CHANGELOG.md)
@@ -1,293 +0,0 @@
1
-
2
- /**
3
- * @cypress/react v0.0.0-development
4
- * (c) 2026 Cypress.io
5
- * Released under the MIT License
6
- */
7
-
8
- 'use strict';
9
-
10
- var React = require('react');
11
- var ReactDOM = require('react-dom/client');
12
-
13
- function _interopNamespaceDefault(e) {
14
- var n = Object.create(null);
15
- if (e) {
16
- Object.keys(e).forEach(function (k) {
17
- if (k !== 'default') {
18
- var d = Object.getOwnPropertyDescriptor(e, k);
19
- Object.defineProperty(n, k, d.get ? d : {
20
- enumerable: true,
21
- get: function () { return e[k]; }
22
- });
23
- }
24
- });
25
- }
26
- n.default = e;
27
- return Object.freeze(n);
28
- }
29
-
30
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
31
-
32
- /**
33
- * Gets the display name of the component when possible.
34
- * @param type {JSX} The type object returned from creating the react element.
35
- * @param fallbackName {string} The alias, or fallback name to use when the name cannot be derived.
36
- * @link https://github.com/facebook/react-devtools/blob/master/backend/getDisplayName.js
37
- */
38
- function getDisplayName(node, fallbackName = 'Unknown') {
39
- const type = node === null || node === void 0 ? void 0 : node.type;
40
- if (!type) {
41
- return fallbackName;
42
- }
43
- let displayName = null;
44
- // The displayName property is not guaranteed to be a string.
45
- // It's only safe to use for our purposes if it's a string.
46
- // github.com/facebook/react-devtools/issues/803
47
- if (typeof type.displayName === 'string') {
48
- displayName = type.displayName;
49
- }
50
- if (!displayName) {
51
- displayName = type.name || fallbackName;
52
- }
53
- // Facebook-specific hack to turn "Image [from Image.react]" into just "Image".
54
- // We need displayName with module name for error reports but it clutters the DevTools.
55
- const match = displayName.match(/^(.*) \[from (.*)\]$/);
56
- if (match) {
57
- const componentName = match[1];
58
- const moduleName = match[2];
59
- if (componentName && moduleName) {
60
- if (moduleName === componentName ||
61
- moduleName.startsWith(`${componentName}.`)) {
62
- displayName = componentName;
63
- }
64
- }
65
- }
66
- return displayName;
67
- }
68
-
69
- const ROOT_SELECTOR = '[data-cy-root]';
70
- /**
71
- * Gets the root element used to mount the component.
72
- * @returns {HTMLElement} The root element
73
- * @throws {Error} If the root element is not found
74
- */
75
- const getContainerEl = () => {
76
- const el = document.querySelector(ROOT_SELECTOR);
77
- if (el) {
78
- return el;
79
- }
80
- throw Error(`No element found that matches selector ${ROOT_SELECTOR}. Please add a root element with data-cy-root attribute to your "component-index.html" file so that Cypress can attach your component to the DOM.`);
81
- };
82
- /**
83
- * Utility function to register CT side effects and run cleanup code during the "test:before:run" Cypress hook
84
- * @param optionalCallback Callback to be called before the next test runs
85
- */
86
- function setupHooks(optionalCallback) {
87
- // We don't want CT side effects to run when e2e
88
- // testing so we early return.
89
- // System test to verify CT side effects do not pollute e2e: system-tests/test/e2e_with_mount_import_spec.ts
90
- if (Cypress.testingType !== 'component') {
91
- return;
92
- }
93
- // When running component specs, we cannot allow "cy.visit"
94
- // because it will wipe out our preparation work, and does not make much sense
95
- // thus we overwrite "cy.visit" to throw an error
96
- Cypress.Commands.overwrite('visit', () => {
97
- throw new Error('cy.visit from a component spec is not allowed');
98
- });
99
- Cypress.Commands.overwrite('session', () => {
100
- throw new Error('cy.session from a component spec is not allowed');
101
- });
102
- Cypress.Commands.overwrite('origin', () => {
103
- throw new Error('cy.origin from a component spec is not allowed');
104
- });
105
- // @ts-ignore
106
- Cypress.on('test:before:after:run:async', () => {
107
- optionalCallback?.();
108
- });
109
- }
110
-
111
- let mountCleanup;
112
- /**
113
- * Create an `mount` function. Performs all the non-React-version specific
114
- * behavior related to mounting. The React-version-specific code
115
- * is injected. This helps us to maintain a consistent public API
116
- * and handle breaking changes in React's rendering API.
117
- *
118
- * This is designed to be consumed by `npm/react{16,17,18}`, and other React adapters,
119
- * or people writing adapters for third-party, custom adapters.
120
- */
121
- const makeMountFn = (type, jsx, options = {}, rerenderKey, internalMountOptions) => {
122
- if (!internalMountOptions) {
123
- throw Error('internalMountOptions must be provided with `render` and `reactDom` parameters');
124
- }
125
- mountCleanup = internalMountOptions.cleanup;
126
- return cy
127
- .then(() => {
128
- var _a, _b, _c;
129
- const reactDomToUse = internalMountOptions.reactDom;
130
- const el = getContainerEl();
131
- if (!el) {
132
- throw new Error([
133
- `[@cypress/react] 🔥 Hmm, cannot find root element to mount the component. Searched for ${ROOT_SELECTOR}`,
134
- ].join(' '));
135
- }
136
- const key = rerenderKey !== null && rerenderKey !== void 0 ? rerenderKey :
137
- // @ts-ignore provide unique key to the the wrapped component to make sure we are rerendering between tests
138
- (((_c = (_b = (_a = Cypress === null || Cypress === void 0 ? void 0 : Cypress.mocha) === null || _a === void 0 ? void 0 : _a.getRunner()) === null || _b === void 0 ? void 0 : _b.test) === null || _c === void 0 ? void 0 : _c.title) || '') + Math.random();
139
- const props = {
140
- key,
141
- };
142
- const reactComponent = React__namespace.createElement(options.strict ? React__namespace.StrictMode : React__namespace.Fragment, props, jsx);
143
- // since we always surround the component with a fragment
144
- // let's get back the original component
145
- const userComponent = reactComponent.props.children;
146
- internalMountOptions.render(reactComponent, el, reactDomToUse);
147
- return (cy.wrap(userComponent, { log: false })
148
- .then(() => {
149
- return cy.wrap({
150
- component: userComponent,
151
- rerender: (newComponent) => makeMountFn('rerender', newComponent, options, key, internalMountOptions),
152
- }, { log: false });
153
- })
154
- // by waiting, we delaying test execution for the next tick of event loop
155
- // and letting hooks and component lifecycle methods to execute mount
156
- // https://github.com/bahmutov/cypress-react-unit-test/issues/200
157
- .wait(0, { log: false })
158
- .then(() => {
159
- if (options.log !== false) {
160
- // Get the display name property via the component constructor
161
- // @ts-ignore FIXME
162
- const componentName = getDisplayName(jsx);
163
- const jsxComponentName = `<${componentName} ... />`;
164
- Cypress.log({
165
- name: type,
166
- type: 'parent',
167
- message: [jsxComponentName],
168
- // @ts-ignore
169
- $el: el.children.item(0),
170
- consoleProps: () => {
171
- return {
172
- // @ts-ignore protect the use of jsx functional components use ReactNode
173
- props: jsx === null || jsx === void 0 ? void 0 : jsx.props,
174
- description: type === 'mount' ? 'Mounts React component' : 'Rerenders mounted React component',
175
- home: 'https://github.com/cypress-io/cypress',
176
- };
177
- },
178
- });
179
- }
180
- }));
181
- // Bluebird types are terrible. I don't think the return type can be carried without this cast
182
- });
183
- };
184
- /**
185
- * Create an `unmount` function. Performs all the non-React-version specific
186
- * behavior related to unmounting.
187
- *
188
- * This is designed to be consumed by `npm/react{16,17,18}`, and other React adapters,
189
- * or people writing adapters for third-party, custom adapters.
190
- *
191
- * @param {UnmountArgs} options used during unmounting
192
- */
193
- const makeUnmountFn = (options) => {
194
- return cy.then(() => {
195
- var _a;
196
- const wasUnmounted = mountCleanup === null || mountCleanup === void 0 ? void 0 : mountCleanup();
197
- if (wasUnmounted && options.log) {
198
- Cypress.log({
199
- name: 'unmount',
200
- type: 'parent',
201
- message: [(_a = options.boundComponentMessage) !== null && _a !== void 0 ? _a : 'Unmounted component'],
202
- consoleProps: () => {
203
- return {
204
- description: 'Unmounts React component',
205
- parent: getContainerEl().parentNode,
206
- home: 'https://github.com/cypress-io/cypress',
207
- };
208
- },
209
- });
210
- }
211
- });
212
- };
213
- // Cleanup before each run
214
- // NOTE: we cannot use unmount here because
215
- // we are not in the context of a test
216
- const preMountCleanup = () => {
217
- mountCleanup === null || mountCleanup === void 0 ? void 0 : mountCleanup();
218
- };
219
- const _mount = (jsx, options = {}) => makeMountFn('mount', jsx, options);
220
- const createMount = (defaultOptions) => {
221
- return (element, options) => {
222
- return _mount(element, Object.assign(Object.assign({}, defaultOptions), options));
223
- };
224
- };
225
- // Side effects from "import { mount } from '@cypress/<my-framework>'" are annoying, we should avoid doing this
226
- // by creating an explicit function/import that the user can register in their 'component.js' support file,
227
- // such as:
228
- // import 'cypress/<my-framework>/support'
229
- // or
230
- // import { registerCT } from 'cypress/<my-framework>'
231
- // registerCT()
232
- // Note: This would be a breaking change
233
- // it is required to unmount component in beforeEach hook in order to provide a clean state inside test
234
- // because `mount` can be called after some preparation that can side effect unmount
235
- // @see npm/react/cypress/component/advanced/set-timeout-example/loading-indicator-spec.js
236
- setupHooks(preMountCleanup);
237
-
238
- let root;
239
- const cleanup = () => {
240
- if (root) {
241
- root.unmount();
242
- root = null;
243
- return true;
244
- }
245
- return false;
246
- };
247
- /**
248
- * Mounts a React component into the DOM.
249
- * @param {import('react').JSX.Element} jsx The React component to mount.
250
- * @param {MountOptions} options Options to pass to the mount function.
251
- * @param {string} rerenderKey A key to use to force a rerender.
252
- *
253
- * @example
254
- * import { mount } from '@cypress/react'
255
- * import { Stepper } from './Stepper'
256
- *
257
- * it('mounts', () => {
258
- * mount(<StepperComponent />)
259
- * cy.get('[data-cy=increment]').click()
260
- * cy.get('[data-cy=counter]').should('have.text', '1')
261
- * }
262
- *
263
- * @see {@link https://on.cypress.io/mounting-react} for more details.
264
- *
265
- * @returns {Cypress.Chainable<MountReturn>} The mounted component.
266
- */
267
- function mount(jsx, options = {}, rerenderKey) {
268
- // Remove last mounted component if cy.mount is called more than once in a test
269
- // React by default removes the last component when calling render, but we should remove the root
270
- // to wipe away any state
271
- cleanup();
272
- const internalOptions = {
273
- reactDom: ReactDOM,
274
- render: (reactComponent, el) => {
275
- if (!root) {
276
- root = ReactDOM.createRoot(el);
277
- }
278
- return root.render(reactComponent);
279
- },
280
- unmount: internalUnmount,
281
- cleanup,
282
- };
283
- return makeMountFn('mount', jsx, Object.assign({ ReactDom: ReactDOM }, options), rerenderKey, internalOptions);
284
- }
285
- function internalUnmount(options = { log: true }) {
286
- return makeUnmountFn(options);
287
- }
288
-
289
- exports.createMount = createMount;
290
- exports.getContainerEl = getContainerEl;
291
- exports.makeMountFn = makeMountFn;
292
- exports.makeUnmountFn = makeUnmountFn;
293
- exports.mount = mount;