aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
15.87k stars 554 forks source link

`MillionLint.vite()` plugin affecting Recharts #1056

Open charlieforward9 opened 4 weeks ago

charlieforward9 commented 4 weeks ago

What version of million are you using?

^1.0.0-rc.24

Are you using an SSR adapter? If so, which one?

n/a

What package manager are you using?

npm

What operating system are you using?

Windows

What browser are you using?

Chrome

Describe the Bug

Prior to adding the MillionLint.vite() plugin to my Vite config, my Recharts coloring behaves as expected.

image

After adding the plugin to my project, my Rechart graphs do not show the charts properly image

My recharts graph has worked properly for months, enduring dozens of additional npm packages in the repo. Something about Million is affecting it differently

If necessary, here is my simple recharts data

<BarChart
            className="z-0"
            height={300}
            width={350}
            data={chartData}
            onClick={onChartChange}
          >
            <CartesianGrid strokeDasharray="3 3" />
            <XAxis
              tick={{ fontSize: 10 }}
              interval="preserveStartEnd"
              dataKey="type"
            />
            <YAxis tick={{ fontSize: 12 }} />
            <Tooltip />
            <Bar
              dataKey={"count"}
              fill="#8884d8"
              stroke="#000000"
              strokeWidth={1}
            >
              {chartData?.map((b, index) => (
                <Cell
                  role="cell"
                  aria-label={"cell" + index}
                  key={type + "cell" + index}
                  fill={
                    b.visible
                      ? InventoryUtils.colorGradient[size][index]
                      : "gray"
                  }
                />
              ))}
            </Bar>
          </BarChart>
/* Might not be optimized, feedback is welcome while I have Million off till fix 😆 */

It seems that Million is affecting hte display of not only the Cell component, but also the XAxis and YAxis components.

What's the expected result?

I expect my Recharts to remain the same after depending on this incredible Million Linter.

Link to Minimal Reproducible Example

Will make this if necessary, hopefully it is not.

Participation

github-actions[bot] commented 4 weeks ago

Thanks for opening this issue! A maintainer will review it soon.

aidenybai commented 4 weeks ago

@charlieforward9 triaging now, thanks for the report

charlieforward9 commented 2 weeks ago

I am very excited to integrate this into my workflow. Really love what youre doing here. Any updates on this? @aidenybai