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

refactor(react-property): update build scripts to output `.js` file instead of `.json` #12

Merged
merged 4 commits into from Jul 9, 2019

Conversation

Projects
None yet
1 participant
@remarkablemark
Copy link
Owner

commented Jul 9, 2019

Relates to #11 and remarkablemark/html-react-parser#117

File/Directory Current Updated
index.js 3.2K 3.2K
lib 8K 10K

The advantage of .js over .json is that quotes around the property keys will be stripped, which leads to a smaller bundle size during minification.

Also, webpack wraps the JSON string in JSON.parse(), which is less performant than dealing with a POJO (Plain Old JavaScript Object).

remarkablemark added some commits Jul 9, 2019

refactor(react-property): update build-html script to output `.js`
The `.json` format leads to a larger file size due to the quotes
around the property names.
refactor(react-property): update build-injection to output `.js`
The `.json` format leads to a larger file size due to the quotes
around the property keys.
refactor(react-property): update build-svg script to output `.js`
The `.json` format leads to a larger file size due to the quotes
around the property names.
docs(react-property): update layout section in README.md
Given the change in file extension for the lib build artifacts.

@remarkablemark remarkablemark merged commit ff0019f into master Jul 9, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@remarkablemark remarkablemark deleted the refactor/react-property branch Jul 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.