Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react 18 works? #1004

Merged
merged 13 commits into from
Aug 20, 2023
82,045 changes: 64,019 additions & 18,026 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/blueprints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
"lodash": "^4.17.21",
"mocha": "^8.2.1",
"prettier": "^2.1.2",
"ts-node": "^9.0.0",
"ts-node": "^10.9.1",
"tslib": "^2.1.0",
"typescript": "4.1.2"
"typescript": "^4.9.5"
},
"dependencies": {
"pro-gallery-lib": "5.0.65",
Expand Down
6 changes: 6 additions & 0 deletions packages/gallery/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
["@babel/preset-env", { "targets": { "node": "current" } }],
"@babel/preset-react"
]
}
38 changes: 23 additions & 15 deletions packages/gallery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,48 +41,56 @@
"pro-gallery-blueprints": "5.0.65",
"pro-gallery-lib": "5.0.65",
"pro-layouts": "5.0.65",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-player": "^2.6.2",
"three": "0.143.0"
},
"peerDependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
"devDependencies": {
"@babel/core": "7.16.7",
"@babel/preset-env": "^7.5.5",
"@types/node": "11.15.20",
"@types/react": "^16.14.6",
"@babel/preset-react": "^7.22.5",
"@cfaester/enzyme-adapter-react-18": "^0.7.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@types/react": "^18.2.0",
"@types/three": "0.143.1",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"babel-jest": "^29.6.2",
"babelify": "^10.0.0",
"chai": "^4.2.0",
"chai-spies": "^0.7.1",
"concurrently": "^6.1.0",
"enzyme": "^3.0.0",
"enzyme-adapter-react-16": "^1.7.1",
"eslint": "^7.13.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"jest": "^26.0.0",
"jest-image-snapshot": "^4.5.1",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"jest-image-snapshot": "^6.2.0",
"jest-stare": "2.2.0",
"prettier": "^2.1.2",
"puppeteer": "^1.5.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-dom": "^18.2.0",
"sass": "^1.59.3",
"sinon": "^6.0.0",
"ts-jest": "^26.4.4",
"ts-jest": "^29.1.1",
"tslib": "^2.1.0",
"typescript": "4.1.2"
"typescript": "^4.9.5"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"jest": {
"preset": "ts-jest/presets/js-with-ts",
"preset": "ts-jest",
"transform": {
"^.+\\.(ts|tsx)?$": "ts-jest",
"^.+\\.(js|jsx)$": "babel-jest"
},
"transformIgnorePatterns": [
"<rootDir>/node_modules/"
],
"testEnvironment": "jsdom",
"moduleNameMapper": {
"\\.(css|less|sass|scss)$": "<rootDir>/tests/drivers/mocks/stylesImportMock.js"
},
Expand Down
1 change: 0 additions & 1 deletion packages/gallery/src/components/item/itemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ class ItemView extends React.Component {
handleItemMouseUp: this.handleItemMouseUp,
}}
hasLink={this.itemHasLink()}
isCurrentHover={this.simulateHover()}
hover={itemHover}
activeIndex={activeIndex}
calculatedAlt={calculatedAlt}
Expand Down
2 changes: 1 addition & 1 deletion packages/gallery/tests/drivers/reactDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { testImages } from './mocks/images-mock.js';
import { mount, shallow, configure } from 'enzyme';
import { GalleryContainer } from '../../src/components/gallery/proGallery/galleryContainer'; //import GalleryContainer before the connect (without redux)
import React from 'react';
import Adapter from 'enzyme-adapter-react-16';
import Adapter from '@cfaester/enzyme-adapter-react-18';
import ProGallery from '../../src/components/gallery';
import _ from 'lodash';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('options - behaviourParams_item_video_playTrigger', () => {
GALLERY_CONSTS[optionsMap.layoutParams.structure.galleryLayout].GRID,
});
driver.mount.proGallery(initialProps);
await driver.update();
await driver.update(500);
const galleryVideoItems = driver.find.hook('video_container-video-player-element');
expect(galleryVideoItems.length).to.be.greaterThan(0);
driver.detach.proGallery();
Expand Down
4 changes: 2 additions & 2 deletions packages/layouts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
"eslint-plugin-prettier": "^3.1.4",
"mocha": "^8.2.1",
"prettier": "^2.1.2",
"ts-node": "^9.0.0",
"ts-node": "^10.9.1",
"tslib": "^2.1.0",
"typescript": "4.1.2"
"typescript": "^4.9.5"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand Down
20 changes: 4 additions & 16 deletions packages/lib/buildScripts/getSchema.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
module.exports = getSchemaFromTypes;

const TJS = require('typescript-json-schema');
const path = require('path');

function getSchemaFromTypes(typesFileAbsolutePath) {
// optionally pass argument to schema generator
const settings = {
required: true,
};

// optionally pass ts compiler options
const compilerOptions = {
strictNullChecks: true,
skipLibCheck: true,
};

// optionally pass a base path
// const basePath = "./my-dir";

const program = TJS.getProgramFromFiles(
[typesFileAbsolutePath],
compilerOptions
// basePath
);
const program = TJS.programFromConfig(path.join(__dirname, '..', 'tsconfig.json'), [typesFileAbsolutePath]);

// We can either get the schema for one file and one type...
const schema = TJS.generateSchema(program, 'Options', settings);
const generator = TJS.buildGenerator(program, settings);
const schema = TJS.generateSchema(program, 'Options', settings, [], generator);
return schema;
}
4 changes: 2 additions & 2 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"lodash": "^4.17.21",
"mocha": "^8.2.1",
"prettier": "^2.1.2",
"ts-node": "^9.0.0",
"ts-node": "^10.9.1",
"tslib": "^2.1.0",
"typescript": "4.1.2",
"typescript": "^4.9.5",
"typescript-json-schema": "^0.50.1"
},
"publishConfig": {
Expand Down
16 changes: 9 additions & 7 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@
"pro-gallery-lib": "5.0.65",
"pro-layouts": "5.0.65",
"re-resizable": "^6.8.0",
"react": "^16.8.6",
"react": "^18.2.0",
"react-color": "^2.17.3",
"react-dom": "^16.8.6",
"react-dom": "^18.2.0",
"react-syntax-highlighter": "^15.4.5"
},
"devDependencies": {
"@svgr/webpack": "^4.3.2",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.2.2",
"babel-jest": "^29.6.2",
"@types/react": "^18.2.0",
"@types/react-dom": "^18.2.0",
"babel-loader": "^8.0.6",
"babel-plugin-named-asset-import": "^0.3.2",
"babel-preset-react-app": "^9.0.0",
Expand All @@ -51,9 +53,9 @@
"eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^4.1.0",
"html-webpack-plugin": "^4.0.0-beta.5",
"jest": "^26.0.0",
"jest-environment-jsdom-fourteen": "^1.0.1",
"jest-watch-typeahead": "^0.6.0",
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"jest-watch-typeahead": "^2.2.2",
"mini-css-extract-plugin": "^0.8.0",
"node-forge": "1.3.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
Expand Down Expand Up @@ -105,7 +107,7 @@
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}"
],
"testEnvironment": "jest-environment-jsdom-fourteen",
"testEnvironment": "jsdom",
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": "babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/playground/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './utils/polyfills';

import React from 'react';
import ReactDOM from 'react-dom';
import ReactDOM from 'react-dom/client';
import { App } from './components/App/App';
import { PlaygroundGalleryProvider } from './hooks/GalleryContext';

Expand All @@ -11,4 +11,4 @@ const Root = () => (
</PlaygroundGalleryProvider>
);

ReactDOM.render(<Root />, document.getElementById('root'));
ReactDOM.createRoot(document.getElementById('root')).render(<Root />);
Loading