question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

Build time in 1.3.1

See original GitHub issue

Environment

"linaria": "^1.3.1", "webpack": "^4.30", "@babel/cli": "^7.4.3", "@babel/core": "^7.4.3", @babel/node": "^7.2.2", "react": "^16.8.6",

Description

After migration to 1.3.1 from 1.3.0 the build time increased in 5 times ๐Ÿ˜ข. After analyzing changes in 1.3.1. suspicion fell on babel/evaluate.js.

In our project we have many โ€œBaseโ€ components that use Styling custom components with interpplations, f.e. <LayoutContainer /> , <DisplayName />, <Box /> e.c.

const Container = styled(LayoutContainer)<LayoutContainerProps>`  
  background-color: ${componentTheme.stripe.layoutContainerBackgroundColor};  
  border: ${componentTheme.stripe.layoutContainerBorder};  
  border-radius: ${baseTheme.radius};  
  margin: ${componentTheme.stripe.layoutContainerMargin};  
  align-items: stretch;  
`;

The problem is when u create your custom components that based on a โ€œBaseโ€ one and use interpolation, Prop based styles the evalute.js executes too many times, and this cause such result for build time ( on my opinion). I tried to output log in TaggedTemplateExpression.js console.log(state.file.opts.filename):

Only small part of the whole log Log.txt

Is this a bug or I am doing something wrong ? Thx

P.S. Currently, I have a bunch of circular decencies in the project. When I fix one the build time decreases on 10-20 sec. ๐Ÿค” Can it be a reason of the problem?

Reproducible Demo

babel.config webpack.dev.config.txt

linaria.config.js

module.exports = {
    evaluate: true,
    displayName: process.env.NODE_ENV !== 'production',
};

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:8
  • Comments:38 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
steffenmllrcommented, May 28, 2019

Those are the build speeds from emotion vs linaria for the same project. I just sed the import for now.

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                   โ”‚
โ”‚   Storybook 5.0.11 started                        โ”‚
โ”‚   2.35 min for manager and 2.38 min for preview   โ”‚
โ”‚                                                   โ”‚
โ”‚   Local:            http://localhost:9001/        โ”‚
โ”‚   On your network:  http://192.168.1.205:9001/    โ”‚
โ”‚                                                   โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                                                   โ”‚
โ”‚   Storybook 5.0.11 started                        โ”‚
โ”‚   19 s for manager and 20 s for preview           โ”‚
โ”‚                                                   โ”‚
โ”‚   Local:            http://localhost:9001/        โ”‚
โ”‚   On your network:  http://192.168.1.205:9001/    โ”‚
โ”‚                                                   โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
3reactions
SpawnAtiscommented, Apr 26, 2019

I fixed all circular deps, it reduced time on 30 sec. Now, with linaria 1.3.0 - 1.46m, after upgrade to 1.3.1 - 4.75. ๐Ÿ˜ž

Screen Shot 2019-04-26 at 10 27 44
Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Edition 1.3.1 - Minecraft Wiki - Fandom
1.3.1 is a major update to Java Edition released on August 1, 2012, which added trading, adventure mode, new generated structures (jungle and...
Read more >
J2SE 1.3.1 Update Release Notes - Oracle
J2SE 1.3.1 Update Release Notes for Microsoft Windows, Linux, and Solaris Operating Systems. ... This release contains Olson time zone data version 2010l....
Read more >
Guide: Building Surface Bases - KSP 1.3.1 - YouTube
Ever wanted to build a base on the Mun or Duna, but had no clue how to do it? Well worry no more...
Read more >
Writing Your Own Extension - Quarkus
1.3.1. Static Init Config. If the extension provides additional Config Sources and if ... Extensions must register these bean definitions at build time....
Read more >
Compose Runtime - Android Developers
For more information about dependencies, see Add build dependencies. ... androidx.compose.runtime:runtime-*:1.3.1 is released. Version 1.3.1 contains theseย ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found