Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Conversation

@DeeDeeG
Copy link
Contributor

@DeeDeeG DeeDeeG commented Feb 2, 2021

Requirements for Contributing a Bug Fix (from template, click to expand):

Identify the Bug

This PR fixes the github package for use with Atom's "dev mode".

See atom/github#2620 for background info and confirmation from a babel maintainer.

Details

(Brief summary: Atom's custom require.resolve() function breaks the latest @babel/core release's ability to load babel plugins with relative paths (./[path]). This in turn breaks the github package. We should consider updating our custom require.resolve() logic, perhaps. But for now, using the previous @babel/core release avoids the problem.)

(Only the github package needs @babel/core, so this only affects the github package. Even then, this fix is only needed for Atom's --dev mode, because during script/build the github package is built with its exact dependencies from its package-lock.json lockfile. (The github package's lockfile uses @babel/core 7.3.4). In --dev mode, the github package is loaded from the repository with dependencies listed in the Atom repo's main package-lock.json. So this PR fixes github in Atom's dev mode.)

Description of the Change

Downgrade @babel/core to the last compatible version for the github package, 7.12.9.

Alternate Designs

None.

Possible Drawbacks

None.

Verification Process

With this change checked out, and doing a quick apm install to update @babel/core in the node_modules folder, the github package now loads properly again when loading the repo contents with atom --dev ("dev mode").

(To reproduce the issue and verify the fix, you may need to delete the compile cache under ~/.atom/compile-cache.)

Release Notes

N/A

@babel/core 7.12.10 partly breaks when used with
Atom's custom require.resolve() function.

That in turn breaks the loading of the "github" package.

See atom/github#2620 for details.
@DeeDeeG DeeDeeG force-pushed the downgrade-babel-core branch from 15456b0 to 9fffafc Compare February 2, 2021 16:11
Copy link
Contributor

@sadick254 sadick254 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@sadick254 sadick254 merged commit 55df66b into atom:master Feb 2, 2021
@aminya
Copy link
Contributor

aminya commented Feb 2, 2021

Changing package-lock.json does not mean anything. You should add an entry to package.json and fix the version there.

Anyone can rewrite this change by regenerating the lock file.

@DeeDeeG
Copy link
Contributor Author

DeeDeeG commented Feb 2, 2021

@aminya if you want. That would cover more scenarios and be a more durable/thorough fix.

(If we do that, whenever a newer release of github is merged here with atom/github#2621 in it, we should un-pin @babel/core again in this repo's package.json. I was assuming that would probably happen before this became an issue. I would anticipate that only bumping github, OR completely deleting and recreating the package-lock.json lockfile, would cause @babel/core to resolve to the incompatible 7.12.10 version.)

I understand that you routinely regenerate the lockfiles over at the community fork. This PR's approach is not adequate for that workflow, but it is probably adequate for most other scenarios.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants