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
Merged

Use function to construct Normalize component #17

merged 1 commit into from
Oct 1, 2019

Conversation

kevin940726
Copy link
Contributor

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);

@ghost
Copy link

ghost commented Oct 1, 2019

DeepCode Report (#dca66a)

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

@sergeysova sergeysova self-requested a review October 1, 2019 05:25
@sergeysova
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants