-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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: react 19 ftw #7329
base: main
Are you sure you want to change the base?
feat: react 19 ftw #7329
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import {MDXComponents} from 'components/MDX/MDXComponents'; | |
|
||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
// ~~~~ IMPORTANT: BUMP THIS IF YOU CHANGE ANY CODE BELOW ~~~ | ||
const DISK_CACHE_BREAKER = 9; | ||
const DISK_CACHE_BREAKER = 11; | ||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
export default async function compileMDX( | ||
|
@@ -36,13 +36,13 @@ export default async function compileMDX( | |
lockfile: fs.readFileSync(process.cwd() + '/yarn.lock', 'utf8'), | ||
}) | ||
); | ||
const cached = await store.get(hash); | ||
if (cached) { | ||
console.log( | ||
'Reading compiled MDX for /' + path + ' from ./node_modules/.cache/' | ||
); | ||
return cached; | ||
} | ||
// const cached = await store.get(hash); | ||
// if (cached) { | ||
// console.log( | ||
// 'Reading compiled MDX for /' + path + ' from ./node_modules/.cache/' | ||
// ); | ||
// return cached; | ||
// } | ||
Comment on lines
+39
to
+45
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. for now removed caching re enable before we push it to main |
||
if (process.env.NODE_ENV === 'production') { | ||
console.log( | ||
'Cache miss for MDX for /' + path + ' from ./node_modules/.cache/' | ||
|
@@ -60,13 +60,15 @@ export default async function compileMDX( | |
.join('\n'); | ||
|
||
// Turn the MDX we just read into some JS we can execute. | ||
const {remarkPlugins} = require('../../plugins/markdownToHtml'); | ||
// const {remarkPlugins} = require('../../plugins/markdownToHtml'); | ||
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. check why we aren't able to use remark / rehype plugins after upgrading it. getting
|
||
const {compile: compileMdx} = await import('@mdx-js/mdx'); | ||
const visit = (await import('unist-util-visit')).default; | ||
const jsxCode = await compileMdx(mdxWithFakeImports, { | ||
remarkPlugins: [ | ||
...remarkPlugins, | ||
(await import('remark-gfm')).default, | ||
// ...remarkPlugins, | ||
( | ||
await import('remark-gfm') | ||
).default, | ||
(await import('remark-frontmatter')).default, | ||
], | ||
rehypePlugins: [ | ||
|
@@ -144,7 +146,10 @@ export default async function compileMDX( | |
|
||
// Serialize a server React tree node to JSON. | ||
function stringifyNodeOnServer(key: unknown, val: any) { | ||
if (val != null && val.$$typeof === Symbol.for('react.element')) { | ||
if ( | ||
val != null && | ||
val.$$typeof === Symbol.for('react.transitional.element') | ||
) { | ||
// Remove fake MDX props. | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const {mdxType, originalType, parentName, ...cleanProps} = val.props; | ||
|
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.
https://github.com/facebook/react/blob/c56c6234328a29930487295afe61597db48f058c/packages/react/src/ReactChildren.js#L245
Im unsure what this is used for and also should I update react to soft check for _store?