streamich / nano-css

Distilled CSS-in-JS for gourmet developers
The Unlicense
426 stars 24 forks source link

v3.0.0 broke sheet() using extract #189

Closed TheBosZ closed 6 years ago

TheBosZ commented 6 years ago

I can't figure out exactly why, but v3.0.0 broke my plugin: https://bitbucket.org/TheBosZ/rollup-plugin-nano-css/

With 2.2.0, all tests pass, but with 3.0.0, calling nano.sheet returns an empty object instead of the expected string of class names.

streamich commented 6 years ago

I need some code to replicate that behaviour, to be able to fix that.

TheBosZ commented 6 years ago

Sorry, the tests on that project replicate it but I can pull them out into an example if you'd like.

TheBosZ commented 6 years ago

It looks like the extract addon is no longer forcing the lazy load of sheet.

TheBosZ commented 6 years ago

This repo can show the issue: https://github.com/TheBosZ/nano-css-problems/

Run: npm i && npm run extract

The sheet has the button property, but the resulting object no longer has the property.

In 2.2.0, the object returned from sheet() was already loaded. Now it's back to being lazy-loaded.

streamich commented 6 years ago

This https://github.com/streamich/nano-css/pull/190 should fix your problem.

streamich commented 6 years ago

:tada: This issue has been resolved in version 3.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

TheBosZ commented 6 years ago

Perfect! 3.0.1 solves the bug!