Skip to content

Commit

Permalink
[chore] Improved HoC to support ref passing (#862)
Browse files Browse the repository at this point in the history
* Improved HoC to support ref passing

* [chore] Replace createFactory with createElement

* Added some poliflls

* Static methods must be copied over

* Added displayName for Nav and Dropdown

* Update tests

* Correct naming of wrapped DefaultPropsComponent for better DevTools usability (#872)

* defaultProps helper should specify displayName for better React Dev Tools usability

* Fix functional component tests

Co-authored-by: Simon Guo <simonguo.2009@gmail.com>

Co-authored-by: Godfery <hiyangguo@qq.com>
Co-authored-by: Luca <mail@lucakillmaier.com>
  • Loading branch information
3 people committed Mar 2, 2020
1 parent bae715d commit 87e50d9
Show file tree
Hide file tree
Showing 72 changed files with 630 additions and 920 deletions.
7 changes: 7 additions & 0 deletions docs/client/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'core-js/modules/es7.array.includes';
import 'core-js/modules/es6.array.iterator';
import 'core-js/modules/es6.array.of';
import 'core-js/modules/es6.array.species';
import 'core-js/modules/es6.array.for-each';
import 'core-js/modules/es6.function.has-instance';
import 'core-js/modules/es6.map';
import 'core-js/modules/es6.number.constructor';
Expand Down Expand Up @@ -61,3 +62,9 @@ import 'core-js/modules/es6.weak-set';

// Specialized Packages:
Object.assign = assign;

// missing forEach on NodeList for IE11
if (window.NodeList && !NodeList.prototype.forEach) {
// @ts-ignore
NodeList.prototype.forEach = Array.prototype.forEach;
}
61 changes: 18 additions & 43 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"check:type": "tsc",
"dev": "concurrently \"npm run dev:server\" \"npm run dev:theme\"",
"dev:styles": "cross-env STYLE_DEBUG=STYLE npm run dev",
"dev:server": "cross-env NODE_ENV=development node server.js",
"dev:theme": "webpack-dev-server --mode development --hot --config webpack.theme.config.js",
"build": "npm run build:theme && next build && next export",
Expand Down
9 changes: 9 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
/**
* Run all tests: `npm run tdd`
* Run all styles tests: `M=styles npm run tdd`
Expand All @@ -6,6 +7,7 @@
*/

const path = require('path');
const webpack = require('webpack');

const webpackConfig = {
output: {
Expand All @@ -18,6 +20,13 @@ const webpackConfig = {
'@test': path.resolve(__dirname, './test')
}
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
RUN_ENV: JSON.stringify(process.env.RUN_ENV)
}
})
],
module: {
rules: [
{
Expand Down
26 changes: 14 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"lint-ts": "eslint src/**/*.{ts,tsx}",
"lint-js": "eslint src/**/*.js",
"lint": "npm run lint-ts && npm run lint-style",
"tdd": "karma start",
"test": "npm run format:check && npm run lint && cross-env NODE_ENV=coverage karma start --single-run && npm run test-styles",
"tdd": "cross-env RUN_ENV=test karma start",
"test": "npm run format:check && npm run lint && cross-env NODE_ENV=coverage RUN_ENV=test karma start --single-run && npm run test-styles",
"test-styles": "node test/stylesSpec.js",
"coveralls": "cat ./coverage/lcov/lcov.info | ./node_modules/.bin/coveralls",
"prepublishOnly": "npm run build"
Expand Down Expand Up @@ -59,7 +59,7 @@
"prop-types": "^15.7.2",
"react-lifecycles-compat": "^3.0.4",
"react-virtualized": "^9.21.0",
"recompose": "^0.26.0",
"recompose": "^0.30.0",
"rsuite-table": "^3.8.4",
"rsuite-utils": "^2.2.1",
"schema-typed": "^1.4.0"
Expand All @@ -86,8 +86,8 @@
"@types/classnames": "^2.2.8",
"@types/lodash": "^4.14.134",
"@types/prop-types": "^15.7.1",
"@types/react": "^16.8.20",
"@types/react-dom": "^16.8.4",
"@types/react": "^16.9.21",
"@types/react-dom": "^16.9.5",
"@types/recompose": "^0.30.6",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
Expand Down Expand Up @@ -140,8 +140,8 @@
"make-dir": "^1.3.0",
"mocha": "^2.5.3",
"prettier": "^1.19.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"sinon": "^2.3.8",
"sinon-chai": "^2.12.0",
"style-loader": "^0.20.3",
Expand Down
Loading

1 comment on commit 87e50d9

@vercel
Copy link

@vercel vercel bot commented on 87e50d9 Mar 2, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.