Add .gitattributes so Windows checkouts do not corrupt the vendored bundles - #2
Merged
Merged
Conversation
…undles support.js loads the vendored React, ReactDOM and Babel bundles with a Subresource Integrity digest, and SRI hashes exact bytes. With no .gitattributes, Git's default Windows behaviour (core.autocrlf=true) rewrites LF to CRLF on checkout. The digests then stop matching, the browser refuses to execute the bundles, React never loads, and because the runtime hides the authored markup before booting, every .dc.html page renders completely blank: HTTP 200, no broken links, no console error, nothing on screen. The published site is unaffected. Only the Windows working copy is broken, which makes it a genuinely confusing first experience for a contributor. The committed blobs are already pristine LF, verified by their SHA-384 digests matching the SRI constants support.js declares, so no renormalisation is needed. This only stops the checkout filter from touching them. The file is taken verbatim from the topic/quality-gates branch, where it was written, so that the two land without conflicting.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
.gitattributestomain, taken verbatim from thetopic/quality-gatesbranch where it was written.Why this cannot wait for #1
Cloning this repository on Windows today produces a completely broken working copy, and the cause is invisible.
support.jsloads the vendored React, ReactDOM and Babel bundles with a Subresource Integrity digest, and SRI hashes exact bytes. Git's default on Windows (core.autocrlf=true) rewrites LF to CRLF on checkout, so the digests stop matching, the browser refuses to execute the bundles, and React never loads. Because the runtime hides the authored markup before booting, the result is HTTP 200, no broken links, no console error, and nothing on screen..gitattributesexists ontopic/quality-gates(#1), but that does not help anyone cloning before it merges, and it does not help the clone itself:git clonechecks out the default branch first, somainhaving no.gitattributesis what does the damage.Verification
Cloning each branch with
core.autocrlf=trueand hashing the result:maintodaysupport.jsreact.production.min.jssha384-t63xaoqI4/…sha384-DGyLxAyjq0f9…sha384-DGyLxAyjq0f9…react-dom.production.min.jssha384-8Y1L+f1y2tWR…sha384-gTGxhz21lVGY…sha384-gTGxhz21lVGY…babel.min.jssha384-nFyaaMobkrf0…sha384-m08KidiNqLdp…sha384-m08KidiNqLdp…Serving each clone and loading
solar-system.dc.html:maintoday:window.Reactundefined, 0 characters renderedNo renormalisation needed
The committed blobs are already pristine LF: their SHA-384 digests match the SRI constants
support.jsdeclares, and they contain zero CRLF byte pairs. This change only stops the checkout filter from touching them, so no file contents change and nogit add --renormalizeis required.Merge order
Independent of #1 and safe to merge first. The file is byte-identical to the copy on
topic/quality-gates, so #1 will not conflict on it.