Skip to content

Commit

Permalink
chore: update react-script
Browse files Browse the repository at this point in the history
  • Loading branch information
embbnux committed Oct 23, 2023
1 parent d4ef72d commit 5231e5c
Show file tree
Hide file tree
Showing 9 changed files with 28,723 additions and 40,427 deletions.
69,089 changes: 28,675 additions & 40,414 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions react-demo/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = function override (config, env) {
const loaders = config.resolve
loaders.fallback = {
querystring: require.resolve('querystring-es3'),
crypto: require.resolve("crypto-browserify"),
stream: require.resolve('stream-browserify'),
};
return config;
}
8 changes: 6 additions & 2 deletions react-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"clean": "rimraf build",
"start": "PORT=$REACT_DEMO_PORT SKIP_PREFLIGHT_CHECK=true react-scripts start"
"start": "PORT=$REACT_DEMO_PORT SKIP_PREFLIGHT_CHECK=true react-app-rewired start"
},
"dependencies": {
"@ringcentral/react": "*",
Expand All @@ -20,7 +20,11 @@
"@types/react-dom": "^16.9.8",
"@types/react-router-dom": "^5.3.3",
"@types/webpack-env": "^1.13.6",
"react-scripts": "^2.1.3",
"crypto-browserify": "^3.12.0",
"querystring-es3": "^0.2.1",
"stream-browserify": "^3.0.0",
"react-scripts": "^5.0.1",
"react-app-rewired": "^2.2.1",
"rimraf": "^2.6.2"
},
"browserslist": [
Expand Down
5 changes: 3 additions & 2 deletions react-demo/src/lib.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import SDK from '@ringcentral/sdk';
import {version} from '../package.json';

import packageJson from '../package.json';

const redirectUri = `${window.location.origin}/api/oauth2Callback`; // make sure you have this configured in Dev Portal

export const sdk = new SDK({
appName: 'ReactDemo',
appVersion: version,
appVersion: packageJson.version,
server: process.env.REACT_APP_API_SERVER,
clientId: process.env.REACT_APP_API_CLIENT_ID,
redirectUri,
Expand Down
2 changes: 1 addition & 1 deletion react/src/AuthGate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}

const delay = () => new Promise(res => setImmediate(res));
const delay = () => new Promise(res => setTimeout(res, 0));

export interface AuthGateState {
isAuthorized: boolean;
Expand Down
10 changes: 10 additions & 0 deletions redux-demo/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = function override (config, env) {
const loaders = config.resolve
loaders.fallback = {
querystring: require.resolve('querystring-es3'),
crypto: require.resolve("crypto-browserify"),
stream: require.resolve('stream-browserify'),
url: require.resolve('url'),
};
return config;
}
9 changes: 7 additions & 2 deletions redux-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"clean": "rimraf build",
"start": "PORT=$REDUX_DEMO_PORT SKIP_PREFLIGHT_CHECK=true react-scripts start"
"start": "PORT=$REDUX_DEMO_PORT SKIP_PREFLIGHT_CHECK=true react-app-rewired start"
},
"dependencies": {
"@ringcentral/redux": "*",
Expand All @@ -26,7 +26,12 @@
"@types/react-router-dom": "^5.3.3",
"@types/redux": "^3.6.0",
"@types/webpack-env": "^1.13.6",
"react-scripts": "^2.1.3",
"crypto-browserify": "^3.12.0",
"querystring-es3": "^0.2.1",
"stream-browserify": "^3.0.0",
"url": "^0.11.0",
"react-scripts": "^5.0.1",
"react-app-rewired": "^2.2.1",
"rimraf": "^2.6.2"
},
"browserslist": [
Expand Down
16 changes: 11 additions & 5 deletions redux-demo/src/lib.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import {createLogger} from 'redux-logger';
import {applyMiddleware, createStore as createReduxStore, combineReducers, Store} from 'redux';
import {
applyMiddleware,
combineReducers,
createStore as createReduxStore,
} from 'redux';
import locationHelperBuilder from 'redux-auth-wrapper/history4/locationHelper';
import {connectedRouterRedirect} from 'redux-auth-wrapper/history4/redirect';
import SDK from '@ringcentral/sdk';
import {createLogger} from 'redux-logger';

import StoreConnector from '@ringcentral/redux';
import {version} from '../package.json';
import SDK from '@ringcentral/sdk';

import packageJSON from '../package.json';

const locationHelper = locationHelperBuilder({});

Expand All @@ -14,7 +20,7 @@ export const redirectUri = window.location.origin + redirectPath;

export const sdk = new SDK({
appName: 'ReduxDemo',
appVersion: version,
appVersion: packageJSON.version,
server: process.env.REACT_APP_API_SERVER,
clientId: process.env.REACT_APP_API_CLIENT_ID,
redirectUri,
Expand Down
2 changes: 1 addition & 1 deletion utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"buffer": "^6.0.3",
"events": "^3.3.0",
"fetch-mock": "^7.2.0",
"isomorphic-fetch": "^2.2.1",
"isomorphic-fetch": "^3.0.0",
"jest": "^29.7.0",
"tslib": "^2.6.2",
"typescript": "^4.8.4",
Expand Down

0 comments on commit 5231e5c

Please sign in to comment.