mdx-js / mdx

Markdown for the component era
https://mdxjs.com
MIT License
17.76k stars 1.14k forks source link

`hast-util-to-estree` should be bumped to v3 in `@mdx-js/mdx` #2336

Closed dimaMachina closed 1 year ago

dimaMachina commented 1 year ago

Initial checklist

Affected packages and versions

@mdx-js/mdx

Link to runnable example

No response

Steps to reproduce

https://github.com/mdx-js/mdx/blob/8a563128a346a637dfe6bc83df55f069947d2337/packages/mdx/package.json#L57 should be bumped to v3

let's set style as string in plugin and provide it in rehypePlugins

node.properties.style = 'background-color:#000002; --shiki-dark-bg:#000002; color:#000002; -webkit-transform: rotate(0.01turn); -ms-transform: rotate(0.01turn); --fg: #0366d6; color: var(--fg)'

Expected behavior

with v3

return <_components.h1 style={{
  backgroundColor: "#000002",
  "--shiki-dark-bg": "#000002",
  color: "var(--fg)",
  WebkitTransform: "rotate(0.01turn)",
  msTransform: "rotate(0.01turn)",
  "--fg": "#0366d6"
}}>{"foo"}</_components.h1>;

Actual behavior

with v2

  11 |   return <_components.h1 style={{
  12 |     backgroundColor: "#000002",
  13 |     -ShikiDarkBg: "#000002",
     :     ^
  14 |     color: "var(--fg)",
  15 |     WebkitTransform: "rotate(0.01turn)",
  16 |     msTransform: "rotate(0.01turn)",
     `----

   x Expected '}', got ':'

Runtime

No response

Package manager

No response

OS

No response

Build and bundle tools

No response

wooorm commented 1 year ago

That was fixed in https://github.com/syntax-tree/hast-util-to-estree/releases/tag/2.3.2? I don’t think anything related landed in 3. Reinstall your dependencies to get bugfixes.

dimaMachina commented 1 year ago

Why not to pin ^2.3.2 instead of ^2.0.0?

wooorm commented 1 year ago

Because the open source javascript ecosystem is a stack of projects that depend on each other. Semver makes sure that we don‘t need to update this project for you to get fixes: you can get fixes yourself.