]> source.dussan.org Git - sonarqube.git/commitdiff
replace require.ensure with dymamic import (#2187)
authorStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 18 Jul 2017 13:11:50 +0000 (15:11 +0200)
committerGitHub <noreply@github.com>
Tue, 18 Jul 2017 13:11:50 +0000 (15:11 +0200)
30 files changed:
server/sonar-web/.babelrc
server/sonar-web/package.json
server/sonar-web/src/main/js/apps/about/components/AboutAppForSonarQubeDotComLazyLoader.js
server/sonar-web/src/main/js/apps/about/routes.js
server/sonar-web/src/main/js/apps/account/routes.js
server/sonar-web/src/main/js/apps/background-tasks/routes.js
server/sonar-web/src/main/js/apps/code/routes.js
server/sonar-web/src/main/js/apps/coding-rules/routes.js
server/sonar-web/src/main/js/apps/component-measures/routes.js
server/sonar-web/src/main/js/apps/component/routes.js
server/sonar-web/src/main/js/apps/custom-measures/routes.js
server/sonar-web/src/main/js/apps/groups/routes.js
server/sonar-web/src/main/js/apps/issues/routes.js
server/sonar-web/src/main/js/apps/metrics/routes.js
server/sonar-web/src/main/js/apps/overview/routes.js
server/sonar-web/src/main/js/apps/permission-templates/routes.js
server/sonar-web/src/main/js/apps/permissions/routes.js
server/sonar-web/src/main/js/apps/projectActivity/routes.js
server/sonar-web/src/main/js/apps/projects-admin/routes.js
server/sonar-web/src/main/js/apps/projects/routes.js
server/sonar-web/src/main/js/apps/quality-gates/routes.js
server/sonar-web/src/main/js/apps/quality-profiles/routes.js
server/sonar-web/src/main/js/apps/sessions/routes.js
server/sonar-web/src/main/js/apps/settings/routes.js
server/sonar-web/src/main/js/apps/system/routes.js
server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingModal.js
server/sonar-web/src/main/js/apps/update-center/routes.js
server/sonar-web/src/main/js/apps/users/routes.js
server/sonar-web/src/main/js/apps/web-api/routes.js
server/sonar-web/yarn.lock

index 3f2673a82bd03972bf0fad197e3b73ff2a5fd2e7..2962b9304d526a618ac3472a356b3e16a61c9646 100644 (file)
   "env": {
     "production": {
       "plugins": [
+        "syntax-dynamic-import",
         "transform-react-constant-elements"
       ]
     },
     "development": {
       "plugins": [
+        "syntax-dynamic-import",
         "transform-react-jsx-source",
         "transform-react-jsx-self"
       ]
@@ -37,6 +39,7 @@
     "test": {
       "plugins": [
         "transform-es2015-modules-commonjs",
+        "dynamic-import-node",
         "transform-react-jsx-source",
         "transform-react-jsx-self"
       ]
index 7405c034c0310804869b01f91702c58c75b5df4c..bf0c23036be5a776186868fe980f8ccf0cad55e6 100644 (file)
   "devDependencies": {
     "autoprefixer": "7.1.1",
     "babel-core": "^6.22.1",
-    "babel-eslint": "6.1.2",
+    "babel-eslint": "7.2.3",
     "babel-jest": "19.0.0",
     "babel-loader": "7.0.0",
+    "babel-plugin-dynamic-import-node": "1.0.2",
+    "babel-plugin-syntax-dynamic-import": "6.18.0",
     "babel-plugin-transform-class-properties": "^6.22.0",
     "babel-plugin-transform-object-rest-spread": "^6.22.0",
     "babel-plugin-transform-react-constant-elements": "^6.22.0",
index 5af2402c06ec750a0b60531fa8120d843e90a902..8d22b8f8b43eedb9d8219a9c319def4af60fe210 100644 (file)
@@ -29,11 +29,9 @@ export default class AboutAppForSonarQubeDotComLazyLoader extends React.PureComp
 
   componentDidMount() {
     if (!this.state.AboutAppForSonarQubeDotCom) {
-      require.ensure([], require => {
-        this.setState({
-          AboutAppForSonarQubeDotCom: require('./AboutAppForSonarQubeDotCom').default
-        });
-      });
+      import('./AboutAppForSonarQubeDotCom').then(({ default: AboutAppForSonarQubeDotCom }) =>
+        this.setState({ AboutAppForSonarQubeDotCom })
+      );
     }
   }
 
index 233b7e289ac599e2c1cfa39bd5500ce74943f53a..0748dad497d19fd95a57e8b311aaa184d5304a47 100644 (file)
@@ -20,9 +20,7 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/AboutApp').default })
-      );
+      import('./components/AboutApp').then(i => callback(null, { component: i.default }));
     }
   }
 ];
index 43cd438d7b082ae4671d8c9f571b0b285f0a8f2b..2b92bf00f6b5affe032b6e57b34c510c3ecd6df0 100644 (file)
 const routes = [
   {
     getComponent(_, callback) {
-      require.ensure([], require => callback(null, require('./components/Account').default));
+      import('./components/Account').then(i => callback(null, i.default));
     },
     childRoutes: [
       {
         getIndexRoute(_, callback) {
-          require.ensure([], require =>
-            callback(null, { component: require('./profile/Profile').default })
-          );
+          import('./profile/Profile').then(i => callback(null, { component: i.default }));
         }
       },
       {
         path: 'security',
         getComponent(_, callback) {
-          require.ensure([], require => callback(null, require('./components/Security').default));
+          import('./components/Security').then(i => callback(null, i.default));
         }
       },
       {
         path: 'projects',
         getComponent(_, callback) {
-          require.ensure([], require =>
-            callback(null, require('./projects/ProjectsContainer').default)
-          );
+          import('./projects/ProjectsContainer').then(i => callback(null, i.default));
         }
       },
       {
         path: 'notifications',
         getComponent(_, callback) {
-          require.ensure([], require =>
-            callback(null, require('./notifications/Notifications').default)
-          );
+          import('./notifications/Notifications').then(i => callback(null, i.default));
         }
       },
       {
         path: 'organizations',
         getComponent(_, callback) {
-          require.ensure([], require =>
-            callback(null, require('./organizations/UserOrganizations').default)
-          );
+          import('./organizations/UserOrganizations').then(i => callback(null, i.default));
         },
         childRoutes: [
           {
             path: 'create',
             getComponent(_, callback) {
-              require.ensure([], require =>
-                callback(null, require('./organizations/CreateOrganizationForm').default)
-              );
+              import('./organizations/CreateOrganizationForm').then(i => callback(null, i.default));
             }
           }
         ]
index bdc399c3b3329de76bebcc2c09a9f097422eba31..3f46e626d9e3b6cc3917470779a7b3d7f384ed27 100644 (file)
@@ -20,9 +20,7 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/BackgroundTasksApp').default })
-      );
+      import('./components/BackgroundTasksApp').then(i => callback(null, { component: i.default }));
     }
   }
 ];
index 73a48b7b9c3e15cc85b9d2df796ed1ff0061edd1..4de41657b768c21ec02f7dfe3447468b117ac525 100644 (file)
@@ -20,9 +20,7 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/App').default })
-      );
+      import('./components/App').then(i => callback(null, { component: i.default }));
     }
   }
 ];
index a1bba34c6b6dadae551b9d458e24f9b2c66bb9b8..af91a4eab6d96f05287aadd7d58d10928563c891 100644 (file)
@@ -21,9 +21,7 @@ const routes = [
   {
     indexRoute: {
       getComponent(_, callback) {
-        require.ensure([], require => {
-          callback(null, require('./components/CodingRulesAppContainer').default);
-        });
+        import('./components/CodingRulesAppContainer').then(i => callback(null, i.default));
       }
     }
   }
index c4b1fb5162da0ef4de9eda5b4593c4bf413b676e..0c4f83db5e157332c2d8ebd6411a4c7816865d5a 100644 (file)
 const routes = [
   {
     getComponent(_, callback) {
-      require.ensure([], require => callback(null, require('./app/AppContainer').default));
+      import('./app/AppContainer').then(i => callback(null, i.default));
     },
     childRoutes: [
       {
         getComponent(_, callback) {
-          require.ensure([], require => callback(null, require('./home/HomeContainer').default));
+          import('./home/HomeContainer').then(i => callback(null, i.default));
         },
         childRoutes: [
           {
             getIndexRoute(_, callback) {
-              require.ensure([], require =>
-                callback(null, { component: require('./home/AllMeasuresContainer').default })
+              import('./home/AllMeasuresContainer').then(i =>
+                callback(null, { component: i.default })
               );
             }
           },
           {
             path: 'domain/:domainName',
             getComponent(_, callback) {
-              require.ensure([], require =>
-                callback(null, require('./home/DomainMeasuresContainer').default)
-              );
+              import('./home/DomainMeasuresContainer').then(i => callback(null, i.default));
             }
           }
         ]
@@ -48,9 +46,7 @@ const routes = [
       {
         path: 'metric/:metricKey',
         getComponent(_, callback) {
-          require.ensure([], require =>
-            callback(null, require('./details/MeasureDetailsContainer').default)
-          );
+          import('./details/MeasureDetailsContainer').then(i => callback(null, i.default));
         },
         childRoutes: [
           {
@@ -67,17 +63,13 @@ const routes = [
           {
             path: 'list',
             getComponent(_, callback) {
-              require.ensure([], require =>
-                callback(null, require('./details/drilldown/ListViewContainer').default)
-              );
+              import('./details/drilldown/ListViewContainer').then(i => callback(null, i.default));
             }
           },
           {
             path: 'tree',
             getComponent(_, callback) {
-              require.ensure([], require =>
-                callback(null, require('./details/drilldown/TreeViewContainer').default)
-              );
+              import('./details/drilldown/TreeViewContainer').then(i => callback(null, i.default));
             }
           },
           {
@@ -96,8 +88,8 @@ const routes = [
           {
             path: 'treemap',
             getComponent(_, callback) {
-              require.ensure([], require =>
-                callback(null, require('./details/treemap/MeasureTreemapContainer').default)
+              import('./details/treemap/MeasureTreemapContainer').then(i =>
+                callback(null, i.default)
               );
             }
           }
index edb7d77a7f24842d143d58b2cc31a7d8b08b7a6a..9943b1d8380f0c4b9ed4f24b47c1c686101f76f2 100644 (file)
@@ -21,7 +21,7 @@ const routes = [
   {
     indexRoute: {
       getComponent(_, callback) {
-        require.ensure([], require => callback(null, require('./components/App').default));
+        import('./components/App').then(i => callback(null, i.default));
       }
     }
   }
index f4e98ca2c3a395341197f7819bc12b58fe83338c..e3aee2038cdeec2c75ca0f658e1ca985c9e2bd6f 100644 (file)
@@ -20,8 +20,8 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/CustomMeasuresAppContainer').default })
+      import('./components/CustomMeasuresAppContainer').then(i =>
+        callback(null, { component: i.default })
       );
     }
   }
index d161da9d9fe79c3673f7e95f8ef9fa23b33146db..8829f80c94bab1cbebd6f35512fc58162489d4a4 100644 (file)
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require => {
-        const GroupsAppContainer = require('./components/GroupsAppContainer').default;
-        const forSingleOrganization = require('../organizations/forSingleOrganization').default;
-        const component = forSingleOrganization(GroupsAppContainer);
-        callback(null, { component });
-      });
+      Promise.all([
+        import('./components/GroupsAppContainer').then(i => i.default),
+        import('../organizations/forSingleOrganization').then(i => i.default)
+      ]).then(([GroupsAppContainer, forSingleOrganization]) =>
+        callback(null, { component: forSingleOrganization(GroupsAppContainer) })
+      );
     }
   }
 ];
index f4c372a136879a4ebceb0617c1c2dfe94bc6758e..ffcdcb7a0903468310716bd936187121e2815873 100644 (file)
@@ -22,11 +22,8 @@ import { onEnter } from './redirects';
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, {
-          component: require('./components/AppContainer').default,
-          onEnter
-        })
+      import('./components/AppContainer').then(i =>
+        callback(null, { component: i.default, onEnter })
       );
     }
   }
index 6cbe20ddab957f43d1d8fe85fd0efc964d927560..637dba72da95e4ec30a0bebe4406a0157bc661a2 100644 (file)
@@ -20,8 +20,8 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/MetricsAppContainer').default })
+      import('./components/MetricsAppContainer').then(i =>
+        callback(null, { component: i.default })
       );
     }
   }
index 7af0479bb25dccbbec6177d714880c124c7cd4d1..02a7323043e6044d679f3e6c88884e47f842b3c6 100644 (file)
@@ -20,9 +20,7 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/AppContainer').default })
-      );
+      import('./components/AppContainer').then(i => callback(null, { component: i.default }));
     }
   }
 ];
index d44e8735ad30ed7cc30a8a7a0da69e62dececf3d..ce1b2679e4a7dfdf9b574e5a1d28fe2b84791d5f 100644 (file)
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require => {
-        const AppContainer = require('./components/AppContainer').default;
-        const forSingleOrganization = require('../organizations/forSingleOrganization').default;
-        const component = forSingleOrganization(AppContainer);
-        callback(null, { component });
-      });
+      Promise.all([
+        import('./components/AppContainer').then(i => i.default),
+        import('../organizations/forSingleOrganization').then(i => i.default)
+      ]).then(([AppContainer, forSingleOrganization]) =>
+        callback(null, { component: forSingleOrganization(AppContainer) })
+      );
     }
   }
 ];
index 71a6d7aba3a522325a28b504aefd9309d65b8c13..631a26985b12aaddac4030a78cc0b60b4c144e95 100644 (file)
 export const globalPermissionsRoutes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require => {
-        const GlobalPermissionsApp = require('./global/components/App').default;
-        const forSingleOrganization = require('../organizations/forSingleOrganization').default;
-        const component = forSingleOrganization(GlobalPermissionsApp);
-        callback(null, { component });
-      });
+      Promise.all([
+        import('./global/components/App').then(i => i.default),
+        import('../organizations/forSingleOrganization').then(i => i.default)
+      ]).then(([App, forSingleOrganization]) =>
+        callback(null, { component: forSingleOrganization(App) })
+      );
     }
   }
 ];
@@ -33,8 +33,8 @@ export const globalPermissionsRoutes = [
 export const projectPermissionsRoutes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./project/components/AppContainer').default })
+      import('./project/components/AppContainer').then(i =>
+        callback(null, { component: i.default })
       );
     }
   }
index e11d7fbe8b4e90ff8361d7167841f50f0cc3e9e4..11233a7368bfcc5337c0ab7eb6ebfe00c218c1ab 100644 (file)
@@ -20,8 +20,8 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/ProjectActivityAppContainer').default })
+      import('./components/ProjectActivityAppContainer').then(i =>
+        callback(null, { component: i.default })
       );
     }
   }
index 6ca2206f863f53fe6d7bb8c86b960578a8864113..d17958371b61f770386896905ceb9c460eb37907 100644 (file)
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require => {
-        const AppContainer = require('./AppContainer').default;
-        const forSingleOrganization = require('../organizations/forSingleOrganization').default;
-        const component = forSingleOrganization(AppContainer);
-        callback(null, { component });
-      });
+      Promise.all([
+        import('./AppContainer').then(i => i.default),
+        import('../organizations/forSingleOrganization').then(i => i.default)
+      ]).then(([AppContainer, forSingleOrganization]) =>
+        callback(null, { component: forSingleOrganization(AppContainer) })
+      );
     }
   }
 ];
index 8c67972c076e8101f08945eccd5ecd021d114c0e..1c3c76cc3d4dc9f928fdbeddc996de38660e6ce2 100644 (file)
@@ -22,13 +22,13 @@ import { saveAll } from '../../helpers/storage';
 const routes = [
   {
     getComponent(_, callback) {
-      require.ensure([], require => callback(null, require('./components/App').default));
+      import('./components/App').then(i => callback(null, i.default));
     },
     childRoutes: [
       {
         getIndexRoute(_, callback) {
-          require.ensure([], require =>
-            callback(null, { component: require('./components/DefaultPageSelector').default })
+          import('./components/DefaultPageSelector').then(i =>
+            callback(null, { component: i.default })
           );
         }
       },
@@ -42,9 +42,7 @@ const routes = [
       {
         path: 'favorite',
         getComponent(_, callback) {
-          require.ensure([], require =>
-            callback(null, require('./components/FavoriteProjectsContainer').default)
-          );
+          import('./components/FavoriteProjectsContainer').then(i => callback(null, i.default));
         }
       }
     ]
index 495278f0d0aa53d400e4cd54c4a4b5b46bd6cd50..8664f1f39bb670c39af9b581fc7f5b47dcd80114 100644 (file)
 const routes = [
   {
     getComponent(_, callback) {
-      require.ensure([], require =>
-        callback(null, require('./containers/QualityGatesAppContainer').default)
-      );
+      import('./containers/QualityGatesAppContainer').then(i => callback(null, i.default));
     },
     childRoutes: [
       {
         getIndexRoute(_, callback) {
-          require.ensure([], require =>
-            callback(null, { component: require('./components/Intro').default })
-          );
+          import('./components/Intro').then(i => callback(null, { component: i.default }));
         }
       },
       {
         path: 'show/:id',
         getComponent(_, callback) {
-          require.ensure([], require =>
-            callback(null, require('./containers/DetailsContainer').default)
-          );
+          import('./containers/DetailsContainer').then(i => callback(null, i.default));
         }
       }
     ]
index 4c53b80384fe3e119ecca2742107a5a78339abfb..1d7b96fe64719335afcab418f32ddee6d1027e5a 100644 (file)
@@ -22,51 +22,41 @@ import { withRouter } from 'react-router';
 const routes = [
   {
     getComponent(state, callback) {
-      require.ensure([], require => {
-        const AppContainer = require('./components/AppContainer').default;
+      import('./components/AppContainer').then(i => i.default).then(AppContainer => {
         if (state.params.organizationKey) {
           callback(null, AppContainer);
         } else {
-          const forSingleOrganization = require('../organizations/forSingleOrganization').default;
-          callback(null, forSingleOrganization(AppContainer));
+          import('../organizations/forSingleOrganization')
+            .then(i => i.default)
+            .then(forSingleOrganization => callback(null, forSingleOrganization(AppContainer)));
         }
       });
     },
     getIndexRoute(_, callback) {
-      require.ensure([], require => {
-        callback(null, { component: require('./home/HomeContainer').default });
-      });
+      import('./home/HomeContainer').then(i => callback(null, { component: i.default }));
     },
     childRoutes: [
       {
         getComponent(_, callback) {
-          require.ensure([], require => {
-            callback(null, withRouter(require('./components/ProfileContainer').default));
-          });
+          import('./components/ProfileContainer').then(i => callback(null, withRouter(i.default)));
         },
         childRoutes: [
           {
             path: 'show',
             getComponent(_, callback) {
-              require.ensure([], require => {
-                callback(null, require('./details/ProfileDetails').default);
-              });
+              import('./details/ProfileDetails').then(i => callback(null, i.default));
             }
           },
           {
             path: 'changelog',
             getComponent(_, callback) {
-              require.ensure([], require => {
-                callback(null, require('./changelog/ChangelogContainer').default);
-              });
+              import('./changelog/ChangelogContainer').then(i => callback(null, i.default));
             }
           },
           {
             path: 'compare',
             getComponent(_, callback) {
-              require.ensure([], require => {
-                callback(null, require('./compare/ComparisonContainer').default);
-              });
+              import('./compare/ComparisonContainer').then(i => callback(null, i.default));
             }
           }
         ]
index 957fb2a72072201b7950456b5b87ef3077dcf17d..32e367c391f19518584ca81100b95ccc3e6ccba6 100644 (file)
@@ -21,25 +21,19 @@ const routes = [
   {
     path: 'new',
     getComponent(_, callback) {
-      require.ensure([], require => {
-        callback(null, require('./components/LoginFormContainer').default);
-      });
+      import('./components/LoginFormContainer').then(i => callback(null, i.default));
     }
   },
   {
     path: 'logout',
     getComponent(_, callback) {
-      require.ensure([], require => {
-        callback(null, require('./components/Logout').default);
-      });
+      import('./components/Logout').then(i => callback(null, i.default));
     }
   },
   {
     path: 'unauthorized',
     getComponent(_, callback) {
-      require.ensure([], require => {
-        callback(null, require('./components/Unauthorized').default);
-      });
+      import('./components/Unauthorized').then(i => callback(null, i.default));
     }
   }
 ];
index 68300e6d2c8babae0dc23108174036057b77a862..9a408f19fe8b393306d70d3c196adf6a74b39b9a 100644 (file)
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require => {
-        callback(null, { component: require('./components/AppContainer').default });
-      });
+      import('./components/AppContainer').then(i => callback(null, { component: i.default }));
     }
   },
   {
     path: 'licenses',
     getComponent(_, callback) {
-      require.ensure([], require => {
-        callback(null, require('./licenses/LicensesApp').default);
-      });
+      import('./licenses/LicensesApp').then(i => callback(null, i.default));
     }
   },
   {
     path: 'encryption',
     getComponent(_, callback) {
-      require.ensure([], require => {
-        callback(null, require('./encryption/EncryptionAppContainer').default);
-      });
+      import('./encryption/EncryptionAppContainer').then(i => callback(null, i.default));
     }
   },
   {
     path: 'server_id',
     getComponent(_, callback) {
-      require.ensure([], require => {
-        callback(null, require('./serverId/ServerIdAppContainer').default);
-      });
+      import('./serverId/ServerIdAppContainer').then(i => callback(null, i.default));
     }
   }
 ];
index 454ff5127faa72c9b8fcb601b51fa6aacf307798..0ab080a46f43c33a36876c884f7a89da1857bd8e 100644 (file)
@@ -20,7 +20,7 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require => callback(null, { component: require('./main').default }));
+      import('./main').then(i => callback(null, { component: i.default }));
     }
   }
 ];
index 7ae513347557bb6390a2da6d9f05e56d0772b677..a402d0bdb582a6e9597869d9cb99c97f7e51b2f7 100644 (file)
@@ -37,10 +37,7 @@ export default class OnboardingModal extends React.PureComponent {
 
   componentDidMount() {
     this.mounted = true;
-    // $FlowFixMe
-    require.ensure([], require => {
-      this.receiveComponent(require('./OnboardingContainer').default);
-    });
+    import('./OnboardingContainer').then(i => this.receiveComponent(i.default));
   }
 
   componentWillUnmount() {
index e4d9cb18015c8a2e85e17bbfa28a740437611c67..81c884ae5d66b5e1b07b3efbe363a82489f7b906 100644 (file)
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/UpdateCenterAppContainer').default })
+      import('./components/UpdateCenterAppContainer').then(i =>
+        callback(null, { component: i.default })
       );
     }
   },
   {
     path: 'installed',
     getComponent(_, callback) {
-      require.ensure([], require =>
-        callback(null, require('./components/UpdateCenterAppContainer').default)
-      );
+      import('./components/UpdateCenterAppContainer').then(i => callback(null, i.default));
     }
   },
   {
     path: 'updates',
     getComponent(_, callback) {
-      require.ensure([], require =>
-        callback(null, require('./components/UpdateCenterAppContainer').default)
-      );
+      import('./components/UpdateCenterAppContainer').then(i => callback(null, i.default));
     }
   },
   {
     path: 'available',
     getComponent(_, callback) {
-      require.ensure([], require =>
-        callback(null, require('./components/UpdateCenterAppContainer').default)
-      );
+      import('./components/UpdateCenterAppContainer').then(i => callback(null, i.default));
     }
   },
   {
     path: 'system',
     getComponent(_, callback) {
-      require.ensure([], require =>
-        callback(null, require('./components/UpdateCenterAppContainer').default)
-      );
+      import('./components/UpdateCenterAppContainer').then(i => callback(null, i.default));
     }
   }
 ];
index e83f23c64b59d751207ab454d2569df29342e117..b07c3c9c5c248958c81330eb42ae0242932cbf55 100644 (file)
@@ -20,9 +20,7 @@
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/UsersAppContainer').default })
-      );
+      import('./components/UsersAppContainer').then(i => callback(null, { component: i.default }));
     }
   }
 ];
index a27df0a1e5cd4d72f89010c534b4ac878d247d38..5993b47eea48ab8f1d0a3fb0a78f371d006e1495 100644 (file)
 const routes = [
   {
     getIndexRoute(_, callback) {
-      require.ensure([], require =>
-        callback(null, { component: require('./components/WebApiApp').default })
-      );
+      import('./components/WebApiApp').then(i => callback(null, { component: i.default }));
     }
   },
   {
     path: '**',
     getComponent(_, callback) {
-      require.ensure([], require => callback(null, require('./components/WebApiApp').default));
+      import('./components/WebApiApp').then(i => callback(null, i.default));
     }
   }
 ];
index b130cf318b32bd0bc1b478dd1f63ff7f18b87a74..40419b195381c288f2ade13e69dabb0ec3a915a9 100644 (file)
@@ -324,15 +324,14 @@ babel-core@^6.0.0, babel-core@^6.22.0, babel-core@^6.22.1:
     slash "^1.0.0"
     source-map "^0.5.0"
 
-babel-eslint@6.1.2:
-  version "6.1.2"
-  resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-6.1.2.tgz#5293419fe3672d66598d327da9694567ba6a5f2f"
+babel-eslint@7.2.3:
+  version "7.2.3"
+  resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827"
   dependencies:
-    babel-traverse "^6.0.20"
-    babel-types "^6.0.19"
-    babylon "^6.0.18"
-    lodash.assign "^4.0.0"
-    lodash.pickby "^4.0.0"
+    babel-code-frame "^6.22.0"
+    babel-traverse "^6.23.1"
+    babel-types "^6.23.0"
+    babylon "^6.17.0"
 
 babel-generator@^6.18.0, babel-generator@^6.22.0:
   version "6.22.0"
@@ -472,18 +471,32 @@ babel-loader@7.0.0:
     loader-utils "^1.0.2"
     mkdirp "^0.5.1"
 
-babel-messages@^6.22.0, babel-messages@^6.8.0:
+babel-messages@^6.22.0:
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.22.0.tgz#36066a214f1217e4ed4164867669ecb39e3ea575"
   dependencies:
     babel-runtime "^6.22.0"
 
+babel-messages@^6.23.0, babel-messages@^6.8.0:
+  version "6.23.0"
+  resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
+  dependencies:
+    babel-runtime "^6.22.0"
+
 babel-plugin-check-es2015-constants@^6.3.13:
   version "6.8.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.8.0.tgz#dbf024c32ed37bfda8dee1e76da02386a8d26fe7"
   dependencies:
     babel-runtime "^6.0.0"
 
+babel-plugin-dynamic-import-node@1.0.2:
+  version "1.0.2"
+  resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-1.0.2.tgz#adb5bc8f48a89311540395ae9f0cc3ed4b10bb2e"
+  dependencies:
+    babel-plugin-syntax-dynamic-import "^6.18.0"
+    babel-template "^6.24.1"
+    babel-types "^6.24.1"
+
 babel-plugin-istanbul@^4.0.0:
   version "4.1.1"
   resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.1.tgz#c12de0fc6fe42adfb16be56f1ad11e4a9782eca9"
@@ -504,6 +517,10 @@ babel-plugin-syntax-class-properties@^6.8.0:
   version "6.13.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz#d7eb23b79a317f8543962c505b827c7d6cac27de"
 
+babel-plugin-syntax-dynamic-import@6.18.0, babel-plugin-syntax-dynamic-import@^6.18.0:
+  version "6.18.0"
+  resolved "https://registry.yarnpkg.com/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz#8d6a26229c83745a9982a441051572caa179b1da"
+
 babel-plugin-syntax-exponentiation-operator@^6.8.0:
   version "6.13.0"
   resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"
@@ -864,7 +881,17 @@ babel-runtime@^6.11.6, babel-runtime@^6.22.0:
     core-js "^2.4.0"
     regenerator-runtime "^0.10.0"
 
-babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.22.0, babel-template@^6.8.0:
+babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.8.0:
+  version "6.25.0"
+  resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071"
+  dependencies:
+    babel-runtime "^6.22.0"
+    babel-traverse "^6.25.0"
+    babel-types "^6.25.0"
+    babylon "^6.17.2"
+    lodash "^4.2.0"
+
+babel-template@^6.22.0:
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.22.0.tgz#403d110905a4626b317a2a1fcb8f3b73204b2edb"
   dependencies:
@@ -874,7 +901,21 @@ babel-template@^6.14.0, babel-template@^6.15.0, babel-template@^6.16.0, babel-te
     babylon "^6.11.0"
     lodash "^4.2.0"
 
-babel-traverse@^6.0.20, babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-traverse@^6.21.0, babel-traverse@^6.22.0, babel-traverse@^6.22.1:
+babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-traverse@^6.21.0, babel-traverse@^6.22.0, babel-traverse@^6.23.1, babel-traverse@^6.25.0:
+  version "6.25.0"
+  resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1"
+  dependencies:
+    babel-code-frame "^6.22.0"
+    babel-messages "^6.23.0"
+    babel-runtime "^6.22.0"
+    babel-types "^6.25.0"
+    babylon "^6.17.2"
+    debug "^2.2.0"
+    globals "^9.0.0"
+    invariant "^2.2.0"
+    lodash "^4.2.0"
+
+babel-traverse@^6.22.1:
   version "6.22.1"
   resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.22.1.tgz#3b95cd6b7427d6f1f757704908f2fc9748a5f59f"
   dependencies:
@@ -888,7 +929,16 @@ babel-traverse@^6.0.20, babel-traverse@^6.18.0, babel-traverse@^6.20.0, babel-tr
     invariant "^2.2.0"
     lodash "^4.2.0"
 
-babel-types@^6.0.19, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.20.0, babel-types@^6.21.0, babel-types@^6.22.0, babel-types@^6.8.0, babel-types@^6.9.0:
+babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.20.0, babel-types@^6.21.0, babel-types@^6.23.0, babel-types@^6.24.1, babel-types@^6.25.0, babel-types@^6.8.0, babel-types@^6.9.0:
+  version "6.25.0"
+  resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e"
+  dependencies:
+    babel-runtime "^6.22.0"
+    esutils "^2.0.2"
+    lodash "^4.2.0"
+    to-fast-properties "^1.0.1"
+
+babel-types@^6.22.0:
   version "6.22.0"
   resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.22.0.tgz#2a447e8d0ea25d2512409e4175479fd78cc8b1db"
   dependencies:
@@ -901,9 +951,9 @@ babylon@^6.0.18, babylon@^6.11.0:
   version "6.14.1"
   resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.14.1.tgz#956275fab72753ad9b3435d7afe58f8bf0a29815"
 
-babylon@^6.13.0, babylon@^6.15.0:
-  version "6.15.0"
-  resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e"
+babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0, babylon@^6.17.2:
+  version "6.17.4"
+  resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a"
 
 backbone.babysitter@^0.1.0:
   version "0.1.12"
@@ -3777,7 +3827,7 @@ lodash._getnative@^3.0.0:
   version "3.9.1"
   resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
 
-lodash.assign@^4.0.0, lodash.assign@^4.2.0:
+lodash.assign@^4.2.0:
   version "4.2.0"
   resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7"
 
@@ -3857,10 +3907,6 @@ lodash.pick@^4.2.1:
   version "4.4.0"
   resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3"
 
-lodash.pickby@^4.0.0:
-  version "4.6.0"
-  resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff"
-
 lodash.reduce@^4.4.0:
   version "4.6.0"
   resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b"