Skip to content
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

Javascipt diff #11

Open
GuySartorelli opened this issue Mar 1, 2023 · 2 comments
Open

Javascipt diff #11

GuySartorelli opened this issue Mar 1, 2023 · 2 comments

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented Mar 1, 2023

We've had a few PRs and merge-ups fail CI because the js step found difference between its built dist file and the one in the PR or merge-up. It takes a few tries of running yarn install && yarn build to get the same result as CI.

It's not clear what's causing this - it seems like CI is doing things correctly, because we do end up with the same result as it in the end. My current guess is that yarn install is using some slightly-outdated cache locally, which doesn't exist in CI... but the yarn.lock file being there should mean we always have the same versions of dependencies.

In either case, we need to change something either in our CI or in our local build processes because this keeps happening and is slowly becoming a barrier for getting changes through.

PR

@emteknetnz
Copy link
Member

Quite possibly some difference in whitespace that git is detected

Another possibility is that yarn build includes inline comments on the local of whoever last ran yarn build but the CI doesn't do this - or vice versa. Maybe also be line-break related, specifically if there's an line-break on the very last line of the file.

@emteknetnz
Copy link
Member

emteknetnz commented May 8, 2024

I think this only affects 4.13 line, specifically silvestripe-admin

I replicated this locally, all I did was run yarn build subsequent times. I took the generated client/dist/js/bundle-default.js and string replaced ; with ;\n and then look for text differences

Perhaps the older version of webpack is just a bit random with how it puts things together?

Around line 440 I found this - note that SearchBox.js changes to Search.js

emptyResultClassName:"popover-option-set__no-results",buttonClassName:"popover-option-set__button"},t.default=v},"./client/src/components/Search/SearchBox.js":function(e,t,n){"use strict";
function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");

js

emptyResultClassName:"popover-option-set__no-results",buttonClassName:"popover-option-set__button"},t.default=v},"./client/src/components/Search/Search.js":function(e,t,n){"use strict";
function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};
for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);
return n}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants