Browse Source

Publish 3.0.0a8

SHA256 hashes:

jupyterlab-3.0.0a8-py3-none-any.whl: cf067a46afa66e504b68d1033206b5dde48dcae7e811e2f2fd408fd7da7f160c

jupyterlab-3.0.0a8.tar.gz: 3c0bc6ba6c67029f87c2bbff7373d1a16e694c623348a6fd1a57a9943831754d
Steven Silvester 4 years ago
parent
commit
1e1e95a4b7
4 changed files with 1150 additions and 322 deletions
  1. 64 3
      jupyterlab/staging/index.js
  2. 139 135
      jupyterlab/staging/package.json
  3. 62 123
      jupyterlab/staging/webpack.config.js
  4. 885 61
      jupyterlab/staging/yarn.lock

+ 64 - 3
jupyterlab/staging/index.js

@@ -4,8 +4,6 @@
 | Distributed under the terms of the Modified BSD License.
 |----------------------------------------------------------------------------*/
 
-require('es6-promise/auto');  // polyfill Promise on IE
-
 import {
   PageConfig
 } from '@jupyterlab/coreutils';
@@ -17,16 +15,72 @@ __webpack_public_path__ = PageConfig.getOption('fullStaticUrl') + '/';
 // This cannot be extracted because the public path is dynamic.
 require('./imports.css');
 
+
+function loadScript(url) {
+  return new Promise((resolve, reject) => {
+    const newScript = document.createElement('script');
+    newScript.onerror = reject;
+    newScript.onload = resolve;
+    newScript.async = true;
+    document.head.appendChild(newScript);
+    newScript.src = url;
+  });
+}
+
+async function loadComponent(url, scope, module) {
+  await loadScript(url);
+
+  // From MIT-licensed https://github.com/module-federation/module-federation-examples/blob/af043acd6be1718ee195b2511adf6011fba4233c/advanced-api/dynamic-remotes/app1/src/App.js#L6-L12
+  await __webpack_init_sharing__('default');
+  const container = window._JUPYTERLAB[scope];
+  // Initialize the container, it may provide shared modules and may need ours
+  await container.init(__webpack_share_scopes__.default);
+
+  const factory = await window._JUPYTERLAB[scope].get(module);
+  const Module = factory();
+  return Module;
+}
+
+
+
 /**
  * The main entry point for the application.
  */
-function main() {
+async function main() {
   var JupyterLab = require('@jupyterlab/application').JupyterLab;
   var disabled = [];
   var deferred = [];
   var ignorePlugins = [];
   var register = [];
 
+  // This is all the data needed to load and activate plugins. This should be
+  // gathered by the server and put onto the initial page template.
+  const extension_data = JSON.parse(
+    PageConfig.getOption('dynamic_extensions')
+  );
+  const mime_extension_data = JSON.parse(
+    PageConfig.getOption('dynamic_mime_extensions')
+  );
+
+  // Get dynamic plugins
+  const dynamicPromises = extension_data.map(data =>
+    loadComponent(
+      data.path,
+      data.name,
+      data.module
+    )
+  );
+  const dynamicPlugins = await Promise.all(dynamicPromises);
+
+  const dynamicMimePromises = mime_extension_data.map(data =>
+    loadComponent(
+      data.path,
+      data.name,
+      data.module
+    )
+  );
+  const dynamicMimePlugins = await Promise.all(dynamicMimePromises);
+
   // Handle the registered mime extensions.
   var mimeExtensions = [];
   var extension;
@@ -59,6 +113,9 @@ function main() {
   }
   {{/each}}
 
+  // Add the dyanmic mime extensions.
+  dynamicMimePlugins.forEach(plugin => { mimeExtensions.push(plugin); });
+
   // Handled the registered standard extensions.
   {{#each jupyterlab_extensions}}
   try {
@@ -86,6 +143,10 @@ function main() {
     console.error(e);
   }
   {{/each}}
+
+  // Add the dynamic extensions.
+  dynamicPlugins.forEach(plugin => { register.push(plugin) });
+
   var lab = new JupyterLab({
     mimeExtensions: mimeExtensions,
     disabled: {

+ 139 - 135
jupyterlab/staging/package.json

@@ -1,12 +1,11 @@
 {
   "name": "@jupyterlab/application-top",
-  "version": "3.0.0-alpha.7",
+  "version": "3.0.0-alpha.8",
   "private": true,
   "scripts": {
     "build": "webpack",
     "build:dev": "jlpm run build",
     "build:dev:minimize": "jlpm run build:dev",
-    "build:extension": "build-labextension --core-path .",
     "build:prod": "ensure-max-old-space webpack --config webpack.prod.config.js",
     "build:prod:minimize": "ensure-max-old-space webpack --config webpack.prod.minimize.config.js",
     "build:prod:release": "ensure-max-old-space webpack --config webpack.prod.release.config.js",
@@ -17,52 +16,53 @@
     "watch": "webpack --watch"
   },
   "dependencies": {
-    "@jupyterlab/application": "~3.0.0-alpha.7",
-    "@jupyterlab/application-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/apputils-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/celltags-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/codemirror-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/completer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/console-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/coreutils": "~5.0.0-alpha.7",
-    "@jupyterlab/csvviewer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/debugger-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/docmanager-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/documentsearch-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/extensionmanager-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/filebrowser-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/fileeditor-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/help-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/htmlviewer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/hub-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/imageviewer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/inspector-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/javascript-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/json-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/launcher-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/logconsole-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/mainmenu-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/markdownviewer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/mathjax2-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/notebook-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/pdf-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/rendermime-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/running-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/settingeditor-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/shortcuts-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/statusbar-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/tabmanager-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/terminal-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/theme-dark-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/theme-light-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/toc-extension": "~5.0.0-alpha.7",
-    "@jupyterlab/tooltip-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/ui-components-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/vdom-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/vega5-extension": "~3.0.0-alpha.7"
+    "@jupyterlab/application": "~3.0.0-alpha.8",
+    "@jupyterlab/application-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/apputils-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/celltags-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/codemirror-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/completer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/console-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/coreutils": "~5.0.0-alpha.8",
+    "@jupyterlab/csvviewer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/debugger-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/docmanager-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/documentsearch-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/extensionmanager-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/filebrowser-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/fileeditor-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/help-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/htmlviewer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/hub-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/imageviewer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/inspector-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/javascript-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/json-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/launcher-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/logconsole-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/mainmenu-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/markdownviewer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/mathjax2-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/notebook-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/pdf-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/rendermime-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/running-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/settingeditor-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/shortcuts-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/statusbar-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/tabmanager-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/terminal-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/theme-dark-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/theme-light-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/toc-extension": "~5.0.0-alpha.8",
+    "@jupyterlab/tooltip-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/translation-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/ui-components-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/vdom-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/vega5-extension": "~3.0.0-alpha.8"
   },
   "devDependencies": {
-    "@jupyterlab/buildutils": "^3.0.0-alpha.7",
+    "@jupyterlab/buildutils": "^3.0.0-alpha.8",
     "chokidar": "^3.4.0",
     "css-loader": "~3.2.0",
     "duplicate-package-checker-webpack-plugin": "^3.0.0",
@@ -82,7 +82,7 @@
     "terser-webpack-plugin": "^2.3.0",
     "to-string-loader": "^1.1.6",
     "url-loader": "~3.0.0",
-    "webpack": "~4.43.0",
+    "webpack": "~5.0.0-beta.22",
     "webpack-bundle-analyzer": "^3.6.0",
     "webpack-cli": "^3.3.10",
     "webpack-merge": "^4.2.2",
@@ -91,93 +91,95 @@
     "yarn-deduplicate": "^1.1.1"
   },
   "resolutions": {
-    "@jupyterlab/application": "~3.0.0-alpha.7",
-    "@jupyterlab/application-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/apputils": "~3.0.0-alpha.7",
-    "@jupyterlab/apputils-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/attachments": "~3.0.0-alpha.7",
-    "@jupyterlab/cells": "~3.0.0-alpha.7",
-    "@jupyterlab/celltags": "~3.0.0-alpha.7",
-    "@jupyterlab/celltags-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/codeeditor": "~3.0.0-alpha.7",
-    "@jupyterlab/codemirror": "~3.0.0-alpha.7",
-    "@jupyterlab/codemirror-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/completer": "~3.0.0-alpha.7",
-    "@jupyterlab/completer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/console": "~3.0.0-alpha.7",
-    "@jupyterlab/console-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/coreutils": "~5.0.0-alpha.7",
-    "@jupyterlab/csvviewer": "~3.0.0-alpha.7",
-    "@jupyterlab/csvviewer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/debugger": "~3.0.0-alpha.7",
-    "@jupyterlab/debugger-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/docmanager": "~3.0.0-alpha.7",
-    "@jupyterlab/docmanager-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/docregistry": "~3.0.0-alpha.7",
-    "@jupyterlab/documentsearch": "~3.0.0-alpha.7",
-    "@jupyterlab/documentsearch-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/extensionmanager": "~3.0.0-alpha.7",
-    "@jupyterlab/extensionmanager-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/filebrowser": "~3.0.0-alpha.7",
-    "@jupyterlab/filebrowser-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/fileeditor": "~3.0.0-alpha.7",
-    "@jupyterlab/fileeditor-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/help-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/htmlviewer": "~3.0.0-alpha.7",
-    "@jupyterlab/htmlviewer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/hub-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/imageviewer": "~3.0.0-alpha.7",
-    "@jupyterlab/imageviewer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/inspector": "~3.0.0-alpha.7",
-    "@jupyterlab/inspector-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/javascript-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/json-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/launcher": "~3.0.0-alpha.7",
-    "@jupyterlab/launcher-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/logconsole": "~3.0.0-alpha.7",
-    "@jupyterlab/logconsole-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/mainmenu": "~3.0.0-alpha.7",
-    "@jupyterlab/mainmenu-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/markdownviewer": "~3.0.0-alpha.7",
-    "@jupyterlab/markdownviewer-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/mathjax2": "~3.0.0-alpha.7",
-    "@jupyterlab/mathjax2-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/metapackage": "~3.0.0-alpha.7",
-    "@jupyterlab/nbconvert-css": "~3.0.0-alpha.7",
-    "@jupyterlab/nbformat": "~3.0.0-alpha.7",
-    "@jupyterlab/notebook": "~3.0.0-alpha.7",
-    "@jupyterlab/notebook-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/observables": "~4.0.0-alpha.7",
-    "@jupyterlab/outputarea": "~3.0.0-alpha.7",
-    "@jupyterlab/pdf-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/property-inspector": "~3.0.0-alpha.7",
-    "@jupyterlab/rendermime": "~3.0.0-alpha.7",
-    "@jupyterlab/rendermime-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/rendermime-interfaces": "~3.0.0-alpha.7",
-    "@jupyterlab/running": "~3.0.0-alpha.7",
-    "@jupyterlab/running-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/services": "~6.0.0-alpha.7",
-    "@jupyterlab/settingeditor": "~3.0.0-alpha.7",
-    "@jupyterlab/settingeditor-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/settingregistry": "~3.0.0-alpha.7",
-    "@jupyterlab/shortcuts-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/statedb": "~3.0.0-alpha.7",
-    "@jupyterlab/statusbar": "~3.0.0-alpha.7",
-    "@jupyterlab/statusbar-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/tabmanager-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/terminal": "~3.0.0-alpha.7",
-    "@jupyterlab/terminal-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/theme-dark-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/theme-light-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/toc": "~5.0.0-alpha.7",
-    "@jupyterlab/toc-extension": "~5.0.0-alpha.7",
-    "@jupyterlab/tooltip": "~3.0.0-alpha.7",
-    "@jupyterlab/tooltip-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/ui-components": "~3.0.0-alpha.7",
-    "@jupyterlab/ui-components-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/vdom": "~3.0.0-alpha.7",
-    "@jupyterlab/vdom-extension": "~3.0.0-alpha.7",
-    "@jupyterlab/vega5-extension": "~3.0.0-alpha.7",
+    "@jupyterlab/application": "~3.0.0-alpha.8",
+    "@jupyterlab/application-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/apputils": "~3.0.0-alpha.8",
+    "@jupyterlab/apputils-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/attachments": "~3.0.0-alpha.8",
+    "@jupyterlab/cells": "~3.0.0-alpha.8",
+    "@jupyterlab/celltags": "~3.0.0-alpha.8",
+    "@jupyterlab/celltags-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/codeeditor": "~3.0.0-alpha.8",
+    "@jupyterlab/codemirror": "~3.0.0-alpha.8",
+    "@jupyterlab/codemirror-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/completer": "~3.0.0-alpha.8",
+    "@jupyterlab/completer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/console": "~3.0.0-alpha.8",
+    "@jupyterlab/console-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/coreutils": "~5.0.0-alpha.8",
+    "@jupyterlab/csvviewer": "~3.0.0-alpha.8",
+    "@jupyterlab/csvviewer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/debugger": "~3.0.0-alpha.8",
+    "@jupyterlab/debugger-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/docmanager": "~3.0.0-alpha.8",
+    "@jupyterlab/docmanager-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/docregistry": "~3.0.0-alpha.8",
+    "@jupyterlab/documentsearch": "~3.0.0-alpha.8",
+    "@jupyterlab/documentsearch-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/extensionmanager": "^3.0.0-alpha.8",
+    "@jupyterlab/extensionmanager-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/filebrowser": "~3.0.0-alpha.8",
+    "@jupyterlab/filebrowser-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/fileeditor": "~3.0.0-alpha.8",
+    "@jupyterlab/fileeditor-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/help-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/htmlviewer": "~3.0.0-alpha.8",
+    "@jupyterlab/htmlviewer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/hub-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/imageviewer": "~3.0.0-alpha.8",
+    "@jupyterlab/imageviewer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/inspector": "~3.0.0-alpha.8",
+    "@jupyterlab/inspector-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/javascript-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/json-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/launcher": "~3.0.0-alpha.8",
+    "@jupyterlab/launcher-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/logconsole": "~3.0.0-alpha.8",
+    "@jupyterlab/logconsole-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/mainmenu": "~3.0.0-alpha.8",
+    "@jupyterlab/mainmenu-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/markdownviewer": "~3.0.0-alpha.8",
+    "@jupyterlab/markdownviewer-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/mathjax2": "~3.0.0-alpha.8",
+    "@jupyterlab/mathjax2-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/metapackage": "~3.0.0-alpha.8",
+    "@jupyterlab/nbconvert-css": "~3.0.0-alpha.8",
+    "@jupyterlab/nbformat": "~3.0.0-alpha.8",
+    "@jupyterlab/notebook": "~3.0.0-alpha.8",
+    "@jupyterlab/notebook-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/observables": "~4.0.0-alpha.8",
+    "@jupyterlab/outputarea": "~3.0.0-alpha.8",
+    "@jupyterlab/pdf-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/property-inspector": "~3.0.0-alpha.8",
+    "@jupyterlab/rendermime": "~3.0.0-alpha.8",
+    "@jupyterlab/rendermime-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/rendermime-interfaces": "~3.0.0-alpha.8",
+    "@jupyterlab/running": "~3.0.0-alpha.8",
+    "@jupyterlab/running-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/services": "~6.0.0-alpha.8",
+    "@jupyterlab/settingeditor": "~3.0.0-alpha.8",
+    "@jupyterlab/settingeditor-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/settingregistry": "~3.0.0-alpha.8",
+    "@jupyterlab/shortcuts-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/statedb": "~3.0.0-alpha.8",
+    "@jupyterlab/statusbar": "~3.0.0-alpha.8",
+    "@jupyterlab/statusbar-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/tabmanager-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/terminal": "~3.0.0-alpha.8",
+    "@jupyterlab/terminal-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/theme-dark-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/theme-light-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/toc": "~5.0.0-alpha.8",
+    "@jupyterlab/toc-extension": "~5.0.0-alpha.8",
+    "@jupyterlab/tooltip": "~3.0.0-alpha.8",
+    "@jupyterlab/tooltip-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/translation": "~3.0.0-alpha.8",
+    "@jupyterlab/translation-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/ui-components": "~3.0.0-alpha.8",
+    "@jupyterlab/ui-components-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/vdom": "~3.0.0-alpha.8",
+    "@jupyterlab/vdom-extension": "~3.0.0-alpha.8",
+    "@jupyterlab/vega5-extension": "~3.0.0-alpha.8",
     "@lumino/algorithm": "^1.2.3",
     "@lumino/application": "^1.8.4",
     "@lumino/commands": "^1.10.1",
@@ -198,7 +200,7 @@
   },
   "jupyterlab": {
     "name": "JupyterLab",
-    "version": "3.0.0a7",
+    "version": "3.0.0a8",
     "extensions": {
       "@jupyterlab/application-extension": "",
       "@jupyterlab/apputils-extension": "",
@@ -235,6 +237,7 @@
       "@jupyterlab/theme-light-extension": "",
       "@jupyterlab/toc-extension": "",
       "@jupyterlab/tooltip-extension": "",
+      "@jupyterlab/translation-extension": "",
       "@jupyterlab/ui-components-extension": "",
       "@jupyterlab/vdom-extension": ""
     },
@@ -276,6 +279,7 @@
       "@jupyterlab/statusbar",
       "@jupyterlab/terminal",
       "@jupyterlab/tooltip",
+      "@jupyterlab/translation",
       "@jupyterlab/ui-components",
       "@lumino/algorithm",
       "@lumino/application",

+ 62 - 123
jupyterlab/staging/webpack.config.js

@@ -9,8 +9,11 @@ const fs = require('fs-extra');
 const Handlebars = require('handlebars');
 const HtmlWebpackPlugin = require('html-webpack-plugin');
 const webpack = require('webpack');
+const merge = require('webpack-merge');
 const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
   .BundleAnalyzerPlugin;
+const baseConfig = require('@jupyterlab/buildutils/lib/webpack.config.base');
+const { ModuleFederationPlugin } = webpack.container;
 
 const Build = require('@jupyterlab/buildutils').Build;
 const WPPlugin = require('@jupyterlab/buildutils').WPPlugin;
@@ -48,27 +51,58 @@ if (fs.existsSync(buildDir)) {
 }
 fs.ensureDirSync(buildDir);
 
+const outputDir = plib.resolve(jlab.outputDir);
+
 // Build the assets
 const extraConfig = Build.ensureAssets({
   packageNames: packageNames,
-  output: jlab.outputDir
+  output: outputDir
 });
 
+// Build up singleton metadata for module federation.
+const singletons = {};
+
+package_data.jupyterlab.singletonPackages.forEach(element => {
+  singletons[element] = { singleton: true };
+});
+
+// Go through each external extension
+// add to mapping of extension and mime extensions, of package name
+// to path of the extension.
+for (const key in externalExtensions) {
+  const {
+    jupyterlab: { extension, mimeExtension }
+  } = require(`${key}/package.json`);
+  if (extension !== undefined) {
+    extensions[key] = extension === true ? '' : extension;
+  }
+  if (mimeExtension !== undefined) {
+    mimeExtensions[key] = mimeExtension === true ? '' : mimeExtension;
+  }
+}
+
 // Create the entry point file.
 const source = fs.readFileSync('index.js').toString();
 const template = Handlebars.compile(source);
-const data = {
+const extData = {
   jupyterlab_extensions: extensions,
   jupyterlab_mime_extensions: mimeExtensions
 };
-const result = template(data);
+const result = template(extData);
 
 fs.writeFileSync(plib.join(buildDir, 'index.out.js'), result);
 fs.copySync('./package.json', plib.join(buildDir, 'package.json'));
-fs.copySync(
-  plib.join(jlab.outputDir, 'imports.css'),
-  plib.join(buildDir, 'imports.css')
-);
+if (outputDir !== buildDir) {
+  fs.copySync(
+    plib.join(outputDir, 'imports.css'),
+    plib.join(buildDir, 'imports.css')
+  );
+}
+
+// Make a bootstrap entrypoint
+const entryPoint = plib.join(buildDir, 'bootstrap.js');
+const bootstrap = 'import("./index.out.js");';
+fs.writeFileSync(entryPoint, bootstrap);
 
 // Set up variables for the watch mode ignore plugins
 const watched = {};
@@ -156,14 +190,25 @@ const plugins = [
   }),
   new HtmlWebpackPlugin({
     chunksSortMode: 'none',
-    template: plib.join('templates', 'template.html'),
+    template: plib.join(__dirname, 'templates', 'template.html'),
     title: jlab.name || 'JupyterLab'
   }),
-  new webpack.HashedModuleIdsPlugin(),
+  new webpack.ids.HashedModuleIdsPlugin(),
   // custom plugin for ignoring files during a `--watch` build
   new WPPlugin.FilterWatchIgnorePlugin(ignored),
   // custom plugin that copies the assets to the static directory
-  new WPPlugin.FrontEndPlugin(buildDir, jlab.staticDir)
+  new WPPlugin.FrontEndPlugin(buildDir, jlab.staticDir),
+  new ModuleFederationPlugin({
+    library: {
+      type: 'var',
+      name: ['_JUPYTERLAB', 'CORE_LIBRARY_FEDERATION']
+    },
+    name: 'CORE_FEDERATION',
+    shared: {
+      ...package_data.resolutions,
+      ...singletons
+    }
+  })
 ];
 
 if (process.argv.includes('--analyze')) {
@@ -171,75 +216,14 @@ if (process.argv.includes('--analyze')) {
 }
 
 module.exports = [
-  {
+  merge(baseConfig, {
     mode: 'development',
     entry: {
-      main: ['whatwg-fetch', plib.resolve(buildDir, 'index.out.js')]
-    },
-    // Map Phosphor files to Lumino files.
-    resolve: {
-      alias: {
-        '@phosphor/algorithm$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/algorithm/dist/index.js'
-        ),
-        '@phosphor/application$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/application/dist/index.js'
-        ),
-        '@phosphor/commands$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/commands/dist/index.js'
-        ),
-        '@phosphor/coreutils$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/coreutils/dist/index.js'
-        ),
-        '@phosphor/disposable$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/disposable/dist/index.js'
-        ),
-        '@phosphor/domutils$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/domutils/dist/index.js'
-        ),
-        '@phosphor/dragdrop$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/dragdrop/dist/index.js'
-        ),
-        '@phosphor/dragdrop/style': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/widgets/style'
-        ),
-        '@phosphor/messaging$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/messaging/dist/index.js'
-        ),
-        '@phosphor/properties$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/properties/lib'
-        ),
-        '@phosphor/signaling': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/signaling/dist/index.js'
-        ),
-        '@phosphor/widgets/style': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/widgets/style'
-        ),
-        '@phosphor/virtualdom$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/virtualdom/dist/index.js'
-        ),
-        '@phosphor/widgets$': plib.resolve(
-          __dirname,
-          'node_modules/@lumino/widgets/dist/index.js'
-        )
-      }
+      main: ['whatwg-fetch', entryPoint]
     },
     output: {
       path: plib.resolve(buildDir),
-      publicPath: '{{page_config.fullStaticUrl}}/',
+      publicPath: 'static/lab/',
       filename: '[name].[chunkhash].js'
     },
     optimization: {
@@ -249,64 +233,19 @@ module.exports = [
     },
     module: {
       rules: [
-        { test: /\.css$/, use: ['style-loader', 'css-loader'] },
-        { test: /\.md$/, use: 'raw-loader' },
-        { test: /\.txt$/, use: 'raw-loader' },
         {
           test: /\.js$/,
           include: sourceMapRes,
           use: ['source-map-loader'],
           enforce: 'pre'
-        },
-        { test: /\.(jpg|png|gif)$/, use: 'file-loader' },
-        { test: /\.js.map$/, use: 'file-loader' },
-        {
-          test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
-          use: 'url-loader?limit=10000&mimetype=application/font-woff'
-        },
-        {
-          test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
-          use: 'url-loader?limit=10000&mimetype=application/font-woff'
-        },
-        {
-          test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
-          use: 'url-loader?limit=10000&mimetype=application/octet-stream'
-        },
-        {
-          test: /\.otf(\?v=\d+\.\d+\.\d+)?$/,
-          use: 'url-loader?limit=10000&mimetype=application/octet-stream'
-        },
-        { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: 'file-loader' },
-        {
-          // In .css files, svg is loaded as a data URI.
-          test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
-          issuer: { test: /\.css$/ },
-          use: {
-            loader: 'svg-url-loader',
-            options: { encoding: 'none', limit: 10000 }
-          }
-        },
-        {
-          // In .ts and .tsx files (both of which compile to .js), svg files
-          // must be loaded as a raw string instead of data URIs.
-          test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
-          issuer: { test: /\.js$/ },
-          use: {
-            loader: 'raw-loader'
-          }
         }
       ]
     },
-    watchOptions: {
-      poll: 500,
-      aggregateTimeout: 1000
-    },
-    node: {
-      fs: 'empty'
-    },
-    bail: true,
     devtool: 'inline-source-map',
     externals: ['node-fetch', 'ws'],
     plugins
-  }
+  })
 ].concat(extraConfig);
+
+const logPath = plib.join(buildDir, 'build_log.json');
+fs.writeFileSync(logPath, JSON.stringify(module.exports, null, '  '));

File diff suppressed because it is too large
+ 885 - 61
jupyterlab/staging/yarn.lock


Some files were not shown because too many files changed in this diff