Browse Source

Remove workarounds for the webpack bug preventing it from compiling vega

This is followup from webpack fixing and releasing https://github.com/webpack/webpack/pull/11354

This includes the following reversions, as well as partial reversions of several other commits:

This reverts commit 2edcbfaba9411037d4ac382d92c524a05ece2c7d.

This reverts commit e30a1d04c2894941e578b95cb7d7ce143b2e6ded.

This reverts commit 0b21c99be1cb8059822a18fbfbe30a7874de15b0.
Jason Grout 4 năm trước cách đây
mục cha
commit
b7b8e26330

+ 0 - 3
builder/package.json

@@ -34,8 +34,6 @@
     "watch": "tsc -w --listEmittedFiles"
   },
   "dependencies": {
-    "@babel/core": "^7.10.2",
-    "@babel/preset-env": "^7.10.2",
     "@jupyterlab/buildutils": "^3.0.0-beta.0",
     "@lumino/algorithm": "^1.3.3",
     "@lumino/application": "^1.11.0",
@@ -50,7 +48,6 @@
     "@lumino/virtualdom": "^1.7.3",
     "@lumino/widgets": "^1.14.0",
     "ajv": "^6.12.3",
-    "babel-loader": "^8.0.6",
     "child_process": "~1.0.2",
     "commander": "~6.0.0",
     "css-loader": "~4.2.2",

+ 0 - 10
builder/src/webpack.config.base.ts

@@ -40,16 +40,6 @@ const rules = [
     use: {
       loader: 'raw-loader'
     }
-  },
-  // Workaround for https://github.com/jupyterlab/jupyterlab/issues/8655
-  {
-    test: /vega-statistics\/src\/.*.js$/,
-    use: {
-      loader: 'babel-loader',
-      options: {
-        presets: ['@babel/preset-env']
-      }
-    }
   }
 ];
 

+ 0 - 14
examples/federated/core_package/webpack.config.js

@@ -86,20 +86,6 @@ module.exports = [
       },
       filename: 'bundle.js'
     },
-    module: {
-      rules: [
-        // Workaround for https://github.com/jupyterlab/jupyterlab/issues/8655
-        {
-          test: /vega-statistics\/src\/.*.js$/,
-          use: {
-            loader: 'babel-loader',
-            options: {
-              presets: ['@babel/preset-env']
-            }
-          }
-        }
-      ]
-    },
     plugins: [
       new ModuleFederationPlugin({
         library: {

+ 2 - 10
jupyterlab/commands.py

@@ -456,7 +456,7 @@ def clean(app_options=None):
 
 
 def build(name=None, version=None, static_url=None,
-          command=None, kill_event=None,
+          command='build:prod', kill_event=None,
           clean_staging=False, app_options=None):
     """Build the JupyterLab application.
     """
@@ -627,18 +627,10 @@ class _AppHandler(object):
         return True
 
     def build(self, name=None, version=None, static_url=None,
-              command=None, clean_staging=False):
+              command='build:prod:minimize', clean_staging=False):
         """Build the application.
         """
         # resolve the build type
-
-        # FIXME: part of https://github.com/jupyterlab/jupyterlab/issues/8655
-        if command == None:
-            if os.name == 'nt':
-                command = 'build:dev'
-            else:
-                command = 'build:prod:minimize'
-
         parts = command.split(':')
         if len(parts) < 2:
             parts.append('dev')

+ 0 - 4
jupyterlab/labextensions.py

@@ -106,10 +106,6 @@ class BaseExtensionApp(JupyterApp, DebugLogFileMixin):
             ans = self.run_task()
             if ans and self.should_build:
                 parts = ['build']
-                # FIXME: part of https://github.com/jupyterlab/jupyterlab/issues/8655
-                if os.name == 'nt':
-                    self.dev_build = True
-                    self.minimize = False
                 parts.append('none' if self.dev_build is None else
                              'dev' if self.dev_build else
                              'prod')

+ 0 - 7
jupyterlab/tests/test_build_api.py

@@ -3,7 +3,6 @@ from tempfile import TemporaryDirectory
 import threading
 
 import asyncio
-import os
 import pytest
 import json
 import tornado
@@ -70,17 +69,11 @@ class TestBuildAPI:
         assert 'message' in resp
 
 #    @pytest.mark.gen_test(timeout=30)
-    # FIXME: part of https://github.com/jupyterlab/jupyterlab/issues/8655
-    @pytest.mark.skipif(os.name == 'nt',
-                    reason="Currently failing on windows")
     async def test_build(self, build_api_tester):
         r = await build_api_tester.build()
         assert r.code == 200
 
 #    @pytest.mark.gen_test(timeout=30)
-    # FIXME: part of https://github.com/jupyterlab/jupyterlab/issues/8655
-    @pytest.mark.skipif(os.name == 'nt',
-                    reason="Currently failing on windows")
     async def test_clear(self, build_api_tester):
         with pytest.raises(tornado.httpclient.HTTPClientError) as e:
             r = await build_api_tester.clear()

+ 1 - 4
scripts/ci_script.sh

@@ -97,10 +97,7 @@ if [[ $GROUP == integrity2 ]]; then
     jlpm run build:src
 
     # Make sure we can build for release
-    # FIXME: part of https://github.com/jupyterlab/jupyterlab/issues/8655
-    if [ $OSTYPE == "Linux" ]; then
-        jlpm run build:dev:prod:release
-    fi
+    jlpm run build:dev:prod:release
 
     # Make sure the storybooks build.
     jlpm run build:storybook

+ 1 - 6
setup.py

@@ -92,13 +92,8 @@ def check_assets():
 
 cmdclass = create_cmdclass('jsdeps', data_files_spec=data_files_spec,
                            package_data_spec=package_data_spec, exclude=exclude)
-# FIXME: part of https://github.com/jupyterlab/jupyterlab/issues/8655
-if os.name == 'nt':
-    build_cmd = 'build'
-else:
-    build_cmd = 'build:prod'
 cmdclass['jsdeps'] = combine_commands(
-    install_npm(build_cmd=build_cmd, path=staging, source_dir=staging,
+    install_npm(build_cmd='build:prod', path=staging, source_dir=staging,
                 build_dir=pjoin(HERE, NAME, 'static'), npm=npm),
     command_for_func(check_assets)
 )