Giter Site home page Giter Site logo

Comments (21)

garronej avatar garronej commented on June 19, 2024 1

@Jack-Works, I submitted a PR to enable transparent support of custom cache.
Wether it get merged or not however I guaranty support of custom cache within a week.

from tss-react.

garronej avatar garronej commented on June 19, 2024 1

Sorry about the delay. I am releasing the feature as soon as the PR get merged on emotion

from tss-react.

garronej avatar garronej commented on June 19, 2024 1

Done,

$ yarn add [email protected] @emotion/cache @emotion/react @emotion/serialize @emotion/utils

Sorry I was eager to push this feature out of the door but it wasn't ready yet.
Working on resolving the mui integrations issues.

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024 1

Oh, I found there is still a problem here. Now tss-react works but mui styles are all breaking.

image

Both happening in 0.6.0 or 0.6.0-beta.1. Let me try to fix this locally

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024 1

I've fixed this locally again by editing the lock file manually and playing around with node_modules. 😂

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024 1

I'm glad you fixed it but it bothers me. Not everyone will have the skill to hack the lock file like you did.
I can't reproduce with yarn. Maybe there is just a simple keyword like resolve to put in the package.json that will make it work with pnpm.

Thanks, but I can't tell how did I fix this exactally, our project is open sourced on GitHub. I guess you may be interested in it. DimensionDev/Maskbook@294b23a is the bad commit and in DimensionDev/Maskbook@ec225ca I fixed it by only changing package.json and pnpm-lock.yaml. But our project is hard to set up.

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024

The current code requires the cache to be provided ahead-of-time instead of reading it from the CacheProvider https://github.com/garronej/tss-react/blob/main/src/createMakeStyles.tsx

from tss-react.

garronej avatar garronej commented on June 19, 2024

Ok, I understand, sorry for overseeing that.

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024

Cool thank you!

from tss-react.

garronej avatar garronej commented on June 19, 2024

The change have been approved. It should be merged soon.

from tss-react.

garronej avatar garronej commented on June 19, 2024

@Jack-Works Everything should work now. Let me know if it isn't the case 😊
Doc

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024

hi, @garronej I tried the latest version, it still not working and I got this:

You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.

pnpm why @emotion/react -r
Legend: production dependency, optional only, dev only

Workspace Root

dependencies:
@emotion/react 11.4.1
@emotion/styled 11.3.0
└── @emotion/react 11.4.1 peer
@material-ui/core 5.0.0-alpha.34
├── @emotion/react 11.4.1 peer
├─┬ @emotion/styled 11.3.0 peer
│ └── @emotion/react 11.4.1 peer
└─┬ @material-ui/styled-engine 5.0.0-alpha.34
  ├── @emotion/react 11.4.1 peer
  └─┬ @emotion/styled 11.3.0 peer
    └── @emotion/react 11.4.1 peer
@material-ui/icons 5.0.0-alpha.34
└─┬ @material-ui/core 5.0.0-alpha.34 peer
  ├── @emotion/react 11.4.1 peer
  ├─┬ @emotion/styled 11.3.0 peer
  │ └── @emotion/react 11.4.1 peer
  └─┬ @material-ui/styled-engine 5.0.0-alpha.34
    ├── @emotion/react 11.4.1 peer
    └─┬ @emotion/styled 11.3.0 peer
      └── @emotion/react 11.4.1 peer
@material-ui/lab 5.0.0-alpha.34
└─┬ @material-ui/core 5.0.0-alpha.34 peer
  ├── @emotion/react 11.4.1 peer
  ├─┬ @emotion/styled 11.3.0 peer
  │ └── @emotion/react 11.4.1 peer
  └─┬ @material-ui/styled-engine 5.0.0-alpha.34
    ├── @emotion/react 11.4.1 peer
    └─┬ @emotion/styled 11.3.0 peer
      └── @emotion/react 11.4.1 peer

@masknet/theme packages\theme

dependencies:
tss-react 0.5.2
└── @emotion/react 11.4.1

I guess you should list @emotion/* packages as peer dependencies instead of direct dependencies?

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024

Oh @material-ui/styled-engine are using 11.4.0 and tss-react using 11.4.1, let me try to fix this in our lockfile

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024

Changed resolution to 11.4.1 but still getting this problem, I guess peer is required

from tss-react.

garronej avatar garronej commented on June 19, 2024

Ok,
Sorry for not testing this out with @material-ui/styled-engine

Changed resolution to 11.4.1 but still getting this problem, I guess peer is required

This is surprise me a lot.

As mentioned by @oliviertassinari here the problem is more complicated that it seems...

I will sort this out and come back with a solution.

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024

Thanks! And I'm using pnpm workspace (that might affect the result)

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024

Can you release an experimental version with peers so that I can test it by myself

from tss-react.

Jack-Works avatar Jack-Works commented on June 19, 2024

Thanks! I have tried 0.6.0-beta.1, it fixes our problem!

from tss-react.

garronej avatar garronej commented on June 19, 2024

Thanks for reporting it working.
I really hate to make @emotion/cache, @emotion/react, @emotion/serialize, and @emotion/utils peer dependency though.
Problem being that @emotion is spitted into multiple little packages.
Using yarn packages are correctly deduped.
I would highly appreciate if you could give me the step to reproduce the error in your pnpm project so I can investigate the error and see if there isn't a better way than making everything a peer dependency.

from tss-react.

garronej avatar garronej commented on June 19, 2024

Hi @Jack-Works,
In v0.6.0 there is a more exhaustive cache support.
The build is also much more carefully tested that the one I released in the hurry Sunday, in particular with the mui integration in an SSR context.
Let me know if you have any issue with it.
I've opted to leave only @emotion/react as dev dependency but I am still interested in reproducing the bug your experienced.
Best

from tss-react.

garronej avatar garronej commented on June 19, 2024

I'm glad you fixed it but it bothers me. Not everyone will have the skill to hack the lock file like you did.
I can't reproduce with yarn. Maybe there is just a simple keyword like resolve to put in the package.json that will make it work with pnpm.

from tss-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.