Skip to content

Commit

Permalink
Re-bundle JS in a fresh environment (#2710)
Browse files Browse the repository at this point in the history
`npm`/`yarn` is non-deterministic when it comes to bundling
dependencies, and so you can very easily end up with a dependency drift
(especially when you're being strict about what you build elsewhere).

It turns out that this is what #2680 was showing. If we clean the whole
environment (`git clean -fdx`), then run `setup` and the other steps
that the Action runs through, we get the same result.
  • Loading branch information
nickcharlton authored Nov 19, 2024
1 parent 34834ac commit df639c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 29 deletions.
32 changes: 5 additions & 27 deletions app/assets/builds/administrate/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14372,47 +14372,25 @@
}
start() {
this.directUpload.create(this.directUploadDidComplete.bind(this));
this.dispatch("start");
}
directUploadWillStoreFileWithXHR(xhr) {
xhr.upload.addEventListener("progress", (event) => {
const progress = event.loaded / event.total * 100;
this.attachment.setUploadProgress(progress);
if (progress) {
this.dispatch("progress", {
progress
});
}
});
}
directUploadDidComplete(error2, attributes) {
if (error2) {
this.dispatchError(error2);
} else {
this.attachment.setAttributes({
sgid: attributes.attachable_sgid,
url: this.createBlobUrl(attributes.signed_id, attributes.filename)
});
this.dispatch("end");
throw new Error(`Direct upload failed: ${error2}`);
}
this.attachment.setAttributes({
sgid: attributes.attachable_sgid,
url: this.createBlobUrl(attributes.signed_id, attributes.filename)
});
}
createBlobUrl(signedId, filename) {
return this.blobUrlTemplate.replace(":signed_id", signedId).replace(":filename", encodeURIComponent(filename));
}
dispatch(name, detail = {}) {
detail.attachment = this.attachment;
return dispatchEvent2(this.element, `direct-upload:${name}`, {
detail
});
}
dispatchError(error2) {
const event = this.dispatch("error", {
error: error2
});
if (!event.defaultPrevented) {
alert(error2);
}
}
get directUploadUrl() {
return this.element.dataset.directUploadUrl;
}
Expand Down
4 changes: 2 additions & 2 deletions app/assets/builds/administrate/application.js.map

Large diffs are not rendered by default.

0 comments on commit df639c1

Please sign in to comment.