Skip to content

inline forkPullRequestRemoteName to address ReferenceError - #4859

Closed
shiftkey wants to merge 4 commits into
masterfrom
another-minification-bug
Closed

shiftkey wants to merge 4 commits into
masterfrom
another-minification-bug

Conversation

@shiftkey

@shiftkey shiftkey commented Jun 4, 2018

Copy link
Copy Markdown
Member

Fixes #4842

Before:

  • run current master with yarn build:prod and yarn start:prod
  • choose a GitHub repository
  • try and checkout a pull request from a fork
  • 💥 no checkout, errors in dev tools console

Spelunk down to find the underlying JS:

After:

  • run this version with yarn build:prod and yarn start:prod
  • choose a GitHub repository
  • try and checkout a pull request from a fork
  • ✅ checkout occurs, no errors in dev tools console

This is now the underlying JS:

@shiftkey shiftkey added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jun 4, 2018
Comment thread app/src/lib/stores/app-store.ts Outdated
const remoteName = `${ForkedRemotePrefix}${
head.gitHubRepository.owner.login
)
}`

This comment was marked as spam.

@iAmWillShepherd iAmWillShepherd self-assigned this Jun 4, 2018
@niik

niik commented Jun 4, 2018

Copy link
Copy Markdown
Member

@shiftkey This is the second runtime issue due to incorrectly minified code, right? #4848 being the first one.

I think we need to seriously consider downgrading whatever needs downgrading to get rid of this problem. We need to be able to trust that our code gets transpiled and minified correctly. Have you isolated what's causing the problem? If it's uglify-es then could we get around it by turning the babel minifier back on (and eating the compile time cost)?

const remoteName = forkPullRequestRemoteName(
head.gitHubRepository.owner.login
)
const remoteName = ForkedRemotePrefix + head.gitHubRepository.owner.login

This comment was marked as spam.

@shiftkey

shiftkey commented Jun 4, 2018 •

Copy link
Copy Markdown
Member Author

This is the second runtime issue due to incorrectly minified code, right?

Yep. The timelines for both fit with the upgrade to Webpack 4.

Have you isolated what's causing the problem?

The last time I looked at this with #2531 it was a challenge to get an isolated repro away from the Desktop source - I'm happy to try this again tomorrow if you don't have bandwidth.

If it's uglify-es then could we get around it by turning the babel minifier back on (and eating the compile time cost)?

I'm fine with this workaround if we can't currently trust the emitted minified code.

@shiftkey

shiftkey commented Jun 4, 2018

Copy link
Copy Markdown
Member Author

🍎

@shiftkey

shiftkey commented Jun 5, 2018

Copy link
Copy Markdown
Member Author

I've opened a branch off release-1.2.2 to illustrate reproducing the issue in isolation: https://github.com/desktop/desktop/compare/reproduce-minification-issue?expand=1

  • f760e95 - reproduce against one of the known problem files (:boom:)
  • 68524ee - switch away from mode to use the previous configuration (:boom:)
  • f6f76f8 - pull in babel-minify-webpack-plugin and test that problem JS is no longer emitted ✅

@shiftkey

shiftkey commented Jun 5, 2018

Copy link
Copy Markdown
Member Author

Closing this in favour of #4871

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

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants