@rebilly/framepay-react 9.50.0 → 9.51.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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [9.50.0](https://github.com/Rebilly/rebilly/compare/framepay-react-v9.49.0...framepay-react-v9.50.0) (2025-04-15)
1
+ ## [9.51.0](https://github.com/Rebilly/rebilly/compare/framepay-react-v9.50.0...framepay-react-v9.51.0) (2025-04-17)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * **framepay:** add focus to public element api ([#11264](https://github.com/Rebilly/rebilly/issues/11264)) ([abebd90](https://github.com/Rebilly/rebilly/commit/abebd90e733aa93082a88123792d880b8d1ada66))
6
+ * **framepay-react:** Add react 19 support ([#11287](https://github.com/Rebilly/rebilly/issues/11287)) ([3d2a7e1](https://github.com/Rebilly/rebilly/commit/3d2a7e13caf4ef4194089014dbf90664d85722fa))
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  > React components for FramePay.js
7
7
 
8
- Supported: React 14 to 18.
8
+ Supported: React 14 to 19.
9
9
 
10
10
  This package is a wrapper for [FramePay](https://www.rebilly.com/docs/dev-docs/framepay/) offering out-of-the-box support for Redux and other common React features.
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebilly/framepay-react",
3
- "version": "9.50.0",
3
+ "version": "9.51.0",
4
4
  "description": "A React wrapper for Rebilly's FramePay offering out-of-the-box support for Redux and other common React features",
5
5
  "main": "build/index.js",
6
6
  "author": "Rebilly",
@@ -33,6 +33,7 @@
33
33
  "set-react-16": "cross-env REACT_VERSION=16 node ./test/e2e/switch-react-version",
34
34
  "set-react-17": "cross-env REACT_VERSION=17 node ./test/e2e/switch-react-version",
35
35
  "set-react-18": "cross-env REACT_VERSION=18 node ./test/e2e/switch-react-version",
36
+ "set-react-19": "yarn clean-react-alias",
36
37
  "clean-react-alias": "cross-env REACT_VERSION=clean node ./test/e2e/switch-react-version",
37
38
  "dotenv": "node ./env.js",
38
39
  "build": "cross-env NODE_ENV=production tsc -p tsconfig.json",
@@ -47,7 +48,8 @@
47
48
  "test:e2e:react-16": "cross-env REACT_VERSION=16 run-s set-react-16 dotenv build:e2e clean-react-alias test:e2e:base",
48
49
  "test:e2e:react-17": "cross-env REACT_VERSION=17 run-s set-react-17 dotenv build:e2e clean-react-alias test:e2e:base",
49
50
  "test:e2e:react-18": "cross-env REACT_VERSION=18 run-s set-react-18 dotenv build:e2e clean-react-alias test:e2e:base",
50
- "test:e2e:pr": "yarn test:e2e:react-18",
51
+ "test:e2e:react-19": "cross-env REACT_VERSION=19 run-s set-react-19 dotenv build:e2e clean-react-alias test:e2e:base",
52
+ "test:e2e:pr": "yarn test:e2e:react-19",
51
53
  "test:e2e:post-merge": "run-s test:e2e:react-*",
52
54
  "test:e2e:open": "cypress open",
53
55
  "test:e2e:run": "cypress run",
@@ -55,8 +57,8 @@
55
57
  "clean:e2e": "rm -rf test/e2e/build"
56
58
  },
57
59
  "peerDependencies": {
58
- "react": "^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
59
- "react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
60
+ "react": "^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
61
+ "react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
60
62
  },
61
63
  "dependencies": {
62
64
  "@rebilly/framepay": "*",
@@ -84,8 +86,9 @@
84
86
  "parcel-bundler": "^1.12.5",
85
87
  "portfinder": "^1.0.35",
86
88
  "prop-types": "^15.0.0",
87
- "react": "^18.3.1",
88
- "react-dom": "^18.3.1",
89
+ "react": "^19.1.0",
90
+ "react-dom": "^19.1.0",
91
+ "react-dom-19": "npm:react-dom@19.1.0",
89
92
  "start-server-and-test": "^2.0.11",
90
93
  "ts-jest": "^29.3.1",
91
94
  "typescript": "^5.4.5"
@@ -0,0 +1,10 @@
1
+ # UMD Builds for React Versions
2
+
3
+ This folder contains UMD builds of various React versions. These builds are toggled
4
+ using scripts defined in the `package.json` file (e.g., `set-react-*`).
5
+
6
+ ## React 19
7
+
8
+ React 19 removed support for [UMD builds](https://react.dev/blog/2024/04/25/react-19-upgrade-guide#umd-builds-removed).
9
+
10
+ For react 19 we are using the npm version in the package.json.
@@ -1,11 +1,10 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import {
5
4
  FramePayProvider,
6
5
  withFramePayApplePayComponent,
7
6
  } from '../../../build';
8
- import { prettyDebugRender, ReactVersion } from './util';
7
+ import { prettyDebugRender, ReactVersion, renderFixture } from './util';
9
8
  import './style.css';
10
9
 
11
10
  const params = {
@@ -55,4 +54,4 @@ class App extends Component {
55
54
  }
56
55
 
57
56
  const WrappedApp = withFramePayApplePayComponent(App);
58
- ReactDOM.render(<WrappedApp />, document.getElementById('app'));
57
+ renderFixture(<WrappedApp />);
@@ -1,8 +1,12 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import { FramePayProvider, withFramePayBankComponent } from '../../../build';
5
- import { deepMerge, prettyDebugRender, ReactVersion } from './util';
4
+ import {
5
+ deepMerge,
6
+ prettyDebugRender,
7
+ ReactVersion,
8
+ renderFixture,
9
+ } from './util';
6
10
  import './style.css';
7
11
 
8
12
  const params = {
@@ -321,4 +325,4 @@ class App extends Component {
321
325
  }
322
326
  }
323
327
 
324
- ReactDOM.render(<App />, document.getElementById('app'));
328
+ renderFixture(<App />);
@@ -1,16 +1,17 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
-
4
2
  import {
5
3
  FramePayProvider,
6
4
  SUPPORTED_CARD_BRANDS,
7
5
  withFramePayCardComponent,
8
6
  } from '../../../build';
9
- import { deepMerge, prettyDebugRender, ReactVersion } from './util';
7
+ import {
8
+ deepMerge,
9
+ prettyDebugRender,
10
+ ReactVersion,
11
+ renderFixture,
12
+ } from './util';
10
13
  import './style.css';
11
14
 
12
- console.log('SUPPORTED_CARD_BRANDS', SUPPORTED_CARD_BRANDS);
13
-
14
15
  const params = {
15
16
  publishableKey: 'pk_sandbox_c6cqKLddciVikuBOjhcng-rLccTz70NT4W_qZ_h',
16
17
  icon: {
@@ -374,4 +375,4 @@ class App extends Component {
374
375
  }
375
376
  }
376
377
 
377
- ReactDOM.render(<App />, document.getElementById('app'));
378
+ renderFixture(<App />);
@@ -1,8 +1,12 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import { FramePayProvider, withFramePayCardComponent } from '../../../build';
5
- import { deepMerge, prettyDebugRender, ReactVersion } from './util';
4
+ import {
5
+ deepMerge,
6
+ prettyDebugRender,
7
+ ReactVersion,
8
+ renderFixture,
9
+ } from './util';
6
10
  import './style.css';
7
11
 
8
12
  const params = {
@@ -269,4 +273,4 @@ class App extends Component {
269
273
  }
270
274
  }
271
275
 
272
- ReactDOM.render(<App />, document.getElementById('app'));
276
+ renderFixture(<App />);
@@ -1,8 +1,12 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import { FramePayProvider, withFramePayCardComponent } from '../../../build';
5
- import { deepMerge, prettyDebugRender, ReactVersion } from './util';
4
+ import {
5
+ deepMerge,
6
+ prettyDebugRender,
7
+ ReactVersion,
8
+ renderFixture,
9
+ } from './util';
6
10
  import './style.css';
7
11
 
8
12
  const params = {
@@ -326,4 +330,4 @@ class App extends Component {
326
330
  }
327
331
  }
328
332
 
329
- ReactDOM.render(<App />, document.getElementById('app'));
333
+ renderFixture(<App />);
@@ -1,8 +1,12 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import { FramePayProvider, withFramePayCardComponent } from '../../../build';
5
- import { deepMerge, prettyDebugRender, ReactVersion } from './util';
4
+ import {
5
+ deepMerge,
6
+ prettyDebugRender,
7
+ ReactVersion,
8
+ renderFixture,
9
+ } from './util';
6
10
  import './style.css';
7
11
 
8
12
  const params = {
@@ -246,4 +250,4 @@ class App extends Component {
246
250
  }
247
251
  }
248
252
 
249
- ReactDOM.render(<App />, document.getElementById('app'));
253
+ renderFixture(<App />);
@@ -1,11 +1,10 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import {
5
4
  FramePayProvider,
6
5
  withFramePayGooglePayComponent,
7
6
  } from '../../../build';
8
- import { prettyDebugRender, ReactVersion } from './util';
7
+ import { prettyDebugRender, ReactVersion, renderFixture } from './util';
9
8
  import './style.css';
10
9
 
11
10
  const params = {
@@ -55,4 +54,4 @@ class App extends Component {
55
54
  }
56
55
 
57
56
  const WrappedApp = withFramePayGooglePayComponent(App);
58
- ReactDOM.render(<WrappedApp />, document.getElementById('app'));
57
+ renderFixture(<WrappedApp />);
@@ -1,8 +1,12 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import { FramePayProvider, withFramePayIBANComponent } from '../../../build';
5
- import { deepMerge, prettyDebugRender, ReactVersion } from './util';
4
+ import {
5
+ deepMerge,
6
+ prettyDebugRender,
7
+ ReactVersion,
8
+ renderFixture,
9
+ } from './util';
6
10
  import './style.css';
7
11
 
8
12
  const params = {
@@ -238,4 +242,4 @@ class App extends Component {
238
242
  }
239
243
  }
240
244
 
241
- ReactDOM.render(<App />, document.getElementById('app'));
245
+ renderFixture(<App />);
@@ -1,8 +1,12 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import { FramePayProvider, withFramePayCardComponent } from '../../../build';
5
- import { deepMerge, prettyDebugRender, ReactVersion } from './util';
4
+ import {
5
+ deepMerge,
6
+ prettyDebugRender,
7
+ ReactVersion,
8
+ renderFixture,
9
+ } from './util';
6
10
  import './style.css';
7
11
 
8
12
  const params = {
@@ -271,4 +275,4 @@ class App extends Component {
271
275
  }
272
276
  }
273
277
 
274
- ReactDOM.render(<App />, document.getElementById('app'));
278
+ renderFixture(<App />);
@@ -1,8 +1,12 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import { FramePayProvider, withFramePay } from '../../../build';
5
- import { deepMerge, prettyDebugRender, ReactVersion } from './util';
4
+ import {
5
+ deepMerge,
6
+ prettyDebugRender,
7
+ ReactVersion,
8
+ renderFixture,
9
+ } from './util';
6
10
  import './style.css';
7
11
 
8
12
  const params = {
@@ -480,4 +484,4 @@ class App extends Component {
480
484
  }
481
485
  }
482
486
 
483
- ReactDOM.render(<App />, document.getElementById('app'));
487
+ renderFixture(<App />);
@@ -1,8 +1,7 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import { FramePayProvider, withFramePayPaypalComponent } from '../../../build';
5
- import { prettyDebugRender, ReactVersion } from './util';
4
+ import { prettyDebugRender, ReactVersion, renderFixture } from './util';
6
5
  import './style.css';
7
6
 
8
7
  const params = {
@@ -51,4 +50,4 @@ class App extends Component {
51
50
  }
52
51
 
53
52
  const WrappedApp = withFramePayPaypalComponent(App);
54
- ReactDOM.render(<WrappedApp />, document.getElementById('app'));
53
+ renderFixture(<WrappedApp />);
@@ -1,11 +1,10 @@
1
1
  import React, { Component } from 'react';
2
- import ReactDOM from 'react-dom';
3
2
 
4
3
  import {
5
4
  FramePayProvider,
6
5
  withFramePaySamsungPayComponent,
7
6
  } from '../../../build';
8
- import { prettyDebugRender, ReactVersion } from './util';
7
+ import { prettyDebugRender, ReactVersion, renderFixture } from './util';
9
8
  import './style.css';
10
9
 
11
10
  const params = {
@@ -55,4 +54,4 @@ class App extends Component {
55
54
  }
56
55
 
57
56
  const WrappedApp = withFramePaySamsungPayComponent(App);
58
- ReactDOM.render(<WrappedApp />, document.getElementById('app'));
57
+ renderFixture(<WrappedApp />);
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import ReactDOM from 'react-dom';
2
3
 
3
4
  export const prettyRenderState = (data, parentKey) => {
4
5
  if (data !== null && typeof data === 'object') {
@@ -82,3 +83,24 @@ export const ReactVersion = () => {
82
83
  </div>
83
84
  );
84
85
  };
86
+
87
+ // Render a test fixtures in the DOM.
88
+ // Since react 19, ReactDOM.render is removed. Our test fixtures need to
89
+ // support running in multiple versions of React.
90
+ // We check if ReactDOM.render is available, if not we use the new API.
91
+ // We must dynamically import react-dom-19/client to avoid breaking the build
92
+ // in old versions. react-dom-19 must be a separate package in the package.json,
93
+ // otherwise when react-dom is aliased to an older version, the /client import
94
+ // will fail at build time.
95
+ export const renderFixture = (component) => {
96
+ if (ReactDOM.render) {
97
+ ReactDOM.render(component, document.getElementById('app'));
98
+ } else {
99
+ const ReactDOM19 = import('react-dom-19/client');
100
+ ReactDOM19.then((ReactDOM) => {
101
+ ReactDOM.createRoot(document.getElementById('app')).render(
102
+ component,
103
+ );
104
+ });
105
+ }
106
+ };