gator icon indicating copy to clipboard operation
gator copied to clipboard

Base on Lumino Application

Open fcollonval opened this issue 5 years ago • 4 comments

This is a PoC for now.

It will be good to see if it can be made compatible with JLab extensions system so that for example theme can be dynamically installed.

fcollonval avatar Nov 07 '20 16:11 fcollonval

Pull Request Test Coverage Report for Build 358046667

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 69.731%

Totals Coverage Status
Change from base Build 358028480: 0.0%
Covered Lines: 741
Relevant Lines: 972

💛 - Coveralls

coveralls avatar Nov 07 '20 16:11 coveralls

Thanks for exploring this.

How does this affect the size of the bundle when building in production mode?

It will be good to see if it can be made compatible with JLab extensions system so that for example theme can be dynamically installed.

Yes it's one of the main advantages of using a lab application, so that adding extensions to the list of plugins "just works". I found it quite convenient for example in this alternative notebook UI that also uses lab components and extensions:

https://github.com/jtpio/p5-notebook/blob/e72f8f9da8ac94fe368101eceb892ef207aa6ef9/src/index.ts#L70-L75

In the case of a Lumino app, plugins will be given an Application<IGatorShell> instead of a JupyterFrontEnd<IGatorShell>. So they will be missing a couple of properties like docRegistry and serviceManager. Which might be fine in the case of the navigator.

It also depends a bit on https://github.com/mamba-org/gator/issues/92, as part of the JupyterLab application expects a jupyterlab_server on the backend.

jtpio avatar Nov 09 '20 08:11 jtpio

How does this affect the size of the bundle when building in production mode?

Current master:

                                     Asset      Size  Chunks             Chunk Names
                         0.gator.bundle.js   2.4 MiB       0  [emitted]  
                         1.gator.bundle.js   291 KiB       1  [emitted]  
                         2.gator.bundle.js  26.2 KiB       2  [emitted]  
      205f07b3883c484f27f40d21a92950d4.ttf   200 KiB          [emitted]  
      2f12242375edd68e9013ecfb59c672e9.svg   730 KiB          [emitted]  
      3602b7e8b2cb1462b0bef9738757ef8a.svg   141 KiB          [emitted]  
     3c6879c4f342203d099bdd66dce6d396.woff  16.4 KiB          [emitted]  
     4451e1d86df7491dd874f2c41eee1053.woff   102 KiB          [emitted]  
      49f00693b0e5d45097832ef5ea1bc541.ttf  33.3 KiB          [emitted]  
    4a74738e7728e93c4394b8604081da62.woff2  13.2 KiB          [emitted]  
      664de3932dd6291b4b8a8c0ddbcb4c61.svg   896 KiB          [emitted]  
      8300bd7f30e0a313c1d772b49d96cb8e.ttf   133 KiB          [emitted]  
      8ac3167427b1d5d2967646bd8f7a0587.eot   200 KiB          [emitted]  
    8e1ed89b6ccb8ce41faf5cb672677105.woff2  78.4 KiB          [emitted]  
     ad527cc5ec23d6da66e8a1d6772ea6d3.woff    90 KiB          [emitted]  
      b01516c1808be557667befec76cd6318.eot  33.5 KiB          [emitted]  
      e2ca6541bff3a3e9f4799ee327b28c58.eot   134 KiB          [emitted]  
    f075c50f89795e4cdb4d45b51f1a6800.woff2  76.6 KiB          [emitted]  
                           gator.bundle.js  21.5 MiB    main  [emitted]  main

This branch

                                     Asset      Size  Chunks             Chunk Names
                     0.navigator.bundle.js   291 KiB       0  [emitted]  
      205f07b3883c484f27f40d21a92950d4.ttf   200 KiB          [emitted]  
      2f12242375edd68e9013ecfb59c672e9.svg   730 KiB          [emitted]  
      3602b7e8b2cb1462b0bef9738757ef8a.svg   141 KiB          [emitted]  
     3c6879c4f342203d099bdd66dce6d396.woff  16.4 KiB          [emitted]  
     4451e1d86df7491dd874f2c41eee1053.woff   102 KiB          [emitted]  
      49f00693b0e5d45097832ef5ea1bc541.ttf  33.3 KiB          [emitted]  
    4a74738e7728e93c4394b8604081da62.woff2  13.2 KiB          [emitted]  
      664de3932dd6291b4b8a8c0ddbcb4c61.svg   896 KiB          [emitted]  
      8300bd7f30e0a313c1d772b49d96cb8e.ttf   133 KiB          [emitted]  
      8ac3167427b1d5d2967646bd8f7a0587.eot   200 KiB          [emitted]  
    8e1ed89b6ccb8ce41faf5cb672677105.woff2  78.4 KiB          [emitted]  
     ad527cc5ec23d6da66e8a1d6772ea6d3.woff    90 KiB          [emitted]  
      b01516c1808be557667befec76cd6318.eot  33.5 KiB          [emitted]  
      e2ca6541bff3a3e9f4799ee327b28c58.eot   134 KiB          [emitted]  
    f075c50f89795e4cdb4d45b51f1a6800.woff2  76.6 KiB          [emitted]  
                       navigator.bundle.js  18.1 MiB    main  [emitted]  main

The reduction comes mainly from dropping codemirror:

image

fcollonval avatar Nov 11 '20 15:11 fcollonval

Thanks, it's nice to be able to compare the two bundles.

It looks like codemirror comes from the dependency on @jupyterlab/rendermime here:

https://github.com/jupyterlab/jupyterlab/blob/e4ca0a30fd6af2fa4a2b914c11f7ae8a65dc0f34/packages/application/package.json#L47

Which depends on codemirror here:

https://github.com/jupyterlab/jupyterlab/blob/e4ca0a30fd6af2fa4a2b914c11f7ae8a65dc0f34/packages/rendermime/package.json#L44

Not sure how easy it would be to change that upstream.

jtpio avatar Nov 12 '20 13:11 jtpio