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

Bump react to 18 #5359

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

Bump react to 18 #5359

wants to merge 31 commits into from

Conversation

poulch
Copy link
Member

@poulch poulch commented Jan 17, 2025

Scope of the change

@poulch poulch requested review from a team as code owners January 17, 2025 18:26
Copy link

changeset-bot bot commented Jan 17, 2025

⚠️ No Changeset found

Latest commit: b15b78e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

Differences Found

✅ No packages or licenses were added.

Summary

Expand
License Name Package Count Packages
0BSD 1
Packages
  • tslib
BlueOak-1.0.0 1
Packages
  • path-scurry
CC0-1.0 1
Packages
  • type-fest
MIT/X11 1
Packages
  • nub
MPL-1.1 1
Packages
  • harmony-reflect
MPL-2.0 1
Packages
  • dompurify
Public Domain 1
Packages
  • jsonify
Python-2.0 1
Packages
  • argparse
WTFPL 1
Packages
  • opener
CC-BY-4.0 2
Packages
  • @saleor/macaw-ui
  • caniuse-lite
<<missing>> 3
Packages
  • busboy
  • saleor-dashboard
  • streamsearch
BSD-2-Clause 24
Packages
  • @typescript-eslint/parser
  • @typescript-eslint/typescript-estree
  • browser-process-hrtime
  • css-select
  • css-what
  • domelementtype
  • domhandler
  • domutils
  • dotenv
  • dotenv-expand
  • entities
  • escodegen
  • eslint-scope
  • espree
  • esprima
  • esrecurse
  • estraverse
  • esutils
  • nth-check
  • stringify-object
  • And 4 more...
BSD-3-Clause 45
Packages
  • @humanwhocodes/object-schema
  • @sentry/cli
  • @sentry/cli-darwin
  • @sentry/cli-linux-arm
  • @sentry/cli-linux-arm64
  • @sentry/cli-linux-i686
  • @sentry/cli-linux-x64
  • @sentry/cli-win32-i686
  • @sentry/cli-win32-x64
  • @sinonjs/commons
  • @sinonjs/fake-timers
  • abab
  • asn1js
  • babel-plugin-istanbul
  • charenc
  • chroma-js
  • crypt
  • diff
  • esquery
  • exenv
  • And 25 more...
Apache-2.0 46
Packages
  • @ampproject/remapping
  • @editorjs/editorjs
  • @humanwhocodes/config-array
  • @humanwhocodes/module-importer
  • @opentelemetry/api
  • @opentelemetry/semantic-conventions
  • @playwright/test
  • @swc/core
  • @swc/core-darwin-arm64
  • @swc/core-darwin-x64
  • @swc/core-linux-arm-gnueabihf
  • @swc/core-linux-arm64-gnu
  • @swc/core-linux-arm64-musl
  • @swc/core-linux-x64-gnu
  • @swc/core-linux-x64-musl
  • @swc/core-win32-arm64-msvc
  • @swc/core-win32-ia32-msvc
  • @swc/core-win32-x64-msvc
  • @swc/counter
  • aria-query
  • And 26 more...
ISC 50
Packages
  • @esbuild-plugins/node-globals-polyfill
  • @istanbuljs/load-nyc-config
  • @saleor/app-sdk
  • anymatch
  • boolbase
  • browser-stdout
  • cli-width
  • cliui
  • electron-to-chromium
  • fastq
  • flatted
  • fs.realpath
  • get-caller-file
  • get-own-enumerable-property-symbols
  • glob
  • glob-parent
  • graceful-fs
  • inflight
  • inherits
  • ini
  • And 30 more...
MIT 1123
Packages
  • @adobe/css-tools
  • @apollo/client
  • @ardatan/relay-compiler
  • @ardatan/sync-fetch
  • @babel/code-frame
  • @babel/compat-data
  • @babel/core
  • @babel/generator
  • @babel/helper-annotate-as-pure
  • @babel/helper-compilation-targets
  • @babel/helper-create-class-features-plugin
  • @babel/helper-member-expression-to-functions
  • @babel/helper-module-imports
  • @babel/helper-module-transforms
  • @babel/helper-optimise-call-expression
  • @babel/helper-plugin-utils
  • @babel/helper-replace-supers
  • @babel/helper-simple-access
  • @babel/helper-skip-transparent-expression-wrappers
  • @babel/helper-string-parser
  • And 1103 more...

@github-actions github-actions bot temporarily deployed to pr-5359 January 17, 2025 18:31 Destroyed
@poulch poulch changed the title Bump react to 19 Bump react to 18 Jan 18, 2025
@github-actions github-actions bot temporarily deployed to pr-5359 January 18, 2025 11:51 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 18, 2025 12:15 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 18, 2025 14:18 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 18, 2025 15:56 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 18, 2025 20:30 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 18, 2025 22:28 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 20, 2025 20:37 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 20, 2025 23:47 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 21, 2025 03:07 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 22, 2025 00:18 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 22, 2025 09:42 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 27, 2025 08:44 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 27, 2025 09:22 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 27, 2025 09:58 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 27, 2025 10:28 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 27, 2025 11:16 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 27, 2025 23:49 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 28, 2025 08:50 Destroyed
@github-actions github-actions bot temporarily deployed to pr-5359 January 28, 2025 09:29 Destroyed
Copy link
Member

@witoszekdev witoszekdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should:

  • get rid of ts-ignore in favor of ts-expect-error + add description why it's needed?
  • don't use import * as React from "react"; since we're importing only selected functions in rest of our codebase
  • replace ReactChildren type with ReactNode if it makes sense - I don't think we should limit what children should be passed if we're not explicitly requiring them to be React components
  • replace macaw with stable version
  • change that ESLint config as they suggested in docs

@@ -91,6 +91,7 @@
],
// Decided to turn off:
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: according to react eslint plugin docs, we should instead extend react/jsx-runtime config:

If you are using the new JSX transform from React 17, you should disable this rule by extending react/jsx-runtime in your eslint config (add "plugin:react/jsx-runtime" to "extends").

@@ -30,7 +30,7 @@
"@material-ui/styles": "^4.11.4",
"@reach/auto-id": "^0.16.0",
"@saleor/macaw-ui": "npm:@saleor/[email protected]",
"@saleor/macaw-ui-next": "npm:@saleor/macaw-ui@1.1.15",
"@saleor/macaw-ui-next": "npm:@saleor/macaw-ui@0.0.0-pr-20250127234423",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: is this a mistake? if we have unreleased changes we should probably release new macaw version

Comment on lines +13 to +14
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: we should use @ts-expect-error instead of @ts-ignore, because if for some reason we don't have TypeScript error anymore it will be shown as error so that we can remove this comment. You also don't need to disable ESLint rule for that (probably)

Comment on lines +54 to +55
{/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */}
{/* @ts-ignore */}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: same here let's use @ts-expect-error

Comment on lines +24 to +25
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ts-expect-error

@@ -6,7 +6,7 @@ import { getFormErrors } from "@dashboard/utils/errors";
import { TextField } from "@material-ui/core";
import { makeStyles } from "@saleor/macaw-ui";
import { Option } from "@saleor/macaw-ui-next";
import React from "react";
import * as React from "react";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: why do we need this import, can we get rid of it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants