Skip to content

Migrate @turf/buffer to TypeScript, ignoring errors#2994

Merged
smallsaucepan merged 3 commits into
masterfrom
mf/buffer-ts-basic
Apr 28, 2026
Merged

Migrate @turf/buffer to TypeScript, ignoring errors#2994
smallsaucepan merged 3 commits into
masterfrom
mf/buffer-ts-basic

Conversation

@mfedderly

Copy link
Copy Markdown
Collaborator

I'd like to do this more properly, but that will require a major version release.

In the meantime, we can do a low-effort job that gets us migrated away from Javascript-first packages and consolidate on TypeScript instead to simplify some of the build tooling.

@smallsaucepan smallsaucepan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @mfedderly. One more hurdle down.

@plymer

plymer commented Jan 18, 2026

Copy link
Copy Markdown

Hey, this is a fantastic effort. I know the plan is to move away from jsts, but any chance that in the meantime #2937 could get rolled into this update? I'd be happy to re-do the PR in whatever typescript file comes out of your work 🙂

@mfedderly

Copy link
Copy Markdown
Collaborator Author

@plymer I'm trying to focus on #2991 instead of this, and I'm hesitating to expose these configurations until we know we're settled on a library that does provide this. But I am intending to add this eventually.

Unfortunately I'm less convinced that clipper2-ts is a library we want to depend on going forward, so I might go and port clipper2 from scratch myself before we can land that.

@plymer

plymer commented Jan 18, 2026

Copy link
Copy Markdown

Cheers, I appreciate the update and the roadmap ❤️

@bratter

bratter commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Is your lack of desire to use clipper2 as-is an ergonomics/efficiency thing with all the transformation?

@mfedderly

Copy link
Copy Markdown
Collaborator Author

Sadly no, I have concerns about accuracy past Number.MAX_SAFE_INTEGER, and after some rounds of issues/pr's in that repo I'm not sure its reliable enough to bring on as a dependency for us.

@smallsaucepan
smallsaucepan marked this pull request as draft February 9, 2026 01:45
@smallsaucepan

Copy link
Copy Markdown
Contributor

Converting to draft as it's likely we'll favour #2991 instead

@mfedderly

Copy link
Copy Markdown
Collaborator Author

Going to officially close in favor of #2991

@mfedderly mfedderly closed this Mar 15, 2026
@mfedderly mfedderly reopened this Apr 24, 2026
@mfedderly

Copy link
Copy Markdown
Collaborator Author

#2991 actually requires a breaking API change (steps -> arcTolerance), so for v7 we probably just need to do this to unblock some other infrastructure work we'd like to do (this is the last javascript-first package, everything else is TypeScript).

@mfedderly
mfedderly marked this pull request as ready for review April 24, 2026 13:14
@smallsaucepan
smallsaucepan merged commit b20fc81 into master Apr 28, 2026
4 checks passed
@plymer

plymer commented Apr 28, 2026

Copy link
Copy Markdown

Hey there, is the feeling still that you want to hold off exposing the jsts endCapStyles? I recognize that you intend for breaking changes and might have a different API surface planned.

I'd still be happy to port my PR to your TypeScript implementation if you think it would be alright in the interim but totally understandable if you'd prefer not to go that route.

@mfedderly
mfedderly deleted the mf/buffer-ts-basic branch April 28, 2026 23:07
@mfedderly

Copy link
Copy Markdown
Collaborator Author

Unfortunately we can't merge #2991 because of the breaking api change involved with the exposed implementation detail of steps, which is not supported in geoclipper2 (it uses arcTolerance instead and there isn't a real way to map between the two as far as I know). So the new buffer implementation is stuck waiting for a major version (no ETA), and I'm reluctant to change the current version because I don't want to add another breaking change.

Sorry I know this is unfortunate @plymer

@plymer

plymer commented Apr 29, 2026

Copy link
Copy Markdown

Ah no worries! I very much appreciate all the work going on here... it's made my job much simpler and I'm still rocking the patch I made for this niche case :)

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.

4 participants