-
Notifications
You must be signed in to change notification settings - Fork 364
Stop bundling _any_ mathquill styles/fonts - let host app do that! #2385
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
Changes from all commits
dd46e1e
041cf94
244028f
58b47fc
acf44e1
65203fc
357c027
0c069ea
74b367e
6db55ec
9facb1a
9300471
3888003
3d17c26
e3d7f06
0ed73a4
60e9460
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@khanacademy/math-input": minor | ||
| --- | ||
|
|
||
| Stop bundling mathquill CSS - enables consuming app to control bundling and font resolution | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,7 @@ | |
| "@storybook/react-vite": "^8.6.11", | ||
| "@swc-node/register": "^1.10.10", | ||
| "@swc/core": "1.11.13", | ||
| "@swc/helpers": "^0.5.17", | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw warnings that a few files couldn't resolve this module. I'm not sure why it didn't happen earlier, but adding this to ensure our builds are correct. |
||
| "@swc/jest": "^0.2.37", | ||
| "@testing-library/dom": "^10.3.1", | ||
| "@testing-library/jest-dom": "^6.4.6", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,10 +8,6 @@ module.exports = { | |
| "error", | ||
| { | ||
| packageDir: [__dirname, path.join(__dirname, "../../")], | ||
| // note(matthewc): I changed this in a time pinch and I'm not sure | ||
| // it's right so I made a ticket to circle back to it | ||
| // https://khanacademy.atlassian.net/browse/LC-864 | ||
| devDependencies: ["**/*.stories.tsx", "**/*.test.tsx"], | ||
|
Comment on lines
-11
to
-14
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @handeyeco Weird. I can remove this in this PR and all linting passes. 🤷♂️
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤷 |
||
| includeTypes: true, | ||
| }, | ||
| ], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| @import "./overrides.less"; | ||
| @import (inline) "../node_modules/mathquill/build/mathquill.css"; | ||
| @import "mathquill/build/mathquill.css"; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the correct import syntax to resolve a CSS/Less file out of an dependant npm package. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,8 +42,7 @@ | |
| "dependencies": { | ||
| "@khanacademy/keypad-context": "workspace:*", | ||
| "@khanacademy/perseus-core": "workspace:*", | ||
| "@khanacademy/perseus-utils": "workspace:*", | ||
| "mathquill": "file:../../vendor/mathquill-v1.0.0.tgz" | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We move this to be in |
||
| "@khanacademy/perseus-utils": "workspace:*" | ||
| }, | ||
| "devDependencies": { | ||
| "@khanacademy/mathjax-renderer": "catalog:", | ||
|
|
@@ -57,6 +56,7 @@ | |
| "aphrodite": "catalog:", | ||
| "jquery": "catalog:", | ||
| "katex": "0.11.1", | ||
| "mathquill": "github:Khan/mathquill#v1.0.3", | ||
| "perseus-build-settings": "workspace:*", | ||
| "prop-types": "catalog:", | ||
| "react": "catalog:", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -714,4 +714,4 @@ div.graphie { | |
| padding-top: 0; | ||
| } | ||
|
|
||
| @import "../../../math-input/less/main.less"; | ||
| @import (reference) "@khanacademy/math-input/styles.css"; | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This becomes a This means that consuming apps will need to ensure that math-input CSS is properly imported, but that's a one-line change and allows for deduplication of math-input CSS. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing we need to let Learning Equality know?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm a little confused by this changeset. Here you're saying "enables consuming app to control bundling and font resolution" but in the comment below you say "This resolve is for the fonts in Mathquill. We want to bundle them into the math-input package so that consumers of @khanacademy/math-input don't need to also depend on the mathquill package." The two comments seem at odds, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It gives consumers control by bundling the Mathquill fonts into the
@khanacademy/math-inputpackage complete with correct CSS files point to the bundled font files using relative paths.The custom resolve was for Mathquill fonts, but after you asked, I found I was able to simplify things and didn't need a custom resolver (the built-in one handles things fine). And that was exactly the motivation for updating Mathquill! Thanks.