Remove jsx-runtime alias for React 18 (#1051)

* Remove jsx-runtime alias for React 18

* Adjust lint
This commit is contained in:
Jaco 2022-04-23 08:53:51 +02:00 committed by GitHub
parent 053082e308
commit 4f0bde1500
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 328 additions and 309 deletions

View File

@ -34,16 +34,16 @@
},
"devDependencies": {
"@babel/core": "^7.17.9",
"@polkadot/dev": "^0.66.1",
"@polkadot/dev": "^0.66.9",
"@types/jest": "^27.4.1",
"i18next-scanner": "^3.1.0",
"sinon-chrome": "^3.0.1"
},
"resolutions": {
"@polkadot/api": "^8.0.1",
"@polkadot/api": "^8.1.1",
"@polkadot/keyring": "^9.0.1",
"@polkadot/networks": "^9.0.1",
"@polkadot/types": "^8.0.1",
"@polkadot/types": "^8.1.1",
"@polkadot/util": "^9.0.1",
"@polkadot/util-crypto": "^9.0.1",
"@polkadot/x-fetch": "^9.0.1",

View File

@ -21,15 +21,15 @@
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/api": "^8.0.1",
"@polkadot/api": "^8.1.1",
"@polkadot/extension-chains": "^0.43.1",
"@polkadot/extension-dapp": "^0.43.1",
"@polkadot/extension-inject": "^0.43.1",
"@polkadot/keyring": "^9.0.1",
"@polkadot/networks": "^9.0.1",
"@polkadot/phishing": "^0.11.12",
"@polkadot/rpc-provider": "^8.0.1",
"@polkadot/types": "^8.0.1",
"@polkadot/phishing": "^0.11.77",
"@polkadot/rpc-provider": "^8.1.1",
"@polkadot/types": "^8.1.1",
"@polkadot/ui-keyring": "^2.0.1",
"@polkadot/ui-settings": "^2.0.1",
"@polkadot/util": "^9.0.1",

View File

@ -23,7 +23,7 @@
"@babel/runtime": "^7.17.9",
"@metamask/detect-provider": "^1.2.0",
"@polkadot/extension-inject": "^0.43.1",
"@polkadot/types": "^8.0.1",
"@polkadot/types": "^8.1.1",
"@polkadot/util": "^9.0.1",
"web3": "^1.7.3"
},

View File

@ -30,15 +30,13 @@ function throwError (method: string): never {
// internal helper to map from Array<InjectedAccount> -> Array<InjectedAccountWithMeta>
function mapAccounts (source: string, list: InjectedAccount[], ss58Format?: number): InjectedAccountWithMeta[] {
return list.map(({ address, genesisHash, name, type }): InjectedAccountWithMeta => {
const encodedAddress = address.length === 42 ? address : encodeAddress(decodeAddress(address), ss58Format);
return ({
address: encodedAddress,
meta: { genesisHash, name, source },
type
});
});
return list.map(({ address, genesisHash, name, type }): InjectedAccountWithMeta => ({
address: address.length === 42
? address
: encodeAddress(decodeAddress(address), ss58Format),
meta: { genesisHash, name, source },
type
}));
}
// have we found a properly constructed window.injectedWeb3

View File

@ -18,8 +18,8 @@
"main": "index.js",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/rpc-provider": "^8.0.1",
"@polkadot/types": "^8.0.1",
"@polkadot/rpc-provider": "^8.1.1",
"@polkadot/types": "^8.1.1",
"@polkadot/util": "^9.0.1",
"@polkadot/util-crypto": "^9.0.1",
"@polkadot/x-global": "^9.0.1"

View File

@ -31,21 +31,21 @@
"@polkadot/networks": "^9.0.1",
"@polkadot/react-identicon": "^2.0.1",
"@polkadot/react-qr": "^2.0.1",
"@polkadot/types": "^8.0.1",
"@polkadot/types-augment": "^8.0.1",
"@polkadot/types": "^8.1.1",
"@polkadot/types-augment": "^8.1.1",
"@polkadot/ui-keyring": "^2.0.1",
"@polkadot/ui-settings": "^2.0.1",
"@polkadot/util": "^9.0.1",
"@polkadot/util-crypto": "^9.0.1",
"file-saver": "^2.0.5",
"i18next": "^21.6.15",
"i18next": "^21.6.16",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-dropzone": "^11.7.1",
"react-i18next": "^11.16.5",
"react-i18next": "^11.16.7",
"react-is": "^18.0.0",
"react-router": "^5.2.1",
"react-router-dom": "^5.3.0",
"react-router": "^5.3.1",
"react-router-dom": "^5.3.1",
"styled-components": "^5.3.5"
},
"devDependencies": {
@ -54,7 +54,7 @@
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/file-saver": "^2.0.5",
"@types/react-copy-to-clipboard": "^5.0.2",
"@types/react-dom": "^18.0.0",
"@types/react-dom": "^18.0.2",
"@types/react-router": "^5.1.18",
"@types/react-router-dom": "^5.3.3",
"@types/sinon-chrome": "^2.2.11",

View File

@ -42,7 +42,6 @@ function WebsiteEntry ({ className = '', info, removeAuth, toggleAuth, url }: Pr
onChange={switchAccess}
uncheckedLabel={t<string>('denied')}
/>
<div
className='removeAuth'
onClick={_removeAuth}

View File

@ -52,7 +52,7 @@ describe('Derive', () => {
<ActionContext.Provider value={onActionStub}>
<AccountContext.Provider
value={{
accounts: accounts,
accounts,
hierarchy: buildHierarchy(accounts)
}}
>

View File

@ -22,8 +22,8 @@
"@polkadot/extension-ui": "^0.43.1"
},
"devDependencies": {
"@polkadot/dev": "^0.66.1",
"babel-loader": "^8.2.4",
"@polkadot/dev": "^0.66.9",
"babel-loader": "^8.2.5",
"browser-resolve": "^2.0.0",
"buffer": "^6.0.3",
"copy-webpack-plugin": "^10.2.4",

View File

@ -87,10 +87,7 @@ module.exports = (entry, alias = {}) => ({
alias: packages.reduce((alias, p) => ({
...alias,
[`@polkadot/${p}`]: path.resolve(__dirname, `../${p}/src`)
}), {
...alias,
'react/jsx-runtime': require.resolve('react/jsx-runtime')
}),
}), alias),
extensions: ['.js', '.jsx', '.ts', '.tsx'],
fallback: {
crypto: require.resolve('crypto-browserify'),

575
yarn.lock

File diff suppressed because it is too large Load Diff