File tree Expand file tree Collapse file tree 5 files changed +39
-3
lines changed Expand file tree Collapse file tree 5 files changed +39
-3
lines changed Original file line number Diff line number Diff line change 6464 "settle-promise" : " 1.0.0" ,
6565 "source-map" : " 0.5.6" ,
6666 "terser-webpack-plugin" : " 1.2.3" ,
67- "webpack" : " ^4.29.6 "
67+ "webpack" : " ^4.35.0 "
6868 },
6969 "jest" : {
7070 "setupFiles" : [
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ class App extends Component {
6868 // This works around an issue of a duplicate hash in the href
6969 // Ex: http://localhost:3001/#array-destructuring#array-destructuring
7070 // This seems like a jsdom bug as the URL in initDom.js appears to be correct
71- const feature = url . slice ( url . lastIndexOf ( "#" ) + 1 ) ;
71+ const feature = url . slice ( url . lastIndexOf ( '#' ) + 1 ) ;
7272
7373 switch ( feature ) {
7474 case 'array-destructuring' :
@@ -241,6 +241,11 @@ class App extends Component {
241241 this . setFeature ( f . default )
242242 ) ;
243243 break ;
244+ case 'dynamic-import' :
245+ import ( './features/webpack/DynamicImport' ) . then ( f =>
246+ this . setFeature ( f . default )
247+ ) ;
248+ break ;
244249 default :
245250 this . setState ( { error : `Missing feature "${ feature } "` } ) ;
246251 }
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) 2015-present, Facebook, Inc.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ */
7+
8+ import React from 'react' ;
9+
10+ export default ( ) => {
11+ return < > Hello World!</ > ;
12+ } ;
Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) 2015-present, Facebook, Inc.
3+ *
4+ * This source code is licensed under the MIT license found in the
5+ * LICENSE file in the root directory of this source tree.
6+ */
7+
8+ import React from 'react' ;
9+ import ReactDOM from 'react-dom' ;
10+
11+ describe ( 'dynamic import' , ( ) => {
12+ it ( 'renders without crashing' , async ( ) => {
13+ import ( './DynamicImport' ) . then ( DynamicImport => {
14+ const div = document . createElement ( 'div' ) ;
15+ ReactDOM . render ( < DynamicImport /> , div ) ;
16+ expect ( div . textContent ) . toBe ( 'Hello World!' ) ;
17+ } ) ;
18+ } ) ;
19+ } ) ;
Original file line number Diff line number Diff line change 7676 "terser-webpack-plugin" : " 1.2.3" ,
7777 "ts-pnp" : " 1.1.2" ,
7878 "url-loader" : " 1.1.2" ,
79- "webpack" : " 4.29.6 " ,
79+ "webpack" : " 4.35.0 " ,
8080 "webpack-dev-server" : " 3.2.1" ,
8181 "webpack-manifest-plugin" : " 2.0.4" ,
8282 "workbox-webpack-plugin" : " 4.2.0"
You can’t perform that action at this time.
0 commit comments