rsnext/packages
Jiachi Liu 416cf45f5c
Fix next/image usage in mdx (#64875)
### What

Apply the react aliases for app dir also to the files with
`pagesExtension`

### Why

In the page bundle of mdx page:

In RSC layer react is referencing to the insatlled react 18.2.0 's
`jsx-runtime` to create each JSX element. The react 18.2 JSX runtime
access `propTypes` of the component type and then it crashes 💥
In RSC layer it should use the built-in react canary's `jsx-runtime`.

The reason that it didn't use the built-in one is we're using customized
`pageExtension` `["mdx"]` for mdx, where we didn't apply all these rules
for the files with `pageExtension`, but only the js and ts files by
default.

For mdx specifically, we cannot only applied to
`(page|layout|route).[page extension]` cause every mdx file needs to
have proper resolution. Since this doesn't break transform, it's safe to
apply for all files with page extension.

Fixes #58888 

Closes NEXT-3187
2024-04-23 13:37:49 +02:00
..
create-next-app v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
eslint-config-next v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
eslint-plugin-next v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
font v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
next Fix next/image usage in mdx (#64875) 2024-04-23 13:37:49 +02:00
next-bundle-analyzer v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
next-codemod v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
next-env v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
next-mdx v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
next-plugin-storybook v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
next-polyfill-module v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
next-polyfill-nomodule v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
next-swc feat(next-core): support parsing matcher config object (#64678) 2024-04-23 09:55:24 +02:00
react-refresh-utils v14.3.0-canary.18 2024-04-22 23:22:37 +00:00
third-parties v14.3.0-canary.18 2024-04-22 23:22:37 +00:00