Skip to content
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

Support jsx dev runtime #2045

Merged
merged 5 commits into from
Dec 14, 2022
Merged

Support jsx dev runtime #2045

merged 5 commits into from
Dec 14, 2022

Conversation

remcohaszing
Copy link
Member

The JSX dev runtime exposes more debugging information to users. For example, React exposes positional information through React Devtools.

Although #2035 started off as an issue to support the __source prop, I have refrained from actually supporting the __source prop, as it’s specific to React. The automatic dev runtime supports this information without patching props.

Closes #2035

The JSX dev runtime exposes more debugging information to users. For
example, React exposes positional information through React Devtools.

Although #2035 started off as an issue to support the `__source` prop, I
have refrained from actually supporting the `__source` prop, as it’s
specific to React. The automatic dev runtime supports this information
without patching props.

Closes #2035
@vercel
Copy link

vercel bot commented May 18, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
mdx ✅ Ready (Inspect) Visit Preview Dec 8, 2022 at 3:38PM (UTC)

developmentSourceNode._source,
{fileName: 'path/to/file.js', lineNumber: 1, columnNumber: 1},
'should expose source information in the automatic jsx dev runtime'
)
Copy link
Member Author

@remcohaszing remcohaszing May 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test above uses an undocumented private property of React elements. The test below asserts the generated source code. None of these tests is ideal, but I’m not sure which is worse. I suggest to keep only one of them though.

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (6085e65) compared to base (38c2d46).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2045   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         2050      2060   +10     
=========================================
+ Hits          2050      2060   +10     
Impacted Files Coverage Δ
packages/mdx/lib/core.js 100.00% <100.00%> (ø)
packages/mdx/lib/plugin/recma-jsx-build.js 100.00% <100.00%> (ø)
packages/mdx/lib/util/resolve-evaluate-options.js 100.00% <100.00%> (ø)
packages/mdx/lib/plugin/recma-stringify.js 100.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@wooorm wooorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one idea.

I wonder whether we should document that automatic runtimes need the /jsx-dev-runtime for this to work. E.g., here: https://mdxjs.com/packages/mdx/#optionsjsxruntime

I believe we have some types for jsx, jsxs somewhere, should they include jsxDev?

Should jsxDev be needed in evaluate, run? https://mdxjs.com/packages/mdx/#evaluatefile-options, https://mdxjs.com/packages/mdx/#options-1

We should probably include some docs in https://mdxjs.com/packages/mdx/#optionsdevelopment as well

'should expose source information in the automatic jsx dev runtime'
)

assert.equal(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe good to move this one next to the jsx tests (L826), in a new test for automatic runtime output?
Sometimes the output changes a bit and then its easier if all the output tests are next to eachother?

@remcohaszing
Copy link
Member Author

remcohaszing commented May 24, 2022

Looks good, one idea.

I wonder whether we should document that automatic runtimes need the /jsx-dev-runtime for this to work. E.g., here: https://mdxjs.com/packages/mdx/#optionsjsxruntime

I believe we have some types for jsx, jsxs somewhere, should they include jsxDev?

Should jsxDev be needed in evaluate, run? https://mdxjs.com/packages/mdx/#evaluatefile-options, https://mdxjs.com/packages/mdx/#options-1

We should probably include some docs in https://mdxjs.com/packages/mdx/#optionsdevelopment as well

Good points. I’ll update the types and docs.

I think maybe this should be a separate option. This change will be fine for React / Preact users, but other frameworks might not support the JSX dev runtime. I.e. hastscript and xastscript don’t support it. We may add it in these two specific packages, because they are part of unified, but there may be other JSX runtimes out there that don’t support it either.

Of course people can set development: false, but if users have to do so, this would be a breaking change, and they lose other benefits of MDX development mode.

@wooorm
Copy link
Member

wooorm commented May 24, 2022

It might indeed break folks. I wonder if it can be considered a bug on the part of those runtimes, which can be solved by users by setting development: false.

Alternatively, could we add a runtime check: as we’re in development, we could import both development and production, defaulting to production if development is missing, potentially with a warning, and making the switch in v3?

@remcohaszing
Copy link
Member Author

Should jsxDev be needed in evaluate, run? https://mdxjs.com/packages/mdx/#evaluatefile-options, https://mdxjs.com/packages/mdx/#options-1

Yes. The automatic dev runtime needs jsxDEV, whereas the automatic production runtime needs jsx and jsxs. I suggest that for evaluate and run, we don’t accept the development option. Instead, we set development as Boolean(jsxDEV). This means that is the user passes a dev runtime instead of a production runtime, MDX will automatically switch to dev mode for compilation.

@wooorm
Copy link
Member

wooorm commented Aug 17, 2022

WDYT about:

could we add a runtime check: as we’re in development, we could import both development and production, defaulting to production if development is missing, potentially with a warning, and making the switch in v3?

I feel a lot for this, to prevent a breaking change. And as it is dev, it’s fine adding some more code.

@remcohaszing
Copy link
Member Author

It might indeed break folks. I wonder if it can be considered a bug on the part of those runtimes, which can be solved by users by setting development: false.

I don’t consider this to be a bug. A JSX automatic runtime implementation can fully function without supporting the dev runtime in Babel, TypeScript, SWC, and ESBuild. Although I wouldn’t mind making this assumption in a breaking change for MDX 3.0. Afaik most major JSX implementations support this.

Alternatively, could we add a runtime check: as we’re in development, we could import both development and production, defaulting to production if development is missing, potentially with a warning, and making the switch in v3?

I don’t understand. As far as I understand you mean to transform this (simplified):

# Hello

into this:

import { jsx } from 'framework/jsx-runtime'
import { jsxDEV } from 'framework/jsx-dev-runtime'

export default function MDXContent() {
  return jsx('h1', { children: 'Hello' })
}

This still breaks if the framework doesn’t support the jsx-dev-runtime.

I suggest a build time warning (once) instead if development !== devRuntime (or however we name the new option).

Alternatively we could keep a hardcoded list of frameworks that support the automatic dev runtime. and just apply it for those. This isn’t elegant, but it would make it a non-breaking change without bothering any users.

Do you know if it’s possible to query the npm registry to find out if such JSX runtimes even exist at all? If hastscript and xastscript are the only ones, we could just update this and not bother about this compatibility issue at all.

@wooorm
Copy link
Member

wooorm commented Aug 17, 2022

in Babel, TypeScript, SWC, and ESBuild.

Are you sure? I was under the impression that, if development is turned on in Babel, it takes jsxDEV, and thus crashes if that isn‘t there?

@wooorm
Copy link
Member

wooorm commented Aug 17, 2022

Hmm, taking TS as an example, instructed to run in the automatic dev runtime:

<a />

->

import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
const _jsxFileName = "file:///input.tsx";
_jsxDEV("a", {}, void 0, false, { fileName: _jsxFileName, lineNumber: 1, columnNumber: 1 }, this);

I was missing the dev- part in the import URL in my mind. Without that change, we could generate something like:

import * as runtime from "react/jsx-runtime";
let _jsx = runtime.jsx
if (runtime.jsxDEV) {
  _jsx = runtime.jsxDEV
} else {
  console.log('stuff')
}

...

But as it’s a different specifier, we can’t fix it at runtime...

@remcohaszing
Copy link
Member Author

remcohaszing commented Aug 17, 2022

in Babel, TypeScript, SWC, and ESBuild.

Are you sure? I was under the impression that, if development is turned on in Babel, it takes jsxDEV, and thus crashes if that isn‘t there?

My bad, you are right about Babel. I know I’m right about TypeScript and ESBuild. I’m unsure about SWC.

I believe the Babel transform defaults to looking at Babel’s development mode, but it has an undocumented plugin specific development override, so the dev transform could be disabled explicitly in development mode.

@wooorm
Copy link
Member

wooorm commented Aug 17, 2022

But as /jsx-dev-runtime is used by bundler/builder/etc, then they all throw for such runtimes in development already? In which case, it’s fine for us to follow that?

@remcohaszing
Copy link
Member Author

No, TypeScript uses the jsx compiler option, which can be set to either react (classic runtime), react-jsx (automatic runtime), or react-jsxdev (automatic dev runtime). ESBuild follows this. TypeScript doesn’t really have the development context that Babel does.

@remcohaszing
Copy link
Member Author

Anyway, I suspect the number of impacted users would be very low. React, Preact, and Emotion support the automatic runtime, Vue doesn’t use JSX transforms, we control hastscript and xastscript.

@wooorm
Copy link
Member

wooorm commented Aug 17, 2022

Two things. TS still takes /jsx-dev-runtime.

That's what I'm talking about.

Every tool takes that export specifier. So we can use it too.
If it is missing in a runtime, it'll throw an error. But every tool throws an error. So it's fine.

And, we need to take jsxDEV from it. It might not exist. From what I understand, several runtimes don't have it.
We can take it, and jsx, and default to the latter with a warning

There is a large chance that people link the same file, with the same exports, to both export entries. Which is fine, whether they export jsxDEV from it or not, in that case.

There is then only a tiny chance that someone has an export for /jsx-dev-runtime, without a jsxDEV, which is clearly wrong, and can crash.

@manucorporat
Copy link

any update on this?

@wooorm
Copy link
Member

wooorm commented Dec 2, 2022

The comment before your comment is the last update on this!

I think that, to land this without breaking, we need to import * as xxx from 'xxx/jsx-dev-runtime', and fall back to the regular xxx.jsx/xxx.jsxs functions, with a warning, when jsxDEV does not exist in xxx.
If someone is able to test particularly with svelte/solid that this isn’t needed, then we can do without.

I am fine with introducing a crash when /jsx-dev-runtime is not in the export map of the runtime, because Babel, esbuild, typescript, etc, also would fail on that package.

@manucorporat
Copy link

manucorporat commented Dec 2, 2022

So at Qwik we have MDX support in our meta framework and recently introduced a click-to-component feature that leverages this:
https://www.loom.com/share/e1c6261f10814362a76daeb7ee3f120c

we tried using the PR and works great!

I understand the worry about breaking changes, but virtually all the tools supports JSX-automatic, emit what MDX is doing in this PR right now (esbuild, rollup tsx plugins, and swc). It's part of JSX-automatic, if it breaks, i think the framework authors should fix it should fix it by exporting jsxDEV.

In the meantime, we are forking MDX and ship this feature :) but we would love not having to do it.

Thanks for your early response! this is such a cool project!

@wooorm
Copy link
Member

wooorm commented Dec 2, 2022

if it breaks, i think the framework authors should fix it should fix it by exporting jsxDEV.

I don’t want all Solid or Svelte users to suddenly break in a patch.

we are forking MDX and ship this feature :) but we would love not having to do it.

Perhaps you can spend the time to verify my above question. As that time is the thing that’s missing.

@remcohaszing
Copy link
Member Author

I intend to finish this, but currently other issues have higher priority for me. Feel free to work on it if this has high priority for you.

PS: It’s really cool to see how this is leveraged in Qwik!

@manucorporat
Copy link

manucorporat commented Dec 2, 2022

I tried to look into following the implementation suggested by @wooorm because i would love this PR being unblocked!
The generation of the proposed changed in outside the scope of MDX, but it would be a change in estree-util-build-jsx.

I dont think it's realistic and good idea to make MDX have a different transform to jsxDev, when everything is doing the same.

Instead, if what we want is to prevent a breaking change, i would create a new option, like jsxDevelopment: boolean, so effectively, jsxDev != development, then in the next major, we can merge jsxDev and development

@manucorporat
Copy link

manucorporat commented Dec 2, 2022

@wooorm
Copy link
Member

wooorm commented Dec 2, 2022

Thanks for looking that up!
I am particularly worried about what we recommend on our site. As that’s what people’ve been using for a year: https://mdxjs.com/docs/getting-started/#jsx.
The are solid and svelte JSX implementation mentioned there, each support a /jsx-dev-runtime entry in the export map (you found the solid alternative there, too).

However, you also mention that solid itself now support the JSX runtime. That’s new. I remember them initially being against having that. And it seems they do expose jsxDEV, but they do not have a /jsx-dev-runtime entry!

@ryansolid I think Solid needs a /jsx-dev-runtime entry, which can be the same as this. That’s what the automatic JSX runtime will use, when configured through esbuild/typescript/babel/mdx, when development is turned on.

@manucorporat
Copy link

manucorporat commented Dec 4, 2022

@wooorm For me understanding, the mdx integration with solid does not use the same jsx-runtime as the one in solid, cuz they have a total custom JSX transform, none of mdx is directly useful, instead MDX relies on solid-jsx. Notice that solid itself does not have vdom. solid-jsx is the external package that bring the compatibility

https://github.com/high1/solid-jsx/blob/main/package.json#L9-L10
https://github.com/high1/solid-jsx/blob/main/src/jsx-runtime.ts#L77

which does support jsxDEV (basically same as jsx)

@manucorporat
Copy link

Preact, solid-jsx, svelte-jsx, vue, qwik... so far all frameworks of libraries support the jsx mode, follow the defacto spec of having jsx-runtime and jsx-dev-runtime, the second exporting a jsxDev.

Any tool supporting jsx transform in development mode will emit jsxDev already, importing jsx-dev-runtime. Imo, it's perfectly safe to merge this PR, since:

  • all mentioned frameworks support it
  • it's outside the scope of mdx this transform(it's inestree-util-build-jsx, and it's safe for them)
  • the rest of tools already already doing this if you enable JSX-automatic

The amazing side effect of this PR is enable amazing dev tools already existing in this frameworks to jump directly to the mdx/md file!! and make their devtools better integrate.

@wooorm
Copy link
Member

wooorm commented Dec 4, 2022

the mdx integration with solid does not use the same jsx-runtime as the one in solid, cuz they have a total custom JSX transform, none of mdx is directly useful, instead MDX relies on solid-jsx. Notice that solid itself does not have vdom. solid-jsx is the external package that bring the compatibility

This is historically correct. Currently, Solid does provide its own automatic JSX runtime. It seems to do so for a while already. You mentioned this above yourself:

solid-jsx is the external package that bring the compatibility

It used to. And we link to it. As you show though, Solid now provides an automatic JSX runtime too.

which does support jsxDEV (basically same as jsx)

There are two parts that are needed for an automatic runtime, development or not, to work:

  • Export the correct variables (i.e., jsx and friends, or jsxDEV)
  • Export the correct specifier (i.e., ./jsx-runtime or ./jsx-dev-runtime)

As you and I checked and verified above, all projects (solid-jsx, svelte-jsx, react, preact, emotion) do both. But solid itself does not export ./jsx-dev-runtime. That is a problem.

Imo, it's perfectly safe to merge this PR

It seems that solid itself supports only part of the needed API. I believe my previous comment shows how Solid can solve that: #2045 (comment).

The amazing side effect of this PR [...]

That is the purpose of this PR. The side effect of this PR would be breaking several Solid users in a patch release.

@manucorporat
Copy link

Alright! https://github.com/solidjs/solid/pull/1393/files

could we unblock this PR once solid merge the fix? :)

@wooorm
Copy link
Member

wooorm commented Dec 4, 2022

Yes, that unblocks the PR, thank you! (Note though that I don’t know Solid enough to review the PR)

@manucorporat
Copy link

yep! no worries, reached Ryan to see what we can do about it

@manucorporat
Copy link

manucorporat commented Dec 6, 2022

Solid merged the PR to add jsx-dev-runtime, just waiting for a release from @ryansolid

solidjs/solid#1393

@remcohaszing
Copy link
Member Author

The only thing missing then is support for evaluate / run and documentation updates.

I see two solution to determine whether or not to use development mode:

  1. Throw an error if runtime properties are missing:

    if (options.development) {
      if (!options.jsxDEV) {
        throw new Error('Missing option jsxDEV required in development mode')
      }
    } else {
      if (!options.jsx) {
        throw new Error('Missing option jsx required in production mode')
      }
    
      if (!options.jsxs) {
        throw new Error('Missing option jsxs required in production mode')
      }
    }
  2. Try to recover. Determine development mode based on the runtime passed.

@wooorm
Copy link
Member

wooorm commented Dec 6, 2022

1) makes the most sense to me.
There's also 3): only use jsxDEV if both development and jsxDEV are given. In this case I think it's a clear programmer error I think, so I'm fine throwing, so approach 1

@remcohaszing
Copy link
Member Author

Ok, I’ll finish this PR then.

@manucorporat
Copy link

manucorporat commented Dec 6, 2022

so exciting! thank you team! you guys rock! @remcohaszing @wooorm

@manucorporat
Copy link

Just confirming, solidjs merged the PR to support jsx-dev-runtime and made a release with the fix!

@wooorm wooorm merged commit 641eb91 into mdx-js:main Dec 14, 2022
@wooorm wooorm added 🦋 type/enhancement This is great to have 💪 phase/solved Post is done labels Dec 14, 2022
@wooorm
Copy link
Member

wooorm commented Dec 14, 2022

Released, thanks both! :)

renovate bot referenced this pull request in ziyadedher/ziyadedher Dec 18, 2022
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@mdx-js/react](https://mdxjs.com)
([source](https://togithub.com/mdx-js/mdx)) | [`2.1.5` ->
`2.2.1`](https://renovatebot.com/diffs/npm/@mdx-js%2freact/2.1.5/2.2.1)
|
[![age](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/2.2.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/2.2.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/2.2.1/compatibility-slim/2.1.5)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/2.2.1/confidence-slim/2.1.5)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>mdx-js/mdx</summary>

### [`v2.2.1`](https://togithub.com/mdx-js/mdx/releases/tag/2.2.1)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.2.0...2.2.1)

- [`e293eaf`](https://togithub.com/mdx-js/mdx/commit/e293eafa) Remove
`assert/strict` for Node 14

**Full Changelog**: mdx-js/mdx@2.2.0...2.2.1

### [`v2.2.0`](https://togithub.com/mdx-js/mdx/releases/tag/2.2.0)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.1.5...2.2.0)

##### Features

- [`641eb91`](https://togithub.com/mdx-js/mdx/commit/641eb917) Add
support JSX development runtime
by [@&#8203;remcohaszing](https://togithub.com/remcohaszing) in
[https://github.com/mdx-js/mdx/pull/2045](https://togithub.com/mdx-js/mdx/pull/2045)

##### Patches

- [`3e0ab23`](https://togithub.com/mdx-js/mdx/commit/3e0ab236) Fix
`@mdx-js/node-loader` from patching all runtimes

##### Docs

- [`4a1415d`](https://togithub.com/mdx-js/mdx/commit/4a1415d2) Add note
about use with `vite-plugin-react`
- [`38c2d46`](https://togithub.com/mdx-js/mdx/commit/38c2d46a) Add note
about `rollup@2` in Vite
by [@&#8203;ryuujo1573](https://togithub.com/ryuujo1573) in
[https://github.com/mdx-js/mdx/pull/2180](https://togithub.com/mdx-js/mdx/pull/2180)
- [`caac5df`](https://togithub.com/mdx-js/mdx/commit/caac5df4) Update
docs for `solid-js` supporting JSX
- [`3a50cc3`](https://togithub.com/mdx-js/mdx/commit/3a50cc35) Add Solid
to JSX section in Getting Started guide
by [@&#8203;Djunnni](https://togithub.com/Djunnni) in
[https://github.com/mdx-js/mdx/pull/2159](https://togithub.com/mdx-js/mdx/pull/2159)
- [`1c83612`](https://togithub.com/mdx-js/mdx/commit/1c836126) Fix docs
on types
- [`2635caf`](https://togithub.com/mdx-js/mdx/commit/2635caf9) Replace
deprecated Intellij plugin in docs
by [@&#8203;slorber](https://togithub.com/slorber) in
[https://github.com/mdx-js/mdx/pull/2178](https://togithub.com/mdx-js/mdx/pull/2178)

**Full Changelog**: mdx-js/mdx@2.1.5...2.2.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ziyadedher/ziyadedher).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC42Mi4xIiwidXBkYXRlZEluVmVyIjoiMzQuNjIuMSJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jeff-mccoy referenced this pull request in zarf-dev/zarf Jan 28, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@mdx-js/react](https://mdxjs.com)
([source](https://togithub.com/mdx-js/mdx)) | [`^1.6.22` ->
`^2.0.0`](https://renovatebot.com/diffs/npm/@mdx-js%2freact/1.6.22/2.2.1)
|
[![age](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/2.2.1/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/2.2.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/2.2.1/compatibility-slim/1.6.22)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/2.2.1/confidence-slim/1.6.22)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>mdx-js/mdx</summary>

### [`v2.2.1`](https://togithub.com/mdx-js/mdx/releases/tag/2.2.1)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.2.0...2.2.1)

- [`e293eaf`](https://togithub.com/mdx-js/mdx/commit/e293eafa) Remove
`assert/strict` for Node 14

**Full Changelog**: mdx-js/mdx@2.2.0...2.2.1

### [`v2.2.0`](https://togithub.com/mdx-js/mdx/releases/tag/2.2.0)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.1.5...2.2.0)

##### Features

- [`641eb91`](https://togithub.com/mdx-js/mdx/commit/641eb917) Add
support JSX development runtime
by [@&#8203;remcohaszing](https://togithub.com/remcohaszing) in
[https://github.com/mdx-js/mdx/pull/2045](https://togithub.com/mdx-js/mdx/pull/2045)

##### Patches

- [`3e0ab23`](https://togithub.com/mdx-js/mdx/commit/3e0ab236) Fix
`@mdx-js/node-loader` from patching all runtimes

##### Docs

- [`4a1415d`](https://togithub.com/mdx-js/mdx/commit/4a1415d2) Add note
about use with `vite-plugin-react`
- [`38c2d46`](https://togithub.com/mdx-js/mdx/commit/38c2d46a) Add note
about `rollup@2` in Vite
by [@&#8203;ryuujo1573](https://togithub.com/ryuujo1573) in
[https://github.com/mdx-js/mdx/pull/2180](https://togithub.com/mdx-js/mdx/pull/2180)
- [`caac5df`](https://togithub.com/mdx-js/mdx/commit/caac5df4) Update
docs for `solid-js` supporting JSX
- [`3a50cc3`](https://togithub.com/mdx-js/mdx/commit/3a50cc35) Add Solid
to JSX section in Getting Started guide
by [@&#8203;Djunnni](https://togithub.com/Djunnni) in
[https://github.com/mdx-js/mdx/pull/2159](https://togithub.com/mdx-js/mdx/pull/2159)
- [`1c83612`](https://togithub.com/mdx-js/mdx/commit/1c836126) Fix docs
on types
- [`2635caf`](https://togithub.com/mdx-js/mdx/commit/2635caf9) Replace
deprecated Intellij plugin in docs
by [@&#8203;slorber](https://togithub.com/slorber) in
[https://github.com/mdx-js/mdx/pull/2178](https://togithub.com/mdx-js/mdx/pull/2178)

**Full Changelog**: mdx-js/mdx@2.1.5...2.2.0

### [`v2.1.5`](https://togithub.com/mdx-js/mdx/releases/tag/2.1.5)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.1.4...2.1.5)

- [`90fa493`](https://togithub.com/mdx-js/mdx/commit/90fa4935) Fix bug
with (injected) custom elements and layouts

**Full Changelog**: mdx-js/mdx@2.1.4...2.1.5

### [`v2.1.4`](https://togithub.com/mdx-js/mdx/releases/tag/2.1.4)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.1.3...2.1.4)

##### Patches

- [`9d2aa80`](https://togithub.com/mdx-js/mdx/commit/9d2aa80b) Add file,
positional info to crashes in webpack loader
by [@&#8203;Twipped](https://togithub.com/Twipped) in
[https://github.com/mdx-js/mdx/pull/2124](https://togithub.com/mdx-js/mdx/pull/2124)
- [`478c78b`](https://togithub.com/mdx-js/mdx/commit/478c78b7) Fix
support for Node loaders

##### Docs

- [`56d7066`](https://togithub.com/mdx-js/mdx/commit/56d70660) Add Astro
to site generator docs
by [@&#8203;bholmesdev](https://togithub.com/bholmesdev) in
[https://github.com/mdx-js/mdx/pull/2118](https://togithub.com/mdx-js/mdx/pull/2118)
- [`996771a`](https://togithub.com/mdx-js/mdx/commit/996771ae) Add
missing `import` to site example
by [@&#8203;elpddev](https://togithub.com/elpddev) in
[https://github.com/mdx-js/mdx/pull/2115](https://togithub.com/mdx-js/mdx/pull/2115)

**Full Changelog**: mdx-js/mdx@2.1.3...2.1.4

### [`v2.1.3`](https://togithub.com/mdx-js/mdx/releases/tag/2.1.3)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.1.2...2.1.3)

##### Core

- [`9904838`](https://togithub.com/mdx-js/mdx/commit/9904838a) Fix
rewriting of components for custom elements
by [@&#8203;bholmesdev](https://togithub.com/bholmesdev) in
[https://github.com/mdx-js/mdx/pull/2101](https://togithub.com/mdx-js/mdx/pull/2101)

##### Docs

- [`69a15b7`](https://togithub.com/mdx-js/mdx/commit/69a15b76) Add link
to official `mdx-js/vscode-mdx`
by [@&#8203;jasikpark](https://togithub.com/jasikpark) in
[https://github.com/mdx-js/mdx/pull/2098](https://togithub.com/mdx-js/mdx/pull/2098)

##### Internal stuff that slightly improve stuff

- [`529b96a`](https://togithub.com/mdx-js/mdx/commit/529b96aa) Replace
`astring` with `estree-util-to-js`
- [`7d8dc11`](https://togithub.com/mdx-js/mdx/commit/7d8dc11c) Add `id`
field to esbuild messages
- [`7f37b95`](https://togithub.com/mdx-js/mdx/commit/7f37b95b) Update
`@types/estree-jsx`

**Full Changelog**: mdx-js/mdx@2.1.2...2.1.3

### [`v2.1.2`](https://togithub.com/mdx-js/mdx/releases/tag/2.1.2)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.1.1...2.1.2)

##### Core

- [`7bcd705`](https://togithub.com/mdx-js/mdx/commit/7bcd7059) Fix some
performance by improving vdom diffing
by [@&#8203;0phoff](https://togithub.com/0phoff) in
[https://github.com/mdx-js/mdx/pull/2062](https://togithub.com/mdx-js/mdx/pull/2062)
- [`f77c33f`](https://togithub.com/mdx-js/mdx/commit/f77c33f5) Fix
support for `baseUrl` rewriting `import.meta.url`
by [@&#8203;wooorm](https://togithub.com/wooorm) in
[https://github.com/mdx-js/mdx/pull/2021](https://togithub.com/mdx-js/mdx/pull/2021)

##### Docs

- [`3579aa3`](https://togithub.com/mdx-js/mdx/commit/3579aa38) Add use
of tla in docs
- [`366ddb4`](https://togithub.com/mdx-js/mdx/commit/366ddb4d) Update
examples in readme
- [`63fd208`](https://togithub.com/mdx-js/mdx/commit/63fd208d) Add
`@next/mdx` to Next.js getting started guide
by [@&#8203;remcohaszing](https://togithub.com/remcohaszing) in
[https://github.com/mdx-js/mdx/pull/2040](https://togithub.com/mdx-js/mdx/pull/2040)
- [`7f9a5f4`](https://togithub.com/mdx-js/mdx/commit/7f9a5f4e) Add
improved getting started for current CRA 5 integration
by [@&#8203;userzimmermann](https://togithub.com/userzimmermann) in
[https://github.com/mdx-js/mdx/pull/2010](https://togithub.com/mdx-js/mdx/pull/2010)
- [`5fa82d8`](https://togithub.com/mdx-js/mdx/commit/5fa82d81) Add
`recma-nextjs-static-props` to list of plugins
by [@&#8203;remcohaszing](https://togithub.com/remcohaszing) in
[https://github.com/mdx-js/mdx/pull/2033](https://togithub.com/mdx-js/mdx/pull/2033)
- [`3c51a43`](https://togithub.com/mdx-js/mdx/commit/3c51a434) Add
`remark-mdx-math-enhanced` to list of plugins
by [@&#8203;mattvague](https://togithub.com/mattvague) in
[https://github.com/mdx-js/mdx/pull/2028](https://togithub.com/mdx-js/mdx/pull/2028)

**Full Changelog**: mdx-js/mdx@2.1.1...2.1.2

### [`v2.1.1`](https://togithub.com/mdx-js/mdx/releases/tag/2.1.1)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.1.0...2.1.1)

- [`e79fc2b`](https://togithub.com/mdx-js/mdx/commit/e79fc2be)
[`0df684b`](https://togithub.com/mdx-js/mdx/commit/0df684bc) Fix to
improve `_missingMdxReference`
by [@&#8203;vlad-zhukov](https://togithub.com/vlad-zhukov) in
[https://github.com/mdx-js/mdx/pull/1986](https://togithub.com/mdx-js/mdx/pull/1986),
[https://github.com/mdx-js/mdx/pull/1988](https://togithub.com/mdx-js/mdx/pull/1988)

**Full Changelog**: mdx-js/mdx@2.1.0...2.1.1

### [`v2.1.0`](https://togithub.com/mdx-js/mdx/releases/tag/2.1.0)

[Compare Source](https://togithub.com/mdx-js/mdx/compare/2.0.0...2.1.0)

##### Core

- [`aff6de4`](https://togithub.com/mdx-js/mdx/commit/aff6de4f) **minor**
add support for passing options to `remark-rehype`
by [@&#8203;stefanprobst](https://togithub.com/stefanprobst) in
[https://github.com/mdx-js/mdx/pull/1935](https://togithub.com/mdx-js/mdx/pull/1935)
- [`5d4355e`](https://togithub.com/mdx-js/mdx/commit/5d4355e4) **patch**
replace `got` w/ `node-fetch`
by [@&#8203;wooorm](https://togithub.com/wooorm) in
[https://github.com/mdx-js/mdx/pull/1978](https://togithub.com/mdx-js/mdx/pull/1978)
- [`656a4ae`](https://togithub.com/mdx-js/mdx/commit/656a4ae5) **patch**
remove use of `URL` from `url`
by [@&#8203;zfben](https://togithub.com/zfben) in
[https://github.com/mdx-js/mdx/pull/1976](https://togithub.com/mdx-js/mdx/pull/1976)
- [`3f739a3`](https://togithub.com/mdx-js/mdx/commit/3f739a34) **patch**
add missing dependency
by [@&#8203;bensmithett](https://togithub.com/bensmithett) in
[https://github.com/mdx-js/mdx/pull/1936](https://togithub.com/mdx-js/mdx/pull/1936)

##### Site

- [`2886021`](https://togithub.com/mdx-js/mdx/commit/28860214)
[`71bc6ff`](https://togithub.com/mdx-js/mdx/commit/71bc6ff9)
[`4b514e1`](https://togithub.com/mdx-js/mdx/commit/4b514e1a) Fix
playground
by [@&#8203;homumado](https://togithub.com/homumado) in
[https://github.com/mdx-js/mdx/pull/1975](https://togithub.com/mdx-js/mdx/pull/1975)
and
[https://github.com/mdx-js/mdx/pull/1931](https://togithub.com/mdx-js/mdx/pull/1931),
and by [@&#8203;VitorLuizC](https://togithub.com/VitorLuizC) in
[https://github.com/mdx-js/mdx/pull/1928](https://togithub.com/mdx-js/mdx/pull/1928)

##### Docs

- [`e6f6bc8`](https://togithub.com/mdx-js/mdx/commit/e6f6bc85) Fix to
improve example
by [@&#8203;dawidjaniga](https://togithub.com/dawidjaniga) in
[https://github.com/mdx-js/mdx/pull/1961](https://togithub.com/mdx-js/mdx/pull/1961)
- [`e527ac7`](https://togithub.com/mdx-js/mdx/commit/e527ac75) Fix typo
by [@&#8203;jbesomi](https://togithub.com/jbesomi) in
[https://github.com/mdx-js/mdx/pull/1949](https://togithub.com/mdx-js/mdx/pull/1949)

**New Contributors**: Thanks
[@&#8203;VitorLuizC](https://togithub.com/VitorLuizC),
[@&#8203;homumado](https://togithub.com/homumado),
[@&#8203;bensmithett](https://togithub.com/bensmithett),
[@&#8203;stefanprobst](https://togithub.com/stefanprobst),
[@&#8203;jbesomi](https://togithub.com/jbesomi),
[@&#8203;dawidjaniga](https://togithub.com/dawidjaniga),
[@&#8203;zfben](https://togithub.com/zfben)

**Full Changelog**: mdx-js/mdx@2.0.0...2.1.0

### [`v2.0.0`](https://togithub.com/mdx-js/mdx/releases/tag/2.0.0)

[Compare
Source](https://togithub.com/mdx-js/mdx/compare/v1.6.22...2.0.0)

Welcome to MDX 2! See the of the website for everything:

-   MDX 2: https://mdxjs.com/blog/v2/
-   Migrating: https://mdxjs.com/migrating/v2/

<details><summary>Changelog since last RC</summary>

##### `@mdx-js/mdx`

- [`4a48f1f`](https://togithub.com/mdx-js/mdx/commit/4a48f1f4) Fix
custom elements
([#&#8203;1911](https://togithub.com/mdx-js/mdx/issues/1911))

##### `@mdx-js/react`

- [`9ca9d40`](https://togithub.com/mdx-js/mdx/commit/9ca9d404) Fix
unnecessary top-level context changes
([#&#8203;1924](https://togithub.com/mdx-js/mdx/issues/1924))

##### `@mdx-js/loader`

- [`e0b697a`](https://togithub.com/mdx-js/mdx/commit/e0b697ab)
[`9d5501b`](https://togithub.com/mdx-js/mdx/commit/9d5501b2) Add
improved webpack cache
([#&#8203;1912](https://togithub.com/mdx-js/mdx/issues/1912),
[#&#8203;1916](https://togithub.com/mdx-js/mdx/issues/1916))

##### `@mdx-js/esbuild`

- [`5c61f57`](https://togithub.com/mdx-js/mdx/commit/5c61f577) Fix
resolve base in esbuild loader
([#&#8203;1854](https://togithub.com/mdx-js/mdx/issues/1854))

##### `remark-mdx`

- [`a5daaad`](https://togithub.com/mdx-js/mdx/commit/a5daaad6) Update
`mdast-util-mdx`
([#&#8203;1925](https://togithub.com/mdx-js/mdx/issues/1925))

</details>

#### New Contributors

Thanks [@&#8203;redallen](https://togithub.com/redallen),
[@&#8203;lonyele](https://togithub.com/lonyele),
[@&#8203;PaulieScanlon](https://togithub.com/PaulieScanlon),
[@&#8203;pd4d10](https://togithub.com/pd4d10),
[@&#8203;Gowee](https://togithub.com/Gowee),
[@&#8203;mskelton](https://togithub.com/mskelton),
[@&#8203;ihupoo](https://togithub.com/ihupoo),
[@&#8203;remcohaszing](https://togithub.com/remcohaszing),
[@&#8203;loreanvictor](https://togithub.com/loreanvictor),
[@&#8203;ChrisChinchilla](https://togithub.com/ChrisChinchilla),
[@&#8203;glitteringkatie](https://togithub.com/glitteringkatie),
[@&#8203;mvasilkov](https://togithub.com/mvasilkov),
[@&#8203;jablko](https://togithub.com/jablko),
[@&#8203;michaeloliverx](https://togithub.com/michaeloliverx),
[@&#8203;yordis](https://togithub.com/yordis),
[@&#8203;rodrez](https://togithub.com/rodrez),
[@&#8203;imballinst](https://togithub.com/imballinst),
[@&#8203;gaearon](https://togithub.com/gaearon).

**Full Changelog**: mdx-js/mdx@v1.6.3...2.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/defenseunicorns/zarf).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTEuMSIsInVwZGF0ZWRJblZlciI6IjM0LjExMS4xIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@kherock
Copy link

kherock commented Feb 24, 2023

This needs to increment the minimum version of estree-util-build-jsx to ^2.1.0. I was getting the error

TypeError: _jsx is not a function

until I was able to track down this dependency in my lockfile!

@remcohaszing
Copy link
Member Author

The version range ^2.1.0 is a subset of^2.0.0. So no version bump is needed.

The policy in the unified / mdx ecosystem is to use version ranges of the form ^x.0.0.

@mdx-js mdx-js locked as resolved and limited conversation to collaborators Feb 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💪 phase/solved Post is done 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

Support React __source prop
5 participants