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

@linaria/shaker removes specific code #1008

Closed
layershifter opened this issue Jul 19, 2022 · 0 comments · Fixed by #1017
Closed

@linaria/shaker removes specific code #1008

layershifter opened this issue Jul 19, 2022 · 0 comments · Fixed by #1017
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided

Comments

@layershifter
Copy link
Contributor

Environment

  • Linaria version: @linaria/shaker@4.0.0-beta.0
  • Bundler (+ version): N/A
  • Node.js version: N/A
  • OS: N/A

Description

This bug is a regression (#861). The problem comes with compiled code, the minimal input is:

exports.__linariaPreval = [
  _wrap(() => ({
    root:
      ((_a = {}),
      (_a[':hover .' + switchClassName] = {
        ':before': {
          backgroundColor: 'red',
        },
      }),
      _a),
  })),
];

After the plugin 💥

exports.__linariaPreval = [_wrap(() => ({
  root: _a = {}
}))];

(while the object should remain the same 🐱 )

Reproducible Demo

https://stackblitz.com/edit/node-clu7gg?file=index.js,code.js,package.json

@layershifter layershifter added bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided needs: triage 🏷 Issue needs to be checked and prioritized labels Jul 19, 2022
@github-actions github-actions bot removed the needs: triage 🏷 Issue needs to be checked and prioritized label Jul 19, 2022
@Anber Anber closed this as completed in b851592 Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked needs: complete repro 🖥️ Issue need to have complete repro provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant