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

perf(themes): use minified normalize.css in Teams theme #1476

Merged
merged 4 commits into from
Jun 10, 2019

Conversation

layershifter
Copy link
Member

Related to #1311.

Problem

Currently normalizeCSS is a string that can't be properly minified by bundlers:

image

Solution

Use minified version.

image

Props

  • less bundle size
  • less memory usage (comments are removed)

Impossible solution

Convert normalizeCSS to an object, however the main problem is a different API in Fela's renderStatic():

// object type style
renderer.renderStatic({
  boxSizing: 'border-box',
  margin: 0
}, 'html,body')

I don't think that effort that we will spent there will have much gain for us.

@layershifter layershifter changed the title chore(themes): use minified normalize.css in Teams theme perf(themes): use minified normalize.css in Teams theme Jun 9, 2019
@codecov
Copy link

codecov bot commented Jun 9, 2019

Codecov Report

Merging #1476 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1476   +/-   ##
=======================================
  Coverage   73.14%   73.14%           
=======================================
  Files         805      805           
  Lines        6073     6073           
  Branches     1794     1794           
=======================================
  Hits         4442     4442           
  Misses       1625     1625           
  Partials        6        6
Impacted Files Coverage Δ
...eact/src/themes/teams/staticStyles/normalizeCSS.ts 100% <100%> (ø) ⬆️

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 3848552...88fd058. Read the comment docs.

CHANGELOG.md Outdated
@@ -34,6 +34,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fix Teams' theme list item end media styles @mnajdova ([#1448](https://github.com/stardust-ui/react/pull/1448))
- Fix the order of the fela plugin @mnajdova ([#1461](https://github.com/stardust-ui/react/pull/1461))

### Performance
- Use minified version of `normalize.css` @layershifter ([#1476](https://github.com/stardust-ui/react/pull/1476))
Copy link
Member

Choose a reason for hiding this comment

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

You also upgraded normalize from 8.0.0 to 8.0.1. Should it be mentioned in the changelog?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the entry 👍

@layershifter layershifter merged commit bc45706 into master Jun 10, 2019
@delete-merged-branch delete-merged-branch bot deleted the chore/normalize-to-js branch June 10, 2019 12:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants