mourner / rbush

RBush — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles
MIT License
2.46k stars 237 forks source link

Transpile ES6 features except import/ export in module #114

Closed walkermatt closed 1 year ago

walkermatt commented 3 years ago

Currently package.json specifies index.js as the module; index.js includes ES6 features that require transpiling to ES5 to support older environments. The new rbush.esm.js includes import/ export statements but all other ES6 features are transpiled following the advice here: pkg.module.

ahocevar commented 1 year ago

@mourner Any chance you could consider this pull request and publish a new release? Thanks in advance!

mourner commented 1 year ago

@ahocevar can you explain why the modern default bundle should be ES5? If anything I'd rather remove transpiling completely in a new version rather than take the project to the past, and let people who need legacy compatibility to handle transpiling on their end, but maybe I'm missing something. (Sorry for not replying here earlier)

ahocevar commented 1 year ago

@mourner I agree the modern default bundle should not be transpiled at all. I think at the time @walkermatt created this pull request, what he suggested was still common practice, but isn't any more.

Let me know if you want help modifying this pull request or creating a new one - I'd be happy to help, but it might be a week or two before I get to it.

mourner commented 1 year ago

@ahocevar thanks for the offer! But I'm still confused — if you don't need the default ESM bundle to be transpiled, can you describe the problem you're having that prompted your comment earlier, and what you would need in a new release instead?

ahocevar commented 1 year ago

@mourner Sorry for the confusion! I misunderstood the whole chain of comments here and there! I was under the impression that rbush is published as CommonJS package only. Thanks for your questions, they clarified the situation for me. Please disregard my comments - this pull request does not make sense indeed nowadays.

Everything should be fine, OpenLayers is now also published as untranspiled set of ES modules.