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

feat(react-property): rewrite HTML and SVG configs and modify exports #11

Merged
merged 19 commits into from Jul 9, 2019

Conversation

Projects
None yet
1 participant
@remarkablemark
Copy link
Owner

commented Jul 8, 2019

Changes done for remarkablemark/html-react-parser#117

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

remarkablemark added some commits Jul 8, 2019

feat(react-property): rewrite build html script
No longer generate the following from html build script:

- attributes.json
- attribute-to-property.json
- boolean-properties.json
- overloaded-boolean-properties.json

The reason is because these files with redundant attribute name
mapping makes the final bundle size larger than expected.

Only the following file is generated:

- properties.json

This file is similar to `react-dom/lib/HTMLDOMPropertyConfig.js`.

Update html index module to include additional injection
properties:

- mustUseProperty
- hasNumericValue
- hasPositiveNumericValue
feat(react-property): rewrite build svg script
No longer generate the following from svg build script:

- attributes.json
- attribute-to-property.json
- boolean-properties.json
- overloaded-boolean-properties.json

The reason is these files have redundant attribute names,
which makes the final bundle size larger than expected.

Also, the svg attribute names are lowercased instead of
camelcased.

Now the following file is generated:

- properties.json

It's similar to `react-dom/lib/SVGDOMPropertyConfig.js`
except redundant attribute to property name mappings
are deleted.

Also, update svg index module to include the injection
properties.
refactor(react-property): require injection in html and svg modules
And remove "injection" from html and svg properties json
refactor(react-property): update build output and filenames
The html and svg properties configs are no longer under a
specific directory but kept flat under the `lib/` directory:

```sh
$ cd packages/react-property/
$ tree lib/
lib/
├── HTMLDOMPropertyConfig.json
├── SVGDOMPropertyConfig.json
├── html
│   └── index.js
├── injection.json
├── is-custom-attribute.js
└── svg
    └── index.js

2 directories, 6 files
```
feat(react-property): consolidate injection logic to `index.js`
BREAKING CHANGE: remove exports `HTMLDOMPropertyConfig` and
`SVGDOMPropertyConfig` and consolidate the properties in
`properties`.

As a result of this change, `src/` directory is removed since all
the injection logic is handled in `index.js` and the npm script
`copy` is removed as well.

@remarkablemark remarkablemark force-pushed the feat/react-property branch from 843a522 to 581f936 Jul 9, 2019

@remarkablemark remarkablemark changed the title feat(react-property): rewrite html and svg build and modify the exports feat(react-property): rewrite HTML and SVG configs and modify exports Jul 9, 2019

@remarkablemark remarkablemark merged commit df7a9b9 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 feat/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.