Skip to content

Commit

Permalink
Add react-jsx-runtime for React 18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson committed Aug 27, 2024
1 parent d22af58 commit 59deca2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ interface RewriteSourcemapResult {
}

// Rougly, the operation performed here is:
// - Find the react-dom.production.min.js file in our sourcemap
// - Find an appropriate minified file listed in our sourcemap's contents
// - Find the version of React that matches the contents of that file
// - Load the original sourcemap for that version of React
// - Swap them out by rewriting the sourcemap
const SUPPORTED_PACKAGES =
/(react-dom\.profiling\.min\.js|react-dom\.production\.min\.js|react\.production\.min\.js)/;
/(react-dom\.profiling\.min\.js|react-dom\.production\.min\.js|react(-jsx-runtime)*\.production\.min\.js)/;

export function maybeRewriteSourcemapWithReactProd(
inputSourcemap: SourceMapV3,
Expand Down
6 changes: 6 additions & 0 deletions src/reactVersions.mts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ export const availableSourcemapDescriptors: ReactVersion[] = [
filename: "react.production.min.js",
contentHash: "12a71800adb60f93da6dfe5d40ebdf225101204dd51f5e7266cce243aefd6512",
},
{
version: "18.2.0",
package: "react",
filename: "react-jsx-runtime.production.min.js",
contentHash: "76e3364c46895ed2c4a8d5cc332e5e4ef31d6f732d35b1e56826dc5895245452",
},
{
version: "18.2.0",
package: "react-dom",
Expand Down

0 comments on commit 59deca2

Please sign in to comment.