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): create package for HTML and SVG DOM property configs #9

Merged
merged 33 commits into from Jul 5, 2019

Conversation

Projects
None yet
2 participants
@remarkablemark
Copy link
Owner

commented Jul 3, 2019

Relates to remarkablemark/html-react-parser#107

Would love to get your review @talbet

remarkablemark added some commits Jul 1, 2019

feat(react-property): add build script for SVG DOM config
The build script is similar to HTML DOM config except SVG does not
have boolean or overloaded boolean attributes/properties.
feat(react-property): add `index.js` that imports all files in lib
And add "main" field in `package.json` so the file is included
during npm publish.
@talbet

talbet approved these changes Jul 4, 2019

Copy link

left a comment

Really nice. You must have a lot of familiarity with the React internals, I've looked at them a bit, but wouldn't have come up with this. A few comments, but nothing I can see that would block this from going in.

try {
fs.mkdirSync(LIB_DIR);
} catch (error) {
// throw error;

This comment has been minimized.

Copy link
@talbet

talbet Jul 4, 2019

Should the error be re-thrown here if it is not a "directory already exists" error?

if (error.code !== 'EEXIST') throw error;

This comment has been minimized.

Copy link
@remarkablemark
}

/**
* HTML DOM property config.

This comment has been minimized.

Copy link
@talbet

talbet Jul 4, 2019

Maybe we can add extra context to this comment? I wasn't sure what it was for at first. Something along the lines of: "an object containing HTML attributes and how they should be mapped to React props"

This comment has been minimized.

Copy link
@remarkablemark

remarkablemark Jul 4, 2019

Author Owner

42999e2

I changed the wording slightly. Let me know if it makes sense.

This comment has been minimized.

Copy link
@talbet

talbet Jul 4, 2019

Yeah, I think this makes it clearer.

try {
fs.mkdirSync(LIB_DIR);
} catch (error) {
// throw error;

This comment has been minimized.

Copy link
@talbet

talbet Jul 4, 2019

as above, we could handle this error if it is not expected

if (error.code !== 'EEXIST') throw error;

This comment has been minimized.

Copy link
@remarkablemark
var overloadedBooleanProperties = require('../../lib/html/overloaded-boolean-properties');

var attributeMap = {};
var attributeName;

This comment has been minimized.

Copy link
@talbet

talbet Jul 4, 2019

Nice 👍 I haven't used var for such a long time I probably would have forgotten the scoping complications of var and loops.

This comment has been minimized.

Copy link
@remarkablemark

remarkablemark Jul 4, 2019

Author Owner

Thanks. I'm considering rewriting this to TypeScript but that can be an enhancement done later.

@talbet

talbet approved these changes Jul 4, 2019

@remarkablemark remarkablemark merged commit 6425501 into master Jul 5, 2019

@remarkablemark remarkablemark deleted the feat/react-property branch Jul 5, 2019

@remarkablemark

This comment has been minimized.

Copy link
Owner Author

commented Jul 5, 2019

Released and published react-property@0.1.0:

# npm
npm i -S react-property@0.1.0

# yarn
yarn add react-property@0.1.0
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.