Closed Bug 1786582 Opened 2 years ago Closed 2 years ago

npm bundle command generates different bundle on windows

Categories

(Firefox :: Messaging System, task, P3)

task

Tracking

()

RESOLVED FIXED
113 Branch
Iteration:
113.1 - Mar 13 - Mar 24
Tracking Status
firefox113 --- fixed

People

(Reporter: beth, Assigned: aminomancer)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Running npm run bundle in browser/components/newtab generates a different bundle on Windows than other platforms. The CI job that checks the bundles are up-to-date runs on Linux, which means the bundle must always be generated on Linux/macOS, which is annoying if you are developing on Windows.

Example:

diff --git a/browser/components/newtab/data/content/activity-stream.bundle.js b/browser/components/newtab/data/content/activity-stream.bundle.js
--- a/browser/components/newtab/data/content/activity-stream.bundle.js
+++ b/browser/components/newtab/data/content/activity-stream.bundle.js
@@ -3357,34 +3357,31 @@ var external_PropTypes_default = /*#__PU
  * @param {string|Array<string>} ids
  * @returns {FluentBundle|Array<FluentBundle>}
  */
 function mapBundleSync(iterable, ids) {
   if (!Array.isArray(ids)) {
     return getBundleForId(iterable, ids);
   }
 
-  return ids.map(
-    id => getBundleForId(iterable, id)
-  );
-}
-
+  return ids.map(id => getBundleForId(iterable, id));
+}
 /*
  * Find the best `FluentBundle` with the translation for `id`.
  */
+
 function getBundleForId(iterable, id) {
   for (const bundle of iterable) {
     if (bundle.hasMessage(id)) {
       return bundle;
     }
   }
 
   return null;
 }
-
 ;// CONCATENATED MODULE: ./node_modules/fluent-sequence/src/map_async.js
 /*
  * Asynchronously map an identifier or an array of identifiers to the best
  * `FluentBundle` instance(s).
  *
  * @param {AsyncIterable} iterable
  * @param {string|Array<string>} ids
  * @returns {Promise<FluentBundle|Array<FluentBundle>>}
@@ -3401,37 +3398,34 @@ async function mapBundleAsync(iterable, 
   let remainingCount = ids.length;
   const foundBundles = new Array(remainingCount).fill(null);
 
   for await (const bundle of iterable) {
     for (const [index, id] of ids.entries()) {
       if (!foundBundles[index] && bundle.hasMessage(id)) {
         foundBundles[index] = bundle;
         remainingCount--;
-      }
-
-      // Return early when all ids have been mapped to contexts.
+      } // Return early when all ids have been mapped to contexts.
+
+
       if (remainingCount === 0) {
         return foundBundles;
       }
     }
   }
 
   return foundBundles;
 }
-
 ;// CONCATENATED MODULE: ./node_modules/fluent-sequence/src/index.js
 /*
  * @module fluent-sequence
  * @overview Manage ordered sequences of FluentBundles.
  */
 
 
-
-
 ;// CONCATENATED MODULE: ./node_modules/cached-iterable/src/cached_iterable.mjs
 /*
  * Base CachedIterable class.
  */
 class CachedIterable extends Array {
     /**
      * Create a `CachedIterable` instance from an iterable or, if another
      * instance of `CachedIterable` is passed, return it without any
Blocks: ujmc
Priority: -- → P3
Assignee: nobody → shughes
Attachment #9323336 - Attachment description: WIP: Bug 1786582 - Update fluent and fluent-react in newtab. → Bug 1786582 - Update fluent and fluent-react in newtab. r=barret
Status: NEW → ASSIGNED
Pushed by shughes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/11f67cb8033e Update fluent and fluent-react in newtab. r=barret
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
Flags: qe-verify+
Iteration: --- → 113.1 - Mar 13 - Mar 24
See Also: → 1880586
See Also: → 1881165
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: