Skip to content

Commit f1881ac

Browse files
committed
Updated React and added to issues
1 parent dc625f4 commit f1881ac

File tree

9 files changed

+6368
-2945
lines changed

9 files changed

+6368
-2945
lines changed

demo/.env.analyse

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ANALYSE_BUNDLE=true

demo/config/webpack.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpack
2727
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
2828
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
2929
const postcssNormalize = require('postcss-normalize');
30+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
31+
const DuplicatePackageCheckerPlugin = require("duplicate-package-checker-webpack-plugin");
3032

3133
// Source maps are resource heavy and can cause out of memory issue for large source files.
3234
const shouldUseSourceMap = process.env.GENERATE_SOURCEMAP !== 'false';
@@ -272,7 +274,7 @@ module.exports = function(webpackEnv) {
272274
// Support React Native Web
273275
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
274276
'react-native': 'react-native-web',
275-
react: path.resolve( '__dirname', '..', 'node_modules', 'react')
277+
'react': path.resolve('./node_modules/react')
276278
},
277279
plugins: [
278280
// Adds support for installing with Plug'n'Play, leading to faster installs and adding
@@ -476,6 +478,8 @@ module.exports = function(webpackEnv) {
476478
],
477479
},
478480
plugins: [
481+
new DuplicatePackageCheckerPlugin(),
482+
process.env.ANALYSE_BUNDLE === 'true' && new BundleAnalyzerPlugin(),
479483
new MonacoWebpackPlugin({
480484
// available options are documented at https://github.com/Microsoft/monaco-editor-webpack-plugin#options
481485
languages: ['typescript']

demo/package-lock.json

Lines changed: 6176 additions & 2743 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"css-loader": "2.1.1",
2525
"dotenv": "6.2.0",
2626
"dotenv-expand": "4.2.0",
27+
"env-cmd": "^9.0.3",
2728
"eslint": "^5.16.0",
2829
"eslint-config-react-app": "^4.0.1",
2930
"eslint-loader": "2.1.2",
@@ -53,10 +54,10 @@
5354
"postcss-normalize": "7.0.1",
5455
"postcss-preset-env": "6.6.0",
5556
"postcss-safe-parser": "4.0.1",
56-
"react": "16.8.6",
57+
"react": "^16.9.0",
5758
"react-app-polyfill": "^1.0.1",
5859
"react-dev-utils": "^9.0.1",
59-
"react-dom": "16.8.6",
60+
"react-dom": "^16.8.6",
6061
"react-ga": "^2.6.0",
6162
"react-monaco-editor": "^0.28.0",
6263
"react-spaces": "file:../react-spaces",
@@ -70,14 +71,17 @@
7071
"typescript": "^3.5.3",
7172
"url-loader": "1.1.2",
7273
"webpack": "4.29.6",
74+
"webpack-bundle-analyser": "^1.4.0",
75+
"webpack-bundle-analyzer": "^3.4.1",
7376
"webpack-dev-server": "3.2.1",
7477
"webpack-manifest-plugin": "2.0.4",
7578
"workbox-webpack-plugin": "4.2.0"
7679
},
7780
"scripts": {
7881
"start": "node scripts/start.js",
7982
"build": "node scripts/build.js",
80-
"test": "node scripts/test.js"
83+
"test": "node scripts/test.js",
84+
"analyse": "env-cmd -f .env.analyse node scripts/build.js"
8185
},
8286
"eslintConfig": {
8387
"extends": "react-app"
@@ -144,5 +148,8 @@
144148
"presets": [
145149
"react-app"
146150
]
151+
},
152+
"devDependencies": {
153+
"duplicate-package-checker-webpack-plugin": "^3.0.0"
147154
}
148155
}

demo/src/docs/KnownIssues.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ export const KnownIssues = () => {
66
<h2 id="issues">Known issues / limitations</h2>
77

88
<ul>
9+
<li>
10+
The components in <strong>v0.1.13</strong> have been changed to use React Hooks. This can cause problems if there are
11+
multiple versions of React loaded. If you are using webpack you can add to your webpack config:
12+
13+
<pre style={{ marginTop: 15 }}>
14+
{`alias: { 'react': path.resolve('./node_modules/react') }`}
15+
</pre>
16+
17+
This will ensure that all references to React resolve to the same version.
18+
</li>
919
<li>
1020
Rendering an anchored horizontal space and an anchored vertical space within the same parent space will cause a gap
1121
to appear in the corner where the two anchored spaces meet. You can workaround this by using nested <strong>&lt;Fill /&gt;</strong>

demo/src/docs/VersionHistory.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ export const VersionHistory = () => {
55
<>
66
<h2 id="changes">Version history</h2>
77

8+
<div>
9+
<h3>0.1.13</h3>
10+
<ul>
11+
<li>
12+
Refactored spaces as functional component using hooks.
13+
</li>
14+
<li>
15+
Fixed className type on &lt;ViewPort /&gt; component.
16+
</li>
17+
</ul>
18+
</div>
819
<div>
920
<h3>0.1.11 - 0.1.12</h3>
1021
<ul>

0 commit comments

Comments
 (0)