Skip to content

Commit

Permalink
📦 Attempting to patch redux toolkit for webpack support
Browse files Browse the repository at this point in the history
  • Loading branch information
QuintonC committed Mar 2, 2023
1 parent 2ee07fd commit 003349e
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 23 deletions.
5 changes: 5 additions & 0 deletions .changeset/eleven-pugs-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/connect-wallet': minor
---

Addressed an issue with Redux support for non-ESM compliant bundlers such as Webpack
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dev": "turbo run dev",
"lint": "turbo run lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"postinstall": "patch-package",
"preversion": "echo \"Error: use @changsets/cli to version packages\" && exit 1",
"preversion-packages": "node scripts/preversion.js",
"release": "turbo run build --filter='!playground' && changeset publish",
Expand Down Expand Up @@ -68,6 +69,7 @@
"babel-plugin-react-require": "^3.1.3",
"eslint": "^8.27.0",
"node-stdlib-browser": "^1.2.0",
"patch-package": "^6.5.1",
"prettier": "^2.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
12 changes: 4 additions & 8 deletions packages/connect-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@
"files": [
"dist"
],
"node": ">=14.16",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"exports": "./dist/index.js",
"scripts": {
"build": "tsup",
"dev": "DEV=true tsup --watch",
Expand All @@ -39,7 +34,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@reduxjs/toolkit": "^1.9.1",
"@reduxjs/toolkit": "2.0.0-alpha.2",
"@shopify/gate-context-client": "*",
"@storybook/react": "^6.5.13",
"framer-motion": "^8.5.0",
Expand All @@ -48,6 +43,7 @@
"react-i18next": "^12.1.4",
"react-redux": "^8.0.5",
"react-use-measure": "^2.1.1",
"redux": "^5.0.0-alpha.2",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"siwe": "^1.1.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {isAnyOf, ListenerEffect} from '@reduxjs/toolkit';
import {isAnyOf} from '@reduxjs/toolkit';
import type {ListenerEffect} from '@reduxjs/toolkit';

import {
addWallet,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {createAsyncThunk, createSlice, PayloadAction} from '@reduxjs/toolkit';
import {createAsyncThunk, createSlice} from '@reduxjs/toolkit';
import type {PayloadAction} from '@reduxjs/toolkit';
import {utils} from 'ethers';
import {SiweMessage} from 'siwe';

Expand Down
13 changes: 13 additions & 0 deletions patches/redux+5.0.0-alpha.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/redux/types/types/store.d.ts b/node_modules/redux/types/types/store.d.ts
index 3eb436f..bff9739 100644
--- a/node_modules/redux/types/types/store.d.ts
+++ b/node_modules/redux/types/types/store.d.ts
@@ -24,7 +24,7 @@ declare const $CombinedState: unique symbol;
interface EmptyObject {
readonly [$CombinedState]?: undefined;
}
-export type CombinedState<S> = EmptyObject & S;
+export type CombinedState<S> = S;
/**
* Recursively makes combined state objects partial. Only combined state _root
* objects_ (i.e. the generated higher level object with keys mapping to
70 changes: 57 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2797,14 +2797,14 @@
resolved "https://registry.yarnpkg.com/@react-theming/theme-swatch/-/theme-swatch-1.0.0.tgz#ba3ffc8e69c65a220b9bf1da0c2d5134287037e8"
integrity sha512-tOzDTUbFB5uQLMVHJ4fXWYZ4i7JIKjyrS7SlHDoscRZqM69lmT+s9fSZoD1/InTdX0M7Jh8thXF0SzeoxnD1/Q==

"@reduxjs/toolkit@^1.9.1":
version "1.9.1"
resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-1.9.1.tgz#4c34dc4ddcec161535288c60da5c19c3ef15180e"
integrity sha512-HikrdY+IDgRfRYlCTGUQaiCxxDDgM1mQrRbZ6S1HFZX5ZYuJ4o8EstNmhTwHdPl2rTmLxzwSu0b3AyeyTlR+RA==
"@reduxjs/toolkit@2.0.0-alpha.2":
version "2.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/@reduxjs/toolkit/-/toolkit-2.0.0-alpha.2.tgz#ba51db7a3c26174784d46975cc557b328d194a2c"
integrity sha512-2qVk4C37XSbUCC6f45Wsl5Blam/YeUpgwH2p+L1mN86rroNwtNSFk133C78BpfFan9H9KNKBtlj3BdCudNWU6A==
dependencies:
immer "^9.0.16"
redux "^4.2.0"
redux-thunk "^2.4.2"
redux "5.0.0-alpha.2"
redux-thunk "3.0.0-alpha.1"
reselect "^4.1.7"

"@rollup/plugin-inject@^4.0.4":
Expand Down Expand Up @@ -5296,6 +5296,11 @@
resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"
integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==

"@yarnpkg/lockfile@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==

JSONStream@^1.3.5:
version "1.3.5"
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0"
Expand Down Expand Up @@ -7178,7 +7183,7 @@ cross-spawn@^5.1.0:
shebang-command "^1.2.0"
which "^1.2.9"

cross-spawn@^6.0.0:
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
Expand Down Expand Up @@ -9085,6 +9090,13 @@ [email protected]:
micromatch "^4.0.2"
pkg-dir "^4.2.0"

find-yarn-workspace-root@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==
dependencies:
micromatch "^4.0.2"

flat-cache@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
Expand Down Expand Up @@ -10946,6 +10958,13 @@ kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3:
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==

klaw-sync@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c"
integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==
dependencies:
graceful-fs "^4.1.11"

kleur@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
Expand Down Expand Up @@ -12036,7 +12055,7 @@ onetime@^5.1.2:
dependencies:
mimic-fn "^2.1.0"

open@^7.0.3:
open@^7.0.3, open@^7.4.2:
version "7.4.2"
resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321"
integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==
Expand Down Expand Up @@ -12293,6 +12312,26 @@ pascalcase@^0.1.1:
resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==

patch-package@^6.5.1:
version "6.5.1"
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.5.1.tgz#3e5d00c16997e6160291fee06a521c42ac99b621"
integrity sha512-I/4Zsalfhc6bphmJTlrLoOcAF87jcxko4q0qsv4bGcurbr8IskEOtdnt9iCmsQVGL1B+iUhSQqweyTLJfCF9rA==
dependencies:
"@yarnpkg/lockfile" "^1.1.0"
chalk "^4.1.2"
cross-spawn "^6.0.5"
find-yarn-workspace-root "^2.0.0"
fs-extra "^9.0.0"
is-ci "^2.0.0"
klaw-sync "^6.0.0"
minimist "^1.2.6"
open "^7.4.2"
rimraf "^2.6.3"
semver "^5.6.0"
slash "^2.0.0"
tmp "^0.0.33"
yaml "^1.10.2"

[email protected]:
version "0.0.1"
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a"
Expand Down Expand Up @@ -13268,12 +13307,17 @@ redux-persist@^6.0.0:
resolved "https://registry.yarnpkg.com/redux-persist/-/redux-persist-6.0.0.tgz#b4d2972f9859597c130d40d4b146fecdab51b3a8"
integrity sha512-71LLMbUq2r02ng2We9S215LtPu3fY0KgaGE0k8WRgl6RkqxtGfl7HUozz1Dftwsb0D/5mZ8dwAaPbtnzfvbEwQ==

redux-thunk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.2.tgz#b9d05d11994b99f7a91ea223e8b04cf0afa5ef3b"
integrity sha512-+P3TjtnP0k/FEjcBL5FZpoovtvrTNT/UXd4/sluaSyrURlSlhLSzEdfsTBW7WsKB6yPvgd7q/iZPICFjW4o57Q==
[email protected]:
version "3.0.0-alpha.1"
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-3.0.0-alpha.1.tgz#68fafb65a4caa353a54e189518dffa61d6c03907"
integrity sha512-j547PgblEdRakm9PCUwtZ0C1amoiG8rbSliT8AKUEunVsmtemM22C8UOQ+8EcVP5tgHxwd/L0gUyLGA/JJanjQ==

[email protected], redux@^5.0.0-alpha.2:
version "5.0.0-alpha.2"
resolved "https://registry.yarnpkg.com/redux/-/redux-5.0.0-alpha.2.tgz#73f9da989cd13cc685adc56857647584a278727e"
integrity sha512-elxHLhB3SFrwq0N9f4P/jC25JqmPcilnI4NnvZvUOOrSTc2dIl9w10wgc4m1OGEPXdumqOGlpykQeD1rhEwIjg==

redux@^4.0.0, redux@^4.2.0:
redux@^4.0.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.2.0.tgz#46f10d6e29b6666df758780437651eeb2b969f13"
integrity sha512-oSBmcKKIuIR4ME29/AeNUnl5L+hvBq7OaJWzaptTQJAntaPvxIJqfnjbaEiCzzaIz+XmVILfqAM3Ob0aXLPfjA==
Expand Down

0 comments on commit 003349e

Please sign in to comment.