Skip to content

Add polyfills to make apache-arrow work in Node@14 - #219

Merged
kravets-levko merged 4 commits into
mainfrom
node14-compatibility
Jan 25, 2024
Merged

Add polyfills to make apache-arrow work in Node@14#219
kravets-levko merged 4 commits into
mainfrom
node14-compatibility

Conversation

@kravets-levko

@kravets-levkokravets-levko commented Jan 22, 2024

Copy link
Copy Markdown
Contributor

After upgrading apache-arrow in #180 (which was needed to fix#150), this library stopped working in some Nodejs versions. Turns out that apache-arrow@13 started to massively use Array.at/TypedArray.at methods which became available only in Node@16.6.0.

Even if we forget that apache-arrow declares a support for Node@12 (at least in its package.json file), we had two options:

  1. stop supporting older Nodejs versions;
  2. add polyfills for missing methods.

I ended up implementing own polyfill with this reasoning:

  1. we still have users that use Node 16 or even 14 (but for option 1 we'd have to declare support for even newer versions);
  2. basically, only one method is currently needed (Array.at/TypedArray.at can use same implementation);
  3. the needed method is really simple (so even using core-js would be absolute overkill).

Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Signed-off-by: Levko Kravets <levko.ne@gmail.com>
@codecov-commenter

codecov-commenter commented Jan 24, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (086f5bb) 90.41% compared to head (dd20df9) 90.51%.

Additional details and impacted files
@@ Coverage Diff @@## main #219 +/- ##
==========================================
+ Coverage 90.41% 90.51% +0.10% 
==========================================
Files 61 62 +1 Lines 1408 1423 +15 Branches 232 238 +6 ==========================================
+ Hits 1273 1288 +15 
Misses 84 84 Partials 51 51 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kravets-levko
kravets-levko merged commit 8c590d7 into mainJan 25, 2024
@kravets-levko
kravets-levko deleted the node14-compatibility branch January 25, 2024 09:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scientific notation negative numbers

3 participants

@kravets-levko@codecov-commenter@rcypher-databricks