effector / swc-plugin

SWC plugin to enhance your ☄️ Effector experience
https://www.npmjs.com/package/effector-swc-plugin
ISC License
17 stars 0 forks source link

`domain` transform bug #12

Closed domosedov closed 6 months ago

domosedov commented 6 months ago

https://github.com/d3/d3-scale/blob/d6904a4bde09e16005e0ad8ca3e25b10ce54fa0d/src/ordinal.js#L21

description

Transform array ['value1', 'value2'] to object like { sid: 'some sid', name: 'domain' }

Reproduce

https://github.com/domosedov/swc-domain-bug

"next": "14.1.0",
"effector-swc-plugin": "0.2.2-swc1.3.63",
"recharts": "^2.12.1",

Reproduce

https://github.com/domosedov/swc-domain-bug

Снимок экрана 2024-02-27 в 09 13 58 Снимок экрана 2024-02-27 в 09 14 31
domosedov commented 6 months ago

Babel plugin has same problem

Снимок экрана 2024-02-27 в 09 38 55 Снимок экрана 2024-02-27 в 09 39 04
domosedov commented 6 months ago

Some context

For babel plugin its solve problem

https://github.com/effector/effector/blob/5352b9303f04163a35c9c1cf99cabe515341ae3b/src/babel/babel-plugin.js#L529

{
  "domainMethods": {
    "store": [],
    "event": [],
    "effect": [],
    "domain": []
  }
}
kireevmp commented 6 months ago

This now should be covered by transformLegacyDomainMethods option, which you can disable. Can you see if v0.3.0 fixes this for you when using this option?

domosedov commented 6 months ago

This now should be covered by transformLegacyDomainMethods option, which you can disable. Can you see if v0.3.0 fixes this for you when using this option?

nice, fixed

"next": "14.1.0",
"effector-swc-plugin": "0.3.0-swc1.3.63",
"recharts": "^2.12.1"
/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    swcPlugins: [
      [
        "effector-swc-plugin",
        {
          transformLegacyDomainMethods: false,
        },
      ],
    ],
  },
};

export default nextConfig;

thank you