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

Initial experimental React 18 compat prototyping #1808

Merged
merged 17 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ coverage
es
temp/
react-redux-*/
.vscode/

.cache
.cache/
.yarn/cache/
website/.yarn/
.yarnrc
.yarn/*
!.yarn/patches
Expand All @@ -26,6 +29,5 @@ lib/core/MetadataBlog.js

website/translated_docs
website/build/
website/yarn.lock
website/node_modules
website/i18n/*
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build]
base = "website"
publish = "website/build"
command = "yarn build && cp _redirects ./build"
command = "yarn && yarn build && cp _redirects ./build"
ignore = "git diff --quiet HEAD^ HEAD -- ../docs/ ."

[build.environment]
Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-redux",
"version": "7.2.4",
"version": "8.0.0-alpha.0",
"description": "Official React bindings for Redux",
"keywords": [
"react",
Expand Down Expand Up @@ -39,11 +39,8 @@
"type-tests": "yarn tsc -p test/typetests",
"coverage": "codecov"
},
"workspaces": [
"website"
],
"peerDependencies": {
"react": "^16.8.3 || ^17"
"react": "^16.8.3 || ^17 || ^18"
},
"peerDependenciesMeta": {
"react-dom": {
Expand All @@ -55,10 +52,13 @@
},
"dependencies": {
"@babel/runtime": "^7.12.1",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/use-sync-external-store": "^0.0.0",
"hoist-non-react-statics": "^3.3.2",
"loose-envify": "^1.4.0",
"prop-types": "^15.7.2",
"react-is": "^16.13.1"
"react-is": "^16.13.1",
"use-sync-external-store": "0.0.0-experimental-7d38e4fd8-20210930"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
Expand All @@ -71,18 +71,19 @@
"@babel/preset-env": "^7.12.1",
"@babel/preset-typescript": "^7.14.5",
"@microsoft/api-extractor": "^7.18.1",
"@reduxjs/toolkit": "^1.6.1",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-replace": "^2.3.3",
"@testing-library/jest-dom": "^5.11.5",
"@testing-library/jest-native": "^3.4.3",
"@testing-library/react": "^12.0.0",
"@testing-library/react": "https://pkg.csb.dev/testing-library/react-testing-library/commit/0e2cf7da/@testing-library/react#.tgz",
"@testing-library/react-hooks": "^3.4.2",
"@testing-library/react-native": "^7.1.0",
"@types/create-react-class": "^15.6.3",
"@types/object-assign": "^4.0.30",
"@types/react": "^17.0.14",
"@types/react": "17.0.19",
"@types/react-dom": "^17.0.9",
"@types/react-is": "^17.0.1",
"@types/react-native": "^0.64.12",
Expand All @@ -103,10 +104,10 @@
"glob": "^7.1.6",
"jest": "^26.6.1",
"prettier": "^2.1.2",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react": "0.0.0-experimental-7d38e4fd8-20210930",
"react-dom": "0.0.0-experimental-7d38e4fd8-20210930",
"react-native": "^0.64.1",
"react-test-renderer": "^16.14.0",
"react-test-renderer": "0.0.0-experimental-7d38e4fd8-20210930",
"redux": "^4.0.5",
"rimraf": "^3.0.2",
"rollup": "^2.32.1",
Expand Down
5 changes: 2 additions & 3 deletions src/components/Context.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import React from 'react'
import { Action, AnyAction, Store } from 'redux'
import type { FixTypeLater } from '../types'
import type { Subscription } from '../utils/Subscription'

export interface ReactReduxContextValue<
SS = FixTypeLater,
SS = any,
A extends Action = AnyAction
> {
store: Store<SS, A>
subscription: Subscription
}

export const ReactReduxContext =
/*#__PURE__*/ React.createContext<ReactReduxContextValue | null>(null)
/*#__PURE__*/ React.createContext<ReactReduxContextValue>(null as any)

export type ReactReduxContextInstance = typeof ReactReduxContext

Expand Down
2 changes: 1 addition & 1 deletion src/components/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface ProviderProps<A extends Action = AnyAction> {
* If this is used, you'll need to customize `connect` by supplying the same context provided to the Provider.
* Initial value doesn't matter, as it is overwritten with the internal state of Provider.
*/
context?: Context<ReactReduxContextValue | null>
context?: Context<ReactReduxContextValue>
children: ReactNode
}

Expand Down
Loading