GitHub user nolanlawson opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/853

    code-split "brace" into second bundle

    I am not 100% confident in this PR but maybe it's a good starting point for 
discussion.
    
    I noticed that `brace` makes up a lot of the default bundle. I also noticed 
that you don't really need `brace` until you open an editor. So it seems like a 
good opportunity to code-split.
    
    Before:
    
    ```
    2554776     bundle.js
    ```
    
    After:
    
    ```
    252701      1.bundle.js
    2302814     bundle.js
    ```
    
    So this removes 251962 bytes (~250KB) from the default bundle.
    
    I've tested this and it does indeed work. When you open up an editor, 
`1.bundle.js` downloads and you can edit JavaScript/JSON. Open questions, 
though:
    
    1. What is zenmodeoverlay? I'm not sure how to test it. I'm also not sure 
how to dynamically load `brace/theme/dawn` inside of it.
    2. Should we move `1.bundle.js` to `dashboard.assets`? TBH I'm not sure why 
we even move `bundle.js` into a content-addressed file. It shouldn't be 
extremely valuable to make it content-addressed, unless folks are frequently 
upgrading their databases and we're worried that the cache might be stale.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nolanlawson/couchdb-fauxton brace-code-split

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/853.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #853
    
----
commit 30c558ad0cc60b57ef9fdfb3080c080dc2e17990
Author: Nolan Lawson <[email protected]>
Date:   2017-02-15T09:22:01Z

    code-split "brace" into second bundle

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to