Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use function to construct Normalize component #17

Merged
merged 1 commit into from Oct 1, 2019

Conversation

@kevin940726
Copy link
Contributor

commented Oct 1, 2019

css call returns an array of strings, so we can use function to construct <Normalize> component without using tagged template. The result is even smaller bundle size since we can now eliminate the unnecessary helpers generated by babel.

- function _templateObject() {		
-   var data = _taggedTemplateLiteral(["", ""]);		
-   _templateObject = function _templateObject() {		
-     return data;		
-   };		
-   return data;		
- }		
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }		
...
- var Normalize = (0, _styledComponents.createGlobalStyle)(_templateObject(), normalize);
+ var Normalize = (0, _styledComponents.createGlobalStyle)(normalize);
@deepcode-ci-bot

This comment has been minimized.

Copy link

commented Oct 1, 2019

DeepCode Report (#dca66a)

DeepCode analyzed this pull request.
There are no new issues.

@sergeysova sergeysova self-requested a review Oct 1, 2019
@sergeysova

This comment has been minimized.

Copy link
Owner

commented Oct 1, 2019

Thank you!

@sergeysova sergeysova merged commit 008f0e6 into sergeysova:master Oct 1, 2019
1 check passed
1 check passed
DeepCode Found no critical issues.
Details
@kevin940726 kevin940726 deleted the kevin940726:function-normalize branch Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.