-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: add LaTeX to Markdown #1734
Conversation
A few notes:
|
Check how big the katex.css file is, Don is concerned about size of loading it up front. |
It's 23KB |
@dsmmcken at 23kb I wouldn't be concerned about the extra weight |
For the linting issue, add You can also do |
packages/dashboard-core-plugins/src/panels/WidgetPanelTooltip.tsx
Outdated
Show resolved
Hide resolved
packages/dashboard-core-plugins/src/panels/MarkdownNotebook.tsx
Outdated
Show resolved
Hide resolved
Replace const path = require('path');
// List of node_modules that need to be transformed from ESM to CJS for jest to work
const nodeModulesToTransform = [
// monaco
'monaco-editor',
// plotly.js dependencies
'd3-interpolate',
'd3-color',
// react-markdown and its dependencies
'react-markdown',
'vfile',
'vfile-message',
'unist-util.*',
'unified',
'bail',
'is-plain-obj',
'trough',
'remark.*',
'mdast-util.*',
'micromark.*',
'decode-named-character-reference',
'trim-lines',
'property-information',
'hast-util.*',
'.*separated-tokens',
'ccount',
'devlop',
'escape-string-regexp',
'markdown-table',
'zwitch',
'longest-streak',
'rehype.*',
'web-namespaces',
'hastscript',
];
module.exports = {
transform: {
'.(ts|tsx|js|jsx)': [
'babel-jest',
{
rootMode: 'upward',
plugins: ['@deephaven/babel-preset/mockCssImportPlugin'],
},
],
},
// Makes Jest transform some node_modules when needed. Usually because they are pure ESM and Jest needs CJS
// By default, Jest ignores transforming node_modules
// When switching to transform all of node_modules, it caused a babel error
transformIgnorePatterns: [
`node_modules/(?!(${nodeModulesToTransform.join('|')})/)`,
],
moduleNameMapper: {
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
path.join(__dirname, './__mocks__/fileMock.js'),
'^fira$': 'identity-obj-proxy',
'^monaco-editor$': path.join(
__dirname,
'node_modules',
'monaco-editor/esm/vs/editor/editor.api.js'
),
// Handle monaco worker files
'\\.worker.*$': 'identity-obj-proxy',
// All packages except icons use src code
'^@deephaven/(?!icons)(.*)$': path.join(__dirname, './packages/$1/src'),
},
testEnvironment: 'jsdom',
setupFilesAfterEnv: [path.join(__dirname, './jest.setup.ts')],
}; |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1734 +/- ##
==========================================
- Coverage 46.48% 46.07% -0.42%
==========================================
Files 617 627 +10
Lines 37289 37625 +336
Branches 9378 9470 +92
==========================================
+ Hits 17335 17336 +1
- Misses 19900 20235 +335
Partials 54 54
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Due to our Vite config, the lazy loading doesn't actually offload much (only about 2.5kB). The vendor bundle increases from 792kB gzipped to 1417kB gzipped
I'll see if we can fix this. There was some reason we manually specified chunks and I think it was to split out monaco and plotly. I believe there was also some memory usage issue w/ the source maps and everything in 1 giant chunk
// plotly.js dependencies | ||
'd3-interpolate', | ||
'd3-color', | ||
// react-markdown and its dependencies |
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.
@mattrunyon this looks like it was fun to figure out
react-markdown
to8.0.7
remark-gfm
to4.0.0
rehype-katex 6.0.3
remark-math 5.1.1