Skip to content

Commit

Permalink
Revert "chore(umi-plugin-react): upgrade the preact version to 10.x (u…
Browse files Browse the repository at this point in the history
…mijs#3855)" (umijs#3921)

This reverts commit 275cc74.
  • Loading branch information
ycjcl868 authored Jan 16, 2020
1 parent 57bceda commit 6654dea
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 204 deletions.
3 changes: 2 additions & 1 deletion packages/umi-plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"fastclick": "1.0.6",
"lodash": "4.17.13",
"mustache": "3.0.1",
"preact": "10.1.1",
"preact": "8.4.2",
"preact-compat": "3.19.0",
"register-service-worker": "1.6.2",
"umi-plugin-dll": "1.6.0",
"umi-plugin-dva": "1.11.0",
Expand Down
41 changes: 18 additions & 23 deletions packages/umi-plugin-react/src/plugins/library.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,47 @@
import { dirname } from 'path';
import { dirname, join } from 'path';

export default function(api, options) {
const { cwd, compatDirname } = api;

api.chainWebpackConfig(webpackConfig => {
if (options === 'preact') {
webpackConfig.resolve.alias
.set('preact/debug', require.resolve('preact/debug'))
.set(
'preact',
compatDirname(
'preact/package.json',
cwd,
dirname(require.resolve('preact/package.json')),
),
)
.set('preact/devtools', require.resolve('preact/devtools'))
.set('preact', require.resolve('preact'))
.set(
'react',
compatDirname(
'preact/compat/package.json',
'preact-compat/package.json',
cwd,
dirname(require.resolve('preact/compat/package.json')),
dirname(require.resolve('preact-compat/package.json')),
),
)
.set(
'react-dom/test-utils',
'react-dom',
compatDirname(
'preact/test-utils/package.json',
'preact-compat/package.json',
cwd,
dirname(require.resolve('preact/test-utils/package.json')),
dirname(require.resolve('preact-compat/package.json')),
),
)
.set(
'react-dom',
compatDirname(
'preact/compat/package.json',
cwd,
dirname(require.resolve('preact/compat/package.json')),
'create-react-class',
join(
compatDirname(
'preact-compat/lib/create-react-class',
cwd,
dirname(require.resolve('preact-compat/lib/create-react-class')),
),
'create-react-class',
),
)
.set('react-addons-css-transition-group', 'preact-css-transition-group');
);
}
});

api.addEntryImport(() => {
if (process.env.NODE_ENV === 'development' && options === 'preact') {
return {
source: 'preact/debug',
source: 'preact/devtools',
};
} else {
return [];
Expand Down
63 changes: 58 additions & 5 deletions packages/umi-plugin-react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,13 @@ ignore-walk@^3.0.1:
dependencies:
minimatch "^3.0.4"

immutability-helper@^2.7.1:
version "2.9.1"
resolved "https://registry.yarnpkg.com/immutability-helper/-/immutability-helper-2.9.1.tgz#71c423ba387e67b6c6ceba0650572f2a2a6727df"
integrity sha512-r/RmRG8xO06s/k+PIaif2r5rGc3j4Yhc01jSBfwPCXDLYZwp/yxralI37Df1mwmuzcCsen/E/ITKcTEvc1PQmQ==
dependencies:
invariant "^2.2.0"

immutable@^3.7.4:
version "3.8.2"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
Expand Down Expand Up @@ -1540,6 +1547,13 @@ ini@~1.3.0:
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==

invariant@^2.2.0:
version "2.2.4"
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
dependencies:
loose-envify "^1.0.0"

is-accessor-descriptor@^0.1.6:
version "0.1.6"
resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
Expand Down Expand Up @@ -2402,16 +2416,50 @@ posix-character-classes@^0.1.0:
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=

[email protected]:
version "10.1.1"
resolved "https://registry.npmjs.org/preact/-/preact-10.1.1.tgz#1fd12e3ed6b74993ed8805f68e9d953cc914889a"
integrity sha512-mKW7Cdn68XMhdes0FjyIbA8+IVPsj3aIuAEQlZVkj9E2VhujWcXZEfwirBoXK6qZYfj1djaTBDCFKjAu1sK93w==
[email protected]:
version "3.19.0"
resolved "https://registry.yarnpkg.com/preact-compat/-/preact-compat-3.19.0.tgz#a71457b6a3bf051690a4411603bc2085aa061c2f"
integrity sha512-f83A4hIhH8Uzhb9GbIcGk8SM19ffWlwP9mDaYwQdRnMdekZwcCA7eIAbeV4EMQaV9C0Yuy8iKgBAtyTKPZQt/Q==
dependencies:
immutability-helper "^2.7.1"
preact-context "^1.1.3"
preact-render-to-string "^3.8.2"
preact-transition-group "^1.1.1"
prop-types "^15.6.2"
standalone-react-addons-pure-render-mixin "^0.1.1"

preact-context@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/preact-context/-/preact-context-1.1.3.tgz#26d06db0f39d8d9c890df5ada9a99a943586ec68"
integrity sha512-2LcpjZG6JUhBgqziVH+nJtmu9PS5KzWoFx6wX2svXw0oBHhU6e8tQZhEkKLMOAxdmj7gVzApfS/B6V+fjJ/llA==

preact-render-to-string@^3.8.2:
version "3.8.2"
resolved "https://registry.yarnpkg.com/preact-render-to-string/-/preact-render-to-string-3.8.2.tgz#bd72964d705a57da3a9e72098acaa073dd3ceff9"
integrity sha512-przuZPajiurStGgxMoJP0EJeC4xj5CgHv+M7GfF3YxAdhGgEWAkhOSE0xympAFN20uMayntBZpttIZqqLl77fw==
dependencies:
pretty-format "^3.5.1"

preact-transition-group@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/preact-transition-group/-/preact-transition-group-1.1.1.tgz#f0a49327ea515ece34ea2be864c4a7d29e5d6e10"
integrity sha1-8KSTJ+pRXs406ivoZMSn0p5dbhA=

[email protected]:
version "8.4.2"
resolved "https://registry.yarnpkg.com/preact/-/preact-8.4.2.tgz#1263b974a17d1ea80b66590e41ef786ced5d6a23"
integrity sha512-TsINETWiisfB6RTk0wh3/mvxbGRvx+ljeBccZ4Z6MPFKgu/KFGyf2Bmw3Z/jlXhL5JlNKY6QAbA9PVyzIy9//A==

pretty-bytes@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-4.0.2.tgz#b2bf82e7350d65c6c33aa95aaa5a4f6327f61cd9"
integrity sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=

pretty-format@^3.5.1:
version "3.8.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385"
integrity sha1-v77VbV6ad2ZF9LH/eqGjrE+jw4U=

process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
Expand All @@ -2434,7 +2482,7 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

[email protected], prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.5.9, prop-types@^15.6.0, prop-types@^15.7.2:
[email protected], prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.5.9, prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
Expand Down Expand Up @@ -3516,6 +3564,11 @@ ssri@^6.0.1:
dependencies:
figgy-pudding "^3.5.1"

standalone-react-addons-pure-render-mixin@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/standalone-react-addons-pure-render-mixin/-/standalone-react-addons-pure-render-mixin-0.1.1.tgz#3c7409f4c79c40de9ac72c616cf679a994f37551"
integrity sha1-PHQJ9MecQN6axyxhbPZ5qZTzdVE=

static-extend@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
Expand Down
50 changes: 0 additions & 50 deletions packages/umi/test/fixtures/build/preact/.umirc.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/umi/test/fixtures/build/preact/Loading.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/umi/test/fixtures/build/preact/locales/en-US.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/umi/test/fixtures/build/preact/locales/zh-CN.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/umi/test/fixtures/build/preact/package.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/umi/test/fixtures/build/preact/pages/$user.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/umi/test/fixtures/build/preact/pages/a.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/umi/test/fixtures/build/preact/pages/b/_mock.js

This file was deleted.

Empty file.
21 changes: 0 additions & 21 deletions packages/umi/test/fixtures/build/preact/pages/index.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/umi/test/fixtures/build/preact/public/script2.js

This file was deleted.

80 changes: 0 additions & 80 deletions packages/umi/test/fixtures/build/preact/test.js

This file was deleted.

0 comments on commit 6654dea

Please sign in to comment.