-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
au build
bundle output and revision hashes are non-deterministic
#378
Comments
I noticed this as well. The problem is that when the vendor bundle is created, it doesn't seem to concatenate the modules in the same order consistently. Not sure where/why that is happening though. |
I'm looking to this snippet (I just reformatted a bit the map method) static create(bundler, config) {
let bundle = new exports.Bundle(bundler, config);
let dependencies = config.dependencies || [];
return Promise.all(
dependencies
.filter(x => bundler.itemIncludedInBuild(x))
.map(dependency => bundler
.configureDependency(dependency)
.then(description => bundle.addDependency(description))
)
).then(() => bundle);
} My guess is that the issue here is related to the fact that the addDependency method (which adds the dependencies to the 'includes' array used by the bundler) is executed as soon as the configureDependency method resolves and so the final dependency order is not guaranteed. |
If that's what's happening, that does make sense. Think you could make a PR for a fix? |
This has a definite effect for us: we are loading jquery and ms-signalr-client (a library that extends jQuery). ms-signalr-client requires that jquery be loaded first, and it is completely arbitrary whether or not it will work based on this bug. I would hope that creating an entry in aurelia.json like this would result in jquery being loaded first:
but it does not. I have a workaround of putting the jquery loader in the prepend:
I am following this issue and hope by the time we go to production in a few months that there might be some movement. Would love to help, but this PR may be above my paygrade as of yet. -- Paul |
@AStoker Any chance you can look into this? |
@EisenbergEffect, I can add it to my list, but right now I'm pretty loaded up at work, and we're house hunting too, so it might be a bit before I get to it unfortunately. I was really hoping somebody would submit a PR for this one :) |
@AStoker @EisenbergEffect This should be fixed with the integration of #427 |
Issue was either not fully resolved or has returned: #472 (comment)
|
That would be awesome, thanks! |
I'm submitting a bug report
0.21.0
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
v6.5.0
NPM Version:
3.10.8
Language:
TypeScript 2.0.3
Current behavior:
au new
selecting TypeScript as the transpiler.build.options.rev
totrue
inaurelia_project/aurelia.json
.au build
two or more times, without modifying source files or dependencies.The following example extracts can be seen from the output of each build:
The build generates different
vendor-bundle-[hash].js
files each time. Both the file contents are different (in terms of order of contents) and therefore the revision hashes are different too. Below is a visual diff to illustrate the result:This issue does not seem to affect app bundles. (Although as a separate issue the app bundle filename is referenced from the vendor bundle. This means, when revision hashes are used, a change to the source files will always generate a new vendor bundle revision hash. In my opinion this is a design issue.)
Expected/desired behavior:
I would expect the output of the bundle files to be deterministic in all cases. The order of the contents should not differ between builds and therefore nor should the revision hashes.
This is important for continuous deployment scenarios. You wouldn't want to deploy a new cache busting bundle filename if the source files and dependencies hadn't changed.
For example, consider deploying a large Aurelia app built using the Aurelia CLI to production multiple times per day. Dependencies have not changed between builds and yet users of the app will be forced to download the bundle script file after each deployment.
The text was updated successfully, but these errors were encountered: