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

Improved importing/requiring of modules across bundles

    Details

    • Similar Issues:
    • Epic Link:
    • Sprint:
      1.0-m12, 1.0-pre-beta-1, 1.0-beta-1

      Description

      E.g. to accommodate the how we need control over how react and react-dom are loaded.

      Tom FENNELLY assigning to you for now but I intend to reach out tomorrow so we can work this together. We discussed a workaround for this last week but I was not successful after following the steps you'd provided. Could be something I've missed though. If it's not, let's try to fix together, with my final task being to do a write-up in a wiki about the steps needed to work around this problem.

      Steps followed:

      1. Add 'react-addons-css-transition-group' to init.jsx in blueocean-web
      2. In js-extensions/@jenkins-cd/subs/extensions-bundle.js, update the createBundle function near the end
      3. Build a new js-extensions
      4. npm install new js-extensions in blueocean-web and blueocean-personalization
      5. Re-run gulp bundle for both modules

        Attachments

          Issue Links

            Activity

            Hide
            michaelneale Michael Neale added a comment -

            Tom FENNELLY is this related to #JENKINS-35727 at all?

            Show
            michaelneale Michael Neale added a comment - Tom FENNELLY is this related to # JENKINS-35727 at all?
            Hide
            tfennelly Tom FENNELLY added a comment -

            Michael Neale yep, same thing. I'll close the other because I have my branches named after this one.

            Show
            tfennelly Tom FENNELLY added a comment - Michael Neale yep, same thing. I'll close the other because I have my branches named after this one.
            Hide
            tfennelly Tom FENNELLY added a comment - - edited

            PR: https://github.com/jenkinsci/js-builder/pull/5

            Still more to do ... in js-builder and in js-modules

            Show
            tfennelly Tom FENNELLY added a comment - - edited PR: https://github.com/jenkinsci/js-builder/pull/5 Still more to do ... in js-builder and in js-modules
            Hide
            jamesdumay James Dumay added a comment -

            Tom FENNELLY nice one BTW

            Show
            jamesdumay James Dumay added a comment - Tom FENNELLY nice one BTW
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Tom Fennelly
            Path:
            gulpfile.js
            index.js
            internal/adjunctexternal.js
            internal/bundlegen.js
            internal/dependecies.js
            internal/maven.js
            internal/pipeline-transforms/buffered-text-accumulator-transform.js
            internal/pipeline-transforms/require-stub-transform.js
            internal/templates/entry-module.hbs
            internal/templates/export-module.hbs
            internal/templates/index.js
            package.json
            spec/adjunctexternal-spec.js
            spec/dependencies-spec.js
            spec/index-spec.js
            spec/modules/module1.js
            spec/modules/module2.js
            spec/modules/module3.js
            spec/modules/module4.js
            spec/modules/module5.js
            spec/modules/module6.js
            spec/modules/module7.js
            spec/modules/module8.js
            spec/modules/module9.js
            spec/paths-spec.js
            spec/require-stub-transform-spec.js
            http://jenkins-ci.org/commit/blueocean-js-builder/12e89446866500705522b76774b507fcf04dc94b
            Log:
            JENKINS-37006 Change bundle generation to map/import via bundle entry rewriting (#5)

            • refactor bundle generation code from index.js to internal/bundlegen.js
            • bundle map entry stub rewriting
            • Revert use of --ignore browserify option ... no use to us

            ... because it puts in one bundle map entry for all ignored modules (when there are multiple of them), pointing require at the same map entry for them all ... that's no use to us as we need a stub for each module

            • Enhance require-stub-transform to do module pruning

            ... after mappings have left modules unused

            • No need to rewrite module source when bundle mpa entry already removed (unused)
            • throw new Error
            • don't apply imports on "--no-imports"
            • Added warning for duplicate require mappings
            • rename withExternalModuleMapping to import

            and deprcated withExternalModuleMapping

            • Add export dependency builder code

            .. still need to use that in the generated bundle

            • Use a handlebars template to transform/wrap the entry module
            • export-module.hbs handlebars template
            • dependency exports
            • Updates to reflect changes in js-modules to handle version ranges etc
            • Mode tweaks to get bundling working with new module loading
            • require-stub-transform cleanups
            • bundle as to use a ModuleSpec
            • Fixed dep export when no imports
            • Added postBundle listener support
            • Only allow global exports when there's one bundle being generated
            • Remerge Cliff's changes for .babelrc
            • Better import message
            • Remove dependency on window-handle
            • Added node_module to moduleDef
            • post transform map of fullPaths to ids
            • 36-beta25
            • Readded the --full-paths option
            • nodeModulesRelPath function
            • Support for import aliases
            • Version updates for 0.0.37 release
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tom Fennelly Path: gulpfile.js index.js internal/adjunctexternal.js internal/bundlegen.js internal/dependecies.js internal/maven.js internal/pipeline-transforms/buffered-text-accumulator-transform.js internal/pipeline-transforms/require-stub-transform.js internal/templates/entry-module.hbs internal/templates/export-module.hbs internal/templates/index.js package.json spec/adjunctexternal-spec.js spec/dependencies-spec.js spec/index-spec.js spec/modules/module1.js spec/modules/module2.js spec/modules/module3.js spec/modules/module4.js spec/modules/module5.js spec/modules/module6.js spec/modules/module7.js spec/modules/module8.js spec/modules/module9.js spec/paths-spec.js spec/require-stub-transform-spec.js http://jenkins-ci.org/commit/blueocean-js-builder/12e89446866500705522b76774b507fcf04dc94b Log: JENKINS-37006 Change bundle generation to map/import via bundle entry rewriting (#5) refactor bundle generation code from index.js to internal/bundlegen.js bundle map entry stub rewriting Revert use of --ignore browserify option ... no use to us ... because it puts in one bundle map entry for all ignored modules (when there are multiple of them), pointing require at the same map entry for them all ... that's no use to us as we need a stub for each module Enhance require-stub-transform to do module pruning ... after mappings have left modules unused No need to rewrite module source when bundle mpa entry already removed (unused) throw new Error don't apply imports on "--no-imports" Added warning for duplicate require mappings rename withExternalModuleMapping to import and deprcated withExternalModuleMapping Add export dependency builder code .. still need to use that in the generated bundle Use a handlebars template to transform/wrap the entry module export-module.hbs handlebars template dependency exports Updates to reflect changes in js-modules to handle version ranges etc Mode tweaks to get bundling working with new module loading require-stub-transform cleanups bundle as to use a ModuleSpec Fixed dep export when no imports Added postBundle listener support Only allow global exports when there's one bundle being generated Remerge Cliff's changes for .babelrc Better import message Remove dependency on window-handle Added node_module to moduleDef post transform map of fullPaths to ids 36-beta25 Readded the --full-paths option nodeModulesRelPath function Support for import aliases Version updates for 0.0.37 release

              People

              • Assignee:
                tfennelly Tom FENNELLY
                Reporter:
                cliffmeyers Cliff Meyers
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: