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

typescript(vx-voronoi): re-write package in TypeScript #512

Merged
merged 12 commits into from
Nov 14, 2019

Conversation

williaster
Copy link
Collaborator

@williaster williaster commented Sep 23, 2019

🚀 Enhancements

This PR builds off #488 which introduces Typescript build config, and re-writes the @vx/voronoi package in TypeScript.

It also removes an unneeded @vx/group dependency. Closes #511.

💥 Breaking Changes

  • This PR introduces React.Fragments, which requires bumping the peerDep for react to ^16.3.0-0

Tests

  • CI
  • functional /voronoi demo

@hshoff @schillerk @milesj @kristw @Rudeg

Copy link

@Rudeg Rudeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

/** className to apply to path element. */
className?: string;
/** Array of coordinate arrays for the polygon (e.g., [[x,y], [x1,y1], ...]), used to generate polygon path. */
polygon?: number[][];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[number, number][]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this is not possible when the type is optional, build fails with this error

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made it required to avoid

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take that back, I think it comes from the @types/d3-voronoi types

@williaster williaster changed the base branch from chris--typescript to master October 4, 2019 19:20
@williaster
Copy link
Collaborator Author

Hrmm, not really sure how to fix this one. I think this error is coming from the @types/d3-voronoi types, and still throws even tho I ignore the call in the code 🤔

@hshoff
Copy link
Member

hshoff commented Nov 13, 2019

Looks like the tests are failing on packages/vx-voronoi/test/voronoi.test.ts(24,11).

const [, [x1, y1]] = v.extent();

Might try changing this to:

const [[x0, y0], [x1, y1]] = v.extent();

@williaster
Copy link
Collaborator Author

old school syntax worked :neckbeard: 🎉

@hshoff hshoff merged commit 7a64bed into master Nov 14, 2019
@hshoff hshoff deleted the chris--typescript-vx-voronoi branch November 14, 2019 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-write @vx/voronoi in TypeScript
4 participants