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

chore: remove rax-compile-config #3806

Merged
merged 3 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion examples/with-rax/src/components/BuggyCounter/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createElement, Component } from 'rax';
import Text from 'rax-text';

class BuggyCounter extends Component {
constructor(props) {
Expand All @@ -18,7 +19,7 @@ class BuggyCounter extends Component {
// Simulate a JS error
throw new Error('I crashed!');
}
return <h1 onClick={this.handleClick}>{this.state.counter}</h1>;
return <Text onClick={this.handleClick}>{this.state.counter}</Text>;
}
}

Expand Down
2 changes: 1 addition & 1 deletion examples/with-rax/src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function Home(props) {
<Logo />
<Text className="title">{props?.data?.title || 'Welcome to Your Rax App'}</Text>
<Text className="info">{props?.data?.info || 'More information about Rax'}</Text>
<Text className="info" onClick={() => history.push('/about?id=1')}>Go About</Text>
<Text className="info" onClick={() => history.push('/about', { id: 1 })}>Go About</Text>
</View>
);
}
Expand Down
1 change: 1 addition & 0 deletions packages/create-app-shared/src/appLifeCycles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ if (isMiniAppPlatform) {
const globalEvent = __weex_require__('@weex-module/globalEvent');
globalEvent.addEventListener('WXApplicationDidBecomeActiveEvent', function() {
router.current.visibiltyState = true;
console.error(11111);
Copy link
Collaborator

Choose a reason for hiding this comment

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

调试脚本记得移除

// Emit app show
emit(SHOW);
// Emit page show
Expand Down
5 changes: 3 additions & 2 deletions packages/plugin-rax-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
"fs-extra": "^9.0.1",
"klaw-sync": "^6.0.0",
"qs": "^6.9.4",
"rax-compile-config": "^0.2.16",
"rax-server-renderer": "^1.2.0",
"webpack-sources": "^2.0.0",
"webpack": "^4.0.0",
"@builder/app-helpers": "1.0.0-0"
"@builder/app-helpers": "1.0.0-0",
"react-dev-utils": "^10.0.0",
"chalk": "^4.1.0"
}
}
5 changes: 2 additions & 3 deletions packages/plugin-rax-web/src/DocumentPlugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const path = require('path');
const fs = require('fs-extra');
const webpack = require('webpack');
const { RawSource } = require('webpack-sources');
const { handleWebpackErr } = require('rax-compile-config');
const { parse, print } = require('error-stack-tracey');

const PLUGIN_NAME = 'DocumentPlugin';
Expand Down Expand Up @@ -126,7 +125,7 @@ module.exports = class DocumentPlugin {
// Run as child to get child compilation
childCompiler.runAsChild((err, entries, childCompilation) => {
if (err) {
handleWebpackErr(err);
console.log(err);
} else {
fileDependencies = childCompilation.fileDependencies;
}
Expand Down Expand Up @@ -182,7 +181,7 @@ async function generateHtml(compilation, options) {
const errorStack = await parse(error, documentContent);
// Prevent print duplicate error info
if (!hasPrintError) {
print(error.message, errorStack);
print(error.message, errorStack.reverse());
Copy link
Collaborator

Choose a reason for hiding this comment

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

错误栈是反的?

hasPrintError = true;
}

Expand Down
4 changes: 1 addition & 3 deletions packages/plugin-rax-web/src/setEntry.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const path = require('path');
const fs = require('fs-extra');

const { hmrClient } = require('rax-compile-config');

module.exports = (config, context) => {
const { rootDir, command } = context;
const isDev = command === 'start';
Expand All @@ -15,7 +13,7 @@ module.exports = (config, context) => {
.use('loader');

if (isDev) {
entryConfig.add(hmrClient);
entryConfig.add(require.resolve('react-dev-utils/webpackHotDevClient'));
}
entryConfig.add(appEntry);
};
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-rax-weex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"dependencies": {
"@builder/mpa-config": "1.0.0-0",
"fs-extra": "^9.0.1",
"rax-compile-config": "^0.2.16",
"webpack-sources": "^2.0.0",
"@builder/app-helpers": "1.0.0-0"
"@builder/app-helpers": "1.0.0-0",
"react-dev-utils": "^10.0.0"
}
}
3 changes: 1 addition & 2 deletions packages/plugin-rax-weex/src/setEntry.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { hmrClient } = require('rax-compile-config');
const fs = require('fs-extra');
const path = require('path');

Expand All @@ -11,7 +10,7 @@ module.exports = (config, context) => {
const entryConfig = config.entry('index');

if (isDev) {
entryConfig.add(hmrClient);
entryConfig.add(require.resolve('react-dev-utils/webpackHotDevClient'));
}
entryConfig.add(appEntry);
};
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"dependencies": {
"@builder/mpa-config": "1.0.0-0",
"chalk": "^4.1.0",
"rax-compile-config": "^0.2.16",
"fs-extra": "^9.0.1",
"error-stack-tracey": "^0.1.3",
"qs": "^6.9.4",
"@builder/app-helpers": "1.0.0-0"
"@builder/app-helpers": "1.0.0-0",
"react-dev-utils": "^10.0.0"
}
}
4 changes: 1 addition & 3 deletions packages/plugin-ssr/src/web/setDev.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
const { hmrClient } = require('rax-compile-config');

module.exports = (config) => {
const allEntries = config.entryPoints.entries();
// eslint-disable-next-line
for (const entryName in allEntries) {
if (Object.prototype.hasOwnProperty.call(allEntries, entryName)) {
// remove hmrClient
config.entry(entryName).delete(hmrClient);
config.entry(entryName).delete(require.resolve('react-dev-utils/webpackHotDevClient'));
}
}

Expand Down
22 changes: 21 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5005,6 +5005,26 @@ build-plugin-app-core@0.1.23-0:
react-app-renderer "0.1.10"
universal-env "^3.0.0"

build-plugin-miniapp@0.1.6:
version "0.1.6"
resolved "https://registry.npm.taobao.org/build-plugin-miniapp/download/build-plugin-miniapp-0.1.6.tgz#b349e1b51617a190088e0aab3ce215f1351d46b6"
integrity sha1-s0nhtRYXoZAIjgqrPOIV8TUdRrY=
dependencies:
miniapp-builder-shared "^0.1.1"
miniapp-runtime-config "^0.1.1"

build-plugin-rax-miniapp@1.0.4-1:
version "1.0.4-1"
resolved "https://registry.npm.taobao.org/build-plugin-rax-miniapp/download/build-plugin-rax-miniapp-1.0.4-1.tgz#706dd883bf82531c9795b37eedc2f7bb8c588c62"
integrity sha1-cG3Yg7+CUxyXlbN+7cL3u4xYjGI=
dependencies:
copy-webpack-plugin "^5.0.4"
fs-extra "^9.0.1"
miniapp-builder-shared "^0.1.6"
miniapp-compile-config "^0.1.3"
miniapp-runtime-config "^0.1.3"
webpack-sources "^2.0.0"

builtin-status-codes@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/builtin-status-codes/download/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
Expand Down Expand Up @@ -15158,7 +15178,7 @@ rc@^1.2.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-dev-utils@^10.2.1:
react-dev-utils@^10.0.0, react-dev-utils@^10.2.1:
version "10.2.1"
resolved "https://registry.npm.taobao.org/react-dev-utils/download/react-dev-utils-10.2.1.tgz#f6de325ae25fa4d546d09df4bb1befdc6dd19c19"
integrity sha1-9t4yWuJfpNVG0J30uxvv3G3RnBk=
Expand Down