-
Notifications
You must be signed in to change notification settings - Fork 1
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
Rewrite JSONImporter in TypeScript. Closes #30 #43
Conversation
TypeScript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it looks good! The concurrency issues should be addressed before merging since they introduce bugs but before you fix them, we should add tests reproducing the issue for regression testing at the very least.
return [ | ||
new NodeChangeSet( | ||
nodePath, | ||
childState.id || '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably shouldn't use ''
since that is actually used for the root node. undefined
would probably be better.
resolvedSelectors.record(parentPath, alternateSelector, created); | ||
} | ||
const nodeState = await this.toJSON(created, new OmittedProperties(['children'])); | ||
const changes = gmeDiff(nodeState, state); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't like diffing in the patch fn if it can be avoided but this should be explored in a different PR
super(args); | ||
const invalidProperties = INVALID_PROPS.filter(prop => this.has(prop)); | ||
|
||
if(invalidProperties.length) { | ||
throw new Error(`Invalid properties to omit: ${invalidProperties.join(', ')}`); | ||
} | ||
} | ||
|
||
withRelatedProperties(): OmittedProperties { | ||
const relatedProps = Object.keys(RELATED_PROPERTIES) | ||
.filter(key => this.has(key)) | ||
.flatMap(key => RELATED_PROPERTIES[key]); | ||
|
||
relatedProps.forEach(dep => this.add(dep)); | ||
return this; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a code formatter - like prettier - as a githook (not in this PR).
0253a5c
to
6dce159
Compare
Nice work, @umesh-timalsina! There are a few things left for other PRs:
|
No description provided.