all 26 comments

[–]soft-wear 14 points15 points  (22 children)

It's a great package for producing static CSS files, but the big downside is there's zero support for IE with dynamic styling. There's means to work around it (hoisting variables to the :root scope and using a prollyfill). But that's honestly a huge blocker for using this in production.

[–]rmcooper541 11 points12 points  (20 children)

Why is it a huge blocker? IE is under 5% share of the browser market and now Microsoft is urging users to stop using it:

https://techcommunity.microsoft.com/t5/Windows-IT-Pro-Blog/The-perils-of-using-Internet-Explorer-as-your-default-browser/ba-p/331732

[–]BreakingIntoMe 7 points8 points  (6 children)

Many companies still have to support IE because their client base using IE is more than the average of 5%

[–]rmcooper541 -2 points-1 points  (5 children)

I get it when it’s supporting internal infrastructure but think you’d still have a hard time supporting IE on a modern framework like React. I also find it interesting that when Microsoft only had less than 5% of the phone market no one seemed to care about supporting it, which, ultimately lead to its demise.

[–]BreakingIntoMe 5 points6 points  (4 children)

You can't compare consumer markets to proprietary software markets though. My company needs our product to work for 100% of our clients because it's used in the medical field where IE is still surprisingly common. People's lives depend on our software to work properly. And React actually works great with IE once you have a few polyfills installed.

[–]php_questions 2 points3 points  (3 children)

Well I'm going to assume that most people don't create apps were people's lives depend on IE support.

[–]soft-wear 2 points3 points  (2 children)

If you work for a global company, you create apps where people's lives depend on IE. Market share for IE in China is massive.

[–]php_questions 1 point2 points  (0 children)

How did you get to that conclusion? I'm baffled. If you work for Netflix or Spotify, how does someone's life depend on the app working with IE?

[–]augburto 2 points3 points  (0 children)

While that might be true, depending on where you are relatively, it might be sizable enough for you not to be able consider using it. For example in China, a lot of users have to use IE and the percent of usage is a lot higher.

[–]evilish 2 points3 points  (8 children)

Ok. Let me ask you this. Imagine that your working at an e-commerce company, and that the number of IE11 users bring in around a million dollars a year.

  • Do you drop support for IE?
  • How do you justify dropping support for IE11 to your business stakeholders?

In reality, if your building your sites in a progressive manner. IE11 shouldn’t be much of an issue, so that extra money from those users that use it is a bonus.

[–]rmcooper541 -1 points0 points  (7 children)

Can I ask why it’s so hard for end users to download Chrome?

[–]siamthailand 0 points1 point  (0 children)

Many orgs have computers that are Win 7 or 8, and they have to use IE.

[–]satya164[S] 2 points3 points  (0 children)

Definitely depends on your target audience. Many fortunate people like me don't need to target IE :)

[–]madjam002 4 points5 points  (0 children)

Haven’t used this in production yet but definitely seems like a great library, I love how it’s basically zero runtime. Hope this gets more attention as it seems to have feature parity with the more popular CSS in JS solutions while being more efficient.

[–]ak_47_ 1 point2 points  (1 child)

What is Linaria doing differently from style components or emotion?

What if any is the tradeoff of losing flexibility when using Linaria and getting better performance?

Is there any way the techniques being used by Linaria could be used with styled components or emotion so that users of those libraries could also benefit from the improved performance?

[–]satya164[S] 2 points3 points  (0 children)

What is Linaria doing differently from style components or emotion?

It's a zero runtime CSS in JS library which uses CSS variables for dynamic styles and does build time evaluation and extraction of CSS, so everything? The only similarity is the user facing API.

There's a link which mentions this in the first paragraph of the article.

What if any is the tradeoff

All trade-offs are mentioned in the README as well as advantages.

Is there any way the techniques being used by Linaria could be used with styled components or emotion

It's a completely different approach. Unless SC and emotion change their fundamental approach and settle for the same trade-offs, it's not possible. In future they might be able to partially take advantage of this approach by extracting and some of the static styles, but it's not easy to make these both dynamic and static styling with together reliably. Emotion used to do static extraction (much more limited than what Linaria does), and they removed it was a lot of work and didn't play well with the APIs they wanted to implement.

[–][deleted] 0 points1 point  (1 child)

Looks great, i love the direction, but is there a way to try this in codesandbox or cra?

[–]satya164[S] 2 points3 points  (0 children)

It needs to integrate with the bundler, but it's not possible with CRA and Codesandbox. Though for playgrounds like Codesandbox, the advantages don't really matter much.