-
Notifications
You must be signed in to change notification settings - Fork 108
Check for deprecated APIs #2343
Comments
I did. Errors in question seem to be in the btutil.js lib and test files: fxa-auth-server/lib/crypto/butil.js Line 7 in ab7ba5a
fxa-auth-server/lib/crypto/butil.js Line 32 in ab7ba5a
fxa-auth-server/test/local/crypto/butil.js Lines 24 to 25 in ab7ba5a
|
@pdehaan ah different butil, yee |
@vladikoff i think these were left in my fix :( |
2 different files, 4 instances. Looks like #2338 missed a couple buried references. |
@deeptibaghel No worries, I blame the guy who posted screenshots of the code in the original bug (versus showing the results using ➜ fxa-auth-server git:(master) ✗ git grep -n " Buffer("
lib/crypto/butil.js:7:module.exports.ONES = Buffer('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 'hex')
lib/crypto/butil.js:32: var result = Buffer(buffer1.length)
test/local/crypto/butil.js:24: const b1 = Buffer('abcd', 'hex')
test/local/crypto/butil.js:25: const b2 = Buffer('abcd', 'hex') But all kidding aside, switching to eslint-plugin-node's "recommended" rules, found 2-3 other deprecated APIs that warrant consideration. They may come back to haunt you by the time you think about bumping up to node@8, or whatever. |
😉 |
@vladikoff , i am able fix the deprecation of util._extend but not punycode. |
@pdehaan I think the only way we can fix that is maybe calling |
sorry @deeptibaghel ^, mentioned @pdehaan twice 😃 |
Yeah, it's a tricky problem... Using Node@6 and Node@9, it looks like I still get the bundled/deprecated punycode module: const puny = require("punycode");
console.log(puny.version); // 2.0.0 Not sure what the best solution would be. Add an "orphaned" punycode dependency to the package.json, and then you have a fallback if they remove it in Node 10, and things would still work. Even the README at https://github.com/bestiejs/punycode.js seems to say you should do an npm install punycode --save, but locally I'm seeing that default to the bundled Node.js version instead of the downloaded version from npm. $ node -e "console.log(require('punycode').version)" # 2.0.0
$ node -e "console.log(require('./node_modules/punycode').version)" # 2.1.0
$ node --version # v9.7.1
$ node -e "console.log(require.resolve('punycode'))" # punycode
$ node -e "console.log(require.resolve('./node_modules/punycode'))" # /Users/pdehaan/dev/tmp/node_modules/punycode/punycode.js @jrgm: Have you/we ever seen any deprecated Node.js modules yet and have a best practice for package name collisions from npm+Node? |
@mathiasbynens any ideas how to deal with the deprecation warnings above ^ |
Filed upstream mathiasbynens/punycode.js#79 |
@vladikoff If we just want the error to go away, we could just ignore that one line in ESLint (although possibly still add the dependency in package.json in the off-chance they remove the API in the future): // eslint-disable-next-line node/no-deprecated-api
var punycode = require('punycode') |
@vladikoff Lots of good conversation in mathiasbynens/punycode.js#79 and looks like they npm published under punycode.js to avoid a naming conflict, if we're still looking for workarounds for that node/no-deprecated-api error message for punycode. ¯\_(ツ)_/¯ |
I updated the .eslintrc file to the following and also extended plugin:node/recommended and got a few deprecation notices:
The text was updated successfully, but these errors were encountered: