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 doesn't follow semver - causing frequent breakages when lockfiles cannot be used #1309

Open
ntucker opened this issue Jul 29, 2023 · 1 comment
Labels
bug report 🦗 Issue is probably a bug, but it needs to be checked bundler: webpack 📦 Issue is related to webpack bundler cat: monorepo 🔱 Issues related to usage of linaria in monorepo needs: complete repro 🖥️ Issue need to have complete repro provided

Comments

@ntucker
Copy link

ntucker commented Jul 29, 2023

Description

Linaria 4.5 tried to do some radical stuff which has many bugs. These are still being worked on but the problem is, each part of linaria relies on specifying a ^ range with other parts (like utils and tags). But these are not correct as 4.5 was a breaking change. So anyone trying to downgrade to keep it working is forced to specify resolutions.

For context, when I create stackblitz demos it installs without the monorepo so it misses the lockfile and this causes issues. (for example going to https://stackblitz.com/github/data-client/rest-hooks/tree/rest-hooks-site/examples/todo-app?file=src%2Fpages%2FHome%2FTodoList.tsx and you'll see _tags.hasMeta is not a function)

"resolutions": {
    "@linaria/babel-preset": "4.4.5",
    "@linaria/core": "4.2.10",
    "@linaria/webpack5-loader": "4.1.17",
    "@linaria/react": "4.3.8",
    "@linaria/shaker": "4.2.11",
    "@linaria/utils": "4.3.4",
    "@linaria/tags": "4.3.5"
  },

I could specify ~ in my dependencies; but since linaria updating it's own nested dependencies this will not work. (This goes beyond 4.5 just breaking in general - even if it worked perfectly - each linaria package is not cross compatible with past versions.)

If not using semver, I suggest the libraries specify their dependencies using ~ instead of ^ so they can correctly match compatible versions. (Since for this library minor is considered breaking).

BTW: I'm not trying to suggest this library conform to semver. Just that it understands its own internal compatibility and specifies correctly.

Reproducible Demo

https://github.com/ntucker/anansi/tree/master/examples/linaria

  • corepack enable
  • yarn install

PS

Thanks for the hard work on maintaining this library!

@ntucker ntucker 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 29, 2023
@github-actions github-actions bot added bundler: webpack 📦 Issue is related to webpack bundler cat: monorepo 🔱 Issues related to usage of linaria in monorepo and removed needs: triage 🏷 Issue needs to be checked and prioritized labels Jul 29, 2023
@duyluongn-ct
Copy link

duyluongn-ct commented Oct 4, 2023

Facing the same problem in the development build, I did persist the peerDep at 4.2.10 to resolve in local too, but still got this error on GitHub Action test run build script

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 bundler: webpack 📦 Issue is related to webpack bundler cat: monorepo 🔱 Issues related to usage of linaria in monorepo needs: complete repro 🖥️ Issue need to have complete repro provided
Projects
None yet
Development

No branches or pull requests

2 participants