Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

fix(renderer): disable devMode for Fela by default #1090

Merged
merged 4 commits into from
Mar 21, 2019

Conversation

layershifter
Copy link
Member

@layershifter layershifter commented Mar 21, 2019

Fixes #1088.


When Fela's renderer is in devMode (default before), the insertRule() function uses a de-optimized code path (insertRuleInDevMode.js) for writing style updates to the style nodes. It replaces the text of the style node in the head, opposed to using the browser's optimized CSSStyleSheet.insertRule() method.

It's friendly for development tools because you can edit styles, but it provides wrong development experience for consumers because components are much slower.


devMode=true

image

devMode=false

image

Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I like it, but

@codecov
Copy link

codecov bot commented Mar 21, 2019

Codecov Report

Merging #1090 into master will decrease coverage by 0.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1090      +/-   ##
==========================================
- Coverage   81.77%   81.76%   -0.02%     
==========================================
  Files         701      701              
  Lines        8564     8570       +6     
  Branches     1170     1244      +74     
==========================================
+ Hits         7003     7007       +4     
- Misses       1546     1548       +2     
  Partials       15       15
Impacted Files Coverage Δ
packages/react/src/lib/felaRenderer.tsx 86.36% <66.66%> (-7.39%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 087d913...033d70f. Read the comment docs.

@layershifter layershifter merged commit 6f9569e into master Mar 21, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/fela-dev-mode branch March 21, 2019 16:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧰 fix Introduces fix for broken behavior. 🚀 ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants