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

Do not error if requiredVersion is not provided. #9321

Merged
merged 2 commits into from
Nov 12, 2020

Conversation

jasongrout
Copy link
Contributor

References

Code changes

If a package overrides the sharing config for a dependency, it might have forgotton to give the requiredVersion (so requiredVersion is undefined). In this case, don't error (which is what currently is done with an undefined error), but instead just go with the default webpack behavior.

I found this by playing around with the sharedPackages key, and forgetting to add requiredVersion...

User-facing changes

Backwards-incompatible changes

@jasongrout jasongrout added this to the 3.0 milestone Nov 12, 2020
@jupyterlab-dev-mode
Copy link

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

@jtpio
Copy link
Member

jtpio commented Nov 12, 2020

I found this by playing around with the sharedPackages key, and forgetting to add requiredVersion...

Is the shared package (the one specified in sharedPackages) provided by a federated extension?

Looks like this isn't an issue when the extension is built into jupyterlab (installed from npm), as the requiredVersion would be defaulted here:

// Add any extension packages that are not in resolutions (i.e., installed from npm)
for (let pkg of extensionPackages) {
if (shared[pkg] === undefined) {
shared[pkg] = {
requiredVersion: require(`${pkg}/package.json`).version,
eager: true
};
}
}

@jasongrout
Copy link
Contributor Author

Looks like this isn't an issue when the extension is built into jupyterlab (installed from npm), as the requiredVersion would be defaulted here:

I triggered it by installing an extension (not federated) that had a sharedPackages override, and I forgot to put a requiredVersion key in. In other words, from

pkgShared[pkg] = config;

If a package overrides the sharing config for a dependency, it might have forgotton to give the requiredVersion (so requiredVersion is undefined). In this case, don't error, but instead just go with the default webpack behavior.
@jasongrout
Copy link
Contributor Author

Rebased on master to hopefully fix the tests

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thanks!

@blink1073 blink1073 merged commit c2f63ee into jupyterlab:master Nov 12, 2020
@github-actions github-actions bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label May 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants