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

Use a more explicit styleModule key for js css imports #9427

Merged
merged 8 commits into from Dec 4, 2020

Conversation

jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Dec 3, 2020

References

Fixes #9423

Follow-up to #9407

Code changes

In #9407, we make the assumption that the package.json style key can be imported with a .js extension to get an equivalent module for the styles. This assumption does not hold for codemirror, for example (where the css is codemirror.css, and the main js file is codemirror.js). It probably doesn't hold for a number of other packages.

In this PR, we make this preference for js modules importing style files more explicit with a top-level styleModule key. This should fix the broken 3.0rc11 release noted in #9423

User-facing changes

Backwards-incompatible changes

@jasongrout jasongrout added this to the 3.0 milestone Dec 3, 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

It turns out that there are packages out there, like CodeMirror, that have their `main` and `style` files named the same, differing only in the .css or .js suffix, so we cannot just assume we can import the style file with a .js suffix. This makes things more explicit.
I ran the integrity script twice so changes would propagate through the packages.
@github-actions github-actions bot added Design System CSS tag:CSS For general CSS related issues and pecadilloes labels Dec 4, 2020
This pulls in jupyterlab/lumino#139, which adds styleModule keys to Lumino packages.
@jasongrout
Copy link
Contributor Author

I think this is ready for review/merge. I'm happy to make a release after this is merged, which would replace the broken 3.0rc11.

Copy link
Member

@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 5142a4a into jupyterlab:master Dec 4, 2020
jasongrout added a commit to jasongrout/jupyterlab that referenced this pull request Dec 11, 2020
In jupyterlab#9427, we introduced a new styleModule key instead of guessing about there being a js file corresponding to a style file. That change did not propagate to prebuilt extensions. This commit fixes prebuilt extensions to use styleModule if available.
jasongrout added a commit to jasongrout/jupyterlab that referenced this pull request Dec 11, 2020
In jupyterlab#9427, we introduced a new styleModule key instead of guessing about there being a js file corresponding to a style file. That change did not propagate to prebuilt extensions. This commit fixes prebuilt extensions to use styleModule if available.

Fixes jupyterlab#9459
@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 Jun 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Design System CSS pkg:application pkg:apputils pkg:attachments pkg:cells pkg:celltags pkg:codeeditor pkg:codemirror pkg:completer pkg:console status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. tag:CSS For general CSS related issues and pecadilloes tag:Examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notebook cell weirdness in 3.0rc11
3 participants