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

ARROW-2584: [JS] Fixes for node v10 #2049

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
19 changes: 18 additions & 1 deletion js/gulp/uglify-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down
4 changes: 2 additions & 2 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions js/test/Arrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!;
Expand Down