You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by bh...@apache.org on 2018/05/15 21:20:37 UTC

[arrow] branch master updated: ARROW-2584: [JS] Fixes for node v10

This is an automated email from the ASF dual-hosted git repository.

bhulette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 71d487a  ARROW-2584: [JS] Fixes for node v10
71d487a is described below

commit 71d487aa06b2f934cd9cef70d11b78c225633cd2
Author: ptaylor <pa...@me.com>
AuthorDate: Tue May 15 17:20:22 2018 -0400

    ARROW-2584: [JS] Fixes for node v10
    
    Fixes for node v10 found by @trxcllnt
    
    Author: ptaylor <pa...@me.com>
    Author: Brian Hulette <br...@ccri.com>
    
    Closes #2049 from TheNeuralBit/fix-node-v10 and squashes the following commits:
    
    1eec12a2 <Brian Hulette> Bump CI node version to 10.1
    60f4c644 <ptaylor> fix instanceof ArrayBuffer in jest/node 10
    ba0416fd <ptaylor> fix @std/esm options for node10
---
 .travis.yml            |  4 ++--
 js/gulp/uglify-task.js | 19 ++++++++++++++++++-
 js/package.json        |  4 ++--
 js/test/Arrow.ts       |  9 +++++++++
 4 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index a1b44a8..b94a632 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -136,7 +136,7 @@ matrix:
     - if [ $ARROW_CI_INTEGRATION_AFFECTED != "1" ]; then exit; fi
     - $TRAVIS_BUILD_DIR/ci/travis_install_linux.sh
     - $TRAVIS_BUILD_DIR/ci/travis_install_clang_tools.sh
-    - nvm install 9.8
+    - nvm install 10.1
     - $TRAVIS_BUILD_DIR/ci/travis_before_script_js.sh
     - $TRAVIS_BUILD_DIR/ci/travis_before_script_cpp.sh
     script:
@@ -145,7 +145,7 @@ matrix:
   - language: node_js
     os: linux
     node_js:
-    - '9.8'
+    - '10.1'
     before_script:
     - if [ $ARROW_CI_JS_AFFECTED != "1" ]; then exit; fi
     - $TRAVIS_BUILD_DIR/ci/travis_install_linux.sh
diff --git a/js/gulp/uglify-task.js b/js/gulp/uglify-task.js
index f8dc123..ed0e765 100644
--- a/js/gulp/uglify-task.js
+++ b/js/gulp/uglify-task.js
@@ -30,7 +30,24 @@ const { memoizeTask } = require('./memoize-task');
 const { compileBinFiles } = require('./typescript-task');
 const { Observable, ReplaySubject } = require('rxjs');
 const UglifyJSPlugin = require(`uglifyjs-webpack-plugin`);
-const esmRequire = require(`@std/esm`)(module, { cjs: true, esm: `js`, warnings: false });
+const esmRequire = require(`@std/esm`)(module, {
+    mode: `js`,
+    warnings: false,
+    cjs: {
+        /* A boolean for storing ES modules in require.cache. */
+        cache: true,
+        /* A boolean for respecting require.extensions in ESM. */
+        extensions: true,
+        /* A boolean for __esModule interoperability. */
+        interop: true,
+        /* A boolean for importing named exports of CJS modules. */
+        namedExports: true,
+        /* A boolean for following CJS path rules in ESM. */
+        paths: true,
+        /* A boolean for __dirname, __filename, and require in ESM. */
+        vars: true,
+    }
+});
 
 const uglifyTask = ((cache, commonConfig) => memoizeTask(cache, function uglifyJS(target, format) {
 
diff --git a/js/package.json b/js/package.json
index 9bd9d13..2f222e9 100644
--- a/js/package.json
+++ b/js/package.json
@@ -59,11 +59,11 @@
     "command-line-usage": "4.1.0",
     "flatbuffers": "trxcllnt/flatbuffers-esm",
     "json-bignum": "0.0.3",
-    "text-encoding-utf-8": "^1.0.2",
+    "text-encoding-utf-8": "1.0.2",
     "tslib": "1.9.0"
   },
   "devDependencies": {
-    "@std/esm": "0.19.7",
+    "@std/esm": "0.26.0",
     "@types/glob": "5.0.35",
     "@types/jest": "22.1.0",
     "ast-types": "0.10.1",
diff --git a/js/test/Arrow.ts b/js/test/Arrow.ts
index 9e02737..36f98d4 100644
--- a/js/test/Arrow.ts
+++ b/js/test/Arrow.ts
@@ -18,6 +18,15 @@
 /* tslint:disable */
 // Dynamically load an Arrow target build based on command line arguments
 
+// Fix for Jest in node v10.x
+Object.defineProperty(ArrayBuffer, Symbol.hasInstance, {
+    writable: true,
+    configurable: true,
+    value(inst: any) {
+        return inst && inst.constructor && inst.constructor.name === 'ArrayBuffer';
+    }
+});
+
 const path = require('path');
 const target = process.env.TEST_TARGET!;
 const format = process.env.TEST_MODULE!;

-- 
To stop receiving notification emails like this one, please contact
bhulette@apache.org.