Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39646

Properly generate bundles for packages that have multiple top-level modules

    XMLWordPrintable

Details

    • Blue Ocean 1.2-beta2

    Description

      Bundled are generated in a sub optimal way. One side effect is there could be multiple submodules of popular libraries appearing in different bundles. 


      See this doc for a description of the problem(s).

      Attachments

        Issue Links

          Activity

            tfennelly Tom FENNELLY added a comment -

            This work MUST be done before we do anything in Blue Ocean 1.0+. Please DO NOT change the priority of this task.

            tfennelly Tom FENNELLY added a comment - This work MUST be done before we do anything in Blue Ocean 1.0+. Please DO NOT change the priority of this task.
            tfennelly Tom FENNELLY added a comment -

            However, we need some browser tooling in order to do this properly (see JENKINS-39657). We need to be able to reliably analyse across all bundles in the browser at runtime. ATM, I do this manually by opening the bundles and looking in them visually. I also created a CLI tool called browserify-tree that does help a lot, but again, it only allows me to analyse a single bundle.

            tfennelly Tom FENNELLY added a comment - However, we need some browser tooling in order to do this properly (see JENKINS-39657 ). We need to be able to reliably analyse across all bundles in the browser at runtime. ATM, I do this manually by opening the bundles and looking in them visually. I also created a CLI tool called browserify-tree that does help a lot, but again, it only allows me to analyse a single bundle.
            tfennelly Tom FENNELLY added a comment - - edited

            There's also another related scenario that needs to be covered here, which is when one or more different versions of a package to be externalized end up in the node_modules of package in node_modules (i.e. npm trying to handle conflicting versions of the package) e.g. /node_modules/@jenkins-cd/blueocean-core-js/node_modules/react/react.js because @jenkins-cd/blueocean-core-js depends on a specific version of react that is not the same as the top level installed version of react ( in /node_modules/react ).

            tfennelly Tom FENNELLY added a comment - - edited There's also another related scenario that needs to be covered here, which is when one or more different versions of a package to be externalized end up in the node_modules of package in node_modules (i.e. npm trying to handle conflicting versions of the package) e.g. /node_modules/@jenkins-cd/blueocean-core-js/node_modules/react/react.js because @jenkins-cd/blueocean-core-js depends on a specific version of react that is not the same as the top level installed version of react ( in /node_modules/react ).
            michaelneale Michael Neale added a comment -

            hey tfennelly any news on this and the dependent ticket for chrome tools (given priority of this)?

            michaelneale Michael Neale added a comment - hey tfennelly any news on this and the dependent ticket for chrome tools (given priority of this)?
            tfennelly Tom FENNELLY added a comment -

            Some progress made on JENKINS-39657 alright (basic chrome extension created - there was a bit of learning needed on these extensions), but can't effectively do anything on this ticket without first getting JENKINS-39657 to a stage where it can answer the kinds of questions I need it to help give answers to. I think I'm a couple of days awaf from that yet - guessing 2 or 3. This stuff is not going to be done for 1.0, but I'm guessing you already know that.

            I've been away for the last week and it's Paddy's day here today and I'm jetlagged

            tfennelly Tom FENNELLY added a comment - Some progress made on JENKINS-39657 alright ( basic chrome extension created - there was a bit of learning needed on these extensions), but can't effectively do anything on this ticket without first getting JENKINS-39657 to a stage where it can answer the kinds of questions I need it to help give answers to. I think I'm a couple of days awaf from that yet - guessing 2 or 3. This stuff is not going to be done for 1.0, but I'm guessing you already know that. I've been away for the last week and it's Paddy's day here today and I'm jetlagged
            michaelneale Michael Neale added a comment -

            tfennelly yeah no worries - happy st pats! I assumed that https://issues.jenkins-ci.org/browse/JENKINS-39657 was the blocking thing still, not sure why I commented here. 

            michaelneale Michael Neale added a comment - tfennelly yeah no worries - happy st pats! I assumed that https://issues.jenkins-ci.org/browse/JENKINS-39657  was the blocking thing still, not sure why I commented here. 
            tfennelly Tom FENNELLY added a comment -

            As stated in the very first comment on this ticket ... Please DO NOT change the priority of this ticket.

            I appreciate that things might "seem ok", but imo this issue is a bit more than "technical debt" i.e. it's a fundamental issue with how we are generating bundles and is destined to be a serious issue, especially once we have multiple versions of Blue Ocean out in the wild, with JS bundles generated with different NPM package versions etc.

            It's been a job getting people to take me seriously on this one (e.g. downgrading the priority). Maybe install jenkins-js-modules-chrome-ext in your Chrome browser, open a Blue Ocean instance and take a look at the number of errors and warnings. These are pretty much all relating to this bug in the bundle generation.

            Also ... the bundles are "fatter" than they need to be because of this.

            As an example from https://ci.blueocean.io (140+ errors detected in dashboard and personalization bundles) ...

            tfennelly Tom FENNELLY added a comment - As stated in the very first comment on this ticket ... Please DO NOT change the priority of this ticket. I appreciate that things might "seem ok", but imo this issue is a bit more than "technical debt" i.e. it's a fundamental issue with how we are generating bundles and is destined to be a serious issue, especially once we have multiple versions of Blue Ocean out in the wild, with JS bundles generated with different NPM package versions etc. It's been a job getting people to take me seriously on this one (e.g. downgrading the priority). Maybe install jenkins-js-modules-chrome-ext in your Chrome browser, open a Blue Ocean instance and take a look at the number of errors and warnings. These are pretty much all relating to this bug in the bundle generation. Also ... the bundles are "fatter" than they need to be because of this. As an example from https://ci.blueocean.io (140+ errors detected in dashboard and personalization bundles) ...
            michaelneale Michael Neale added a comment -

            Bringing this up for discussion at next hangout.. 

            michaelneale Michael Neale added a comment - Bringing this up for discussion at next hangout.. 
            jamesdumay James Dumay added a comment -

            michaelneale still needed on the board?

            jamesdumay James Dumay added a comment - michaelneale still needed on the board?
            tfennelly Tom FENNELLY added a comment -

            I'm going to write up a more detailed and structured doc around all of this wrt what's wrong today with how we generate an use bundles and what I think we need to do to put it right (or more right than it is).

            There are a few fundamental things we are doing wrong imo (yes, my fault). I'd really like to put those things right before we try doing things like what's in jenkinsci/js-builder/pull/19. How we allow exports of modules today without properly generating a "dependency bundle" (e.g. how we export some modules in blueocean.js in the blueocean-web plugin) is fundamentally wrong and is eventually going to break badly ... just a matter of time!! jenkinsci/js-builder/pull/19 would very likely make that situation a lot worse imo + make it harder to fix. So, I'm firmly of the opinion that we fix how we generate bundles etc first, and then come back and see how we can make jenkinsci/js-builder/pull/19 work where it'll be on more solid foundations.

            tfennelly Tom FENNELLY added a comment - I'm going to write up a more detailed and structured doc around all of this wrt what's wrong today with how we generate an use bundles and what I think we need to do to put it right (or more right than it is). There are a few fundamental things we are doing wrong imo (yes, my fault). I'd really like to put those things right before we try doing things like what's in jenkinsci/js-builder/pull/19 . How we allow exports of modules today without properly generating a "dependency bundle" (e.g. how we export some modules in blueocean.js in the blueocean-web plugin) is fundamentally wrong and is eventually going to break badly ... just a matter of time!! jenkinsci/js-builder/pull/19 would very likely make that situation a lot worse imo + make it harder to fix. So, I'm firmly of the opinion that we fix how we generate bundles etc first, and then come back and see how we can make jenkinsci/js-builder/pull/19 work where it'll be on more solid foundations.
            tfennelly Tom FENNELLY added a comment -

            I added the doc. It's linked to in the main description.

            tfennelly Tom FENNELLY added a comment - I added the doc. It's linked to in the main description.
            tfennelly Tom FENNELLY added a comment -

            jamesdumay I think we can close this a "Won't Do" .

            tfennelly Tom FENNELLY added a comment - jamesdumay I think we can close this a "Won't Do" .

            People

              Unassigned Unassigned
              tfennelly Tom FENNELLY
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: