mirror of https://github.com/nodejs/node.git
Page:
Breaking changes between v5 and v6
Pages
API changes between v0.10 and v0.12
API changes between v0.10 and v4
API changes between v0.4 and v0.6
API changes between v0.6 and v0.8
API changes between v0.8 and v0.10
Breaking Changes
Breaking changes between Node 7 and 8
Breaking changes between v4 LTS and v6 LTS
Breaking changes between v4 and v5
Breaking changes between v5 and v6
Breaking changes between v6 LTS and v8 LTS
Breaking changes between v6 and v7
CITGM Status
CITGM known flakes
CITGM results table
Creating a CTC Meeting Issue
ES6 Module Detection in Node
Flaky tests
Frequently Asked Questions
Home
Installing and Building Node.js
Installing io.js via package manager
Meetings: Creating a Hangouts On Air Event
Merging pull requests with Jenkins
Migrating IO polling from libev to libuv
Migrating from v0.2 to v0.3
Migrating from v0.2 to v0.4
Statically linked executable
Testing pull requests with Jenkins
Windows Environment
12
Breaking changes between v5 and v6
Jeremiah Senkpiel edited this page 2016-08-08 16:28:07 -04:00
Breaking changes between v5 and v6
When editing this page please be as detailed as possible.
For older breaking changes, please see our v4 to v5 page.
89 commits were tagged semver-major
.
Note to readers: #
is synonymous with .prototype.
, and indicates the property is available on instances of that class.
Example: Object#toString()
is equivalent to Object.prototype.toString()
.
By Subsystem
buffer
[Docs]
- Deprecated
new Buffer()
in favor of a few newly added Buffer APIs:Buffer.from()
,Buffer.alloc()
andBuffer.allocUnsafe()
.- Refs:
85ab4a5f12
, #4682
- Refs:
- Removed the previously deprecated
Buffer#write(string, encoding, offset, length)
.Buffer#write()
remains with all other call signatures, such asBuffer#write(string[, encoding])
.- Refs:
2c55cc2d2c
, #5048
- Removed the previously deprecated
Buffer#{get|set}
methods.Buffer#get(index)
is superseded bybuffer[index]
.Buffer#set(index, value)
is superseded bybuffer[index] = value
.- Refs:
101bca988c
, #4594
new Buffer(length, encoding)
now throws.- The length argument had no effect if a number was passed, and this usage indicates a possible security problem.
- Refs:
3b27dd5ce1
, #4514
SlowBuffer
has been given a docs deprecation notice in favor of the newBuffer.allocUnsafeSlow()
.- Refs:
3fe204c700
,627524973a
, #5833
- Refs:
cluster
[Docs]
- The
Worker#suicide
property has been deprecated in favor of the more descriptiveWorker#exitedAfterDisconnect
.- The functionality remains the same.
- Refs:
4f619bde4c
, #3743
- The
'message'
event from cluster now calls with 3 arguments, with worker being the first argument.- Previously the callback signature was
(message, handle)
, now it is(worker, message, handle)
. - Refs:
66f4586dd0
, #5361
- Previously the callback signature was
console
[Docs]
Console#timeEnd(label)
now internally cleans up after itself.- Previously it left the timer label in the
_times
map. - Refs:
a5cce79ec3
, #3562
- Previously it left the timer label in the
Console#timeEnd(label)
now only emits a warning if the label does not exist.- Previously, this would throw an error.
- Refs:
1c84579031
, #5901
crypto
[Docs]
- Error messages from the C++ code are now better formatted.
- Refs:
41feaa89e0
, #3100,1d9451bb5a
, #6042
- Refs:
- Native OpenSSL Symbols are now exported correctly on Windows.
- This can cause compile errors for addons that were previously working around the missing symbols.
- Refs:
b4d4fd939c
, #6274
require('crypto')
now throws if node has been built without crypto support.- Also happens for
require('tls')
, andrequire('https')
. - Refs:
f429fe1b88
, #5611
- Also happens for
crypto.Certificate
no longer has_handle
property.- Class methods that previously needed this now call to the c++ binding directly.
- Refs:
a37401e061
, #5382
- The
digest
parameter forcrypto.pbkdf2()
is now required.- Not using the digest parameter currently prints a deprecation warning
- The default encoding for all crypto methods is now
utf8
.- Previously, the encoding was
binary
(node's version oflatin1
). - Refs:
b010c87164
, #5522
- Previously, the encoding was
- FIPS-compliant mode is now off by default even if node is built with FIPS-compliance.
- Note: Regular node releases are not built with FIPS enabled.
- Refs:
7c48cb5601
, #5181
dgram
[Docs]
- If there is no error when calling
Socket#send()
, the callback'serror
parameter will now once again benull
, rather than0
.- This is how it was prior to
c9fd9e2
in io.js 1.0.0. - Refs:
4bc1cccb22
, #5929
- This is how it was prior to
dns
[Docs]
dns.resolve()
now supports resolving plain DNS PTR records.- Previously, calling
dns.resolve(hostname, 'PTR', cb)
would calldns.reverse()
on the hostname. That is no longer the case. - The hostname must now be passed as a reverse IN-ADDR domain.
- Refs:
dbdbdd4998
, #4921
- Previously, calling
Before:
dns.resolve('8.8.4.4', 'PTR', (err, result) => {
if (err) {
// handle error
}
// result => ['google-public-dns-b.google.com']
});
After:
dns.resolve('4.4.8.8-in-addr.arpa', 'PTR', (err, result) => {
if (err) {
// handle error
}
// result => ['google-public-dns-b.google.com']
});
// one could also simply do
dns.reverse('8.8.4.4', (err, result) => {
if (err) {
// handle error
}
// result => ['google-public-dns-b.google.com']
});
dns.lookupService()
now coerces the port parameter to a number.- Previously, if
port
was not a number, aTypeError
would be thrown. - Now, if the port is outside the range of 0-65535, a
TypeError
will be thrown. - Refs:
f3be421c1c
, #4883
- Previously, if
domain
[Docs]
- Domains no longer assign their context to other error handling code when there is no domain
'error'
event handler.- Previously, this was only the case if the
'error'
event from the domain was handled. - Refs:
90204cc468
, #4659
- Previously, this was only the case if the
events
[Docs]
- The internal event handler storage object
EventEmitter#_events
now inherits fromObject.create(null)
rather thanObject.prototype
.- This prevents issues with events using otherwise reserved property names such as
__proto__
. - This also means that any properties that modules intentionally add to
Object.prototype
will not be available on_events
. - Refs:
e38bade828
, #6092
- This prevents issues with events using otherwise reserved property names such as
freelist
- The deprecated
freelist
module has been removed.- This module was intended to be internal only and we had no intention of maintaining it beyond our own use.
- Use-cases for this would be better suited using a user-land module.
- Refs:
b70dc67828
, #3738
fs
[Docs]
fs.readdir{Sync}()
now returns filenames in utf8 by default.- The encoding of filenames is now configurable via an options object.
- Example:
fs.readdir(path, { encoding: 'hex' }, callback)
- Refs:
060e5f0c00
, #5616
- Deprecated re-evaluating the
fs
source code from user code.- Refs:
1d79787e2e
, #5102
- Refs:
- Deprecated
fs.read()
's legacy(fd, length, position, encoding, callback)
call signature.- Refs:
1124de2d76
, #4525
- Refs:
fs.read()
with a read length of 0 no longer throws.- Refs:
2b15e68bbe
, #4518
- Refs:
fs.link{Sync}()
now does its call parameter checks in the correct order.- Refs:
8b97249893
, #3917
- Refs:
fs.realpath{Sync}()
now usesuv_fs_realpath()
under the hood, rather than using a JavaScript implementation.- The
cache
parameter no longer accepts an object cache, and instead has been superseded by an options parameter. - Refs:
b488b19eaf
, #3594
- The
globals
[Docs]
- Deprecated the
root
andGLOBAL
aliases toglobal
.- Refs:
4e46931406
, #1838
- Refs:
module
[Docs]
- The current directory is now prioritized for relative lookups.
- Previously
node_module
directories would be prioritized if present. - For example,
require('./example')
would previously requirenode_modules/example
if it existed, rather than./example.js
. - Refs:
d38503ab01
, #5689
- Previously
- Symlinks are now preserved when using
require()
- Refs:
de1dc0ae2e
, #5950.
- Refs:
- Syntax errors in
require()
'd files now print with more information.- Refs:
18490d3d5a
, #4287
- Refs:
net
[Docs]
- Valid port checking is now stricter.
- Now ensures possible values such as
true
and[1]
are not seen as valid ports. - Refs:
d0edabecbf
, #5733,02ac302b6d
, #5732
- Now ensures possible values such as
net.createServer()
now throws if a suppliedoptions
argument is not an object.- It is still possible to only supply a connectionListener callback.
- Refs:
a78b3344f8
, #2904
- The
V4MAPPED
DNS hint is no longer set by default. However, theADDRCONFIG
is still set.- If your platform needs to set hints, you can now use the new
hints
bitwise flag option forSocket#connect()
. - Refs:
b85a50b6da
,54dd7c38e5
, #6021
- If your platform needs to set hints, you can now use the new
path
[Docs]
- All of the path module's utilities now throw if the provided input is not a string.
- Refs:
08085c49b6
, #5348
- Refs:
path.format()
is now more consistent & functional across platforms.- Refs:
d1000b4137
, #2408
- Refs:
process
[Docs]
- Accessing
process.EventEmitter
now prints a deprecation warning.- It was long since deprecated in the source code.
- Refs:
25751bedfe
, #5049
- All previously printed node warnings are now more consistent and only emitted via the default handler for a new process
'warning'
event.- This include deprecations, which are now classified as
DeprecationWarning
s. - Refs:
c6656db352
, #4782
- This include deprecations, which are now classified as
process.nextTick()
now throws if the argument is not a function.- Refs:
72e3dd9f43
, #3860
- Refs:
querystring
[Docs]
- The parsed object returned by
querystring.parse()
now inherits fromObject.create(null)
rather thanObject.prototype
.- This prevents issues with querystring properties using otherwise reserved property names such as
__proto__
. - This also means that any properties that modules intentionally add to
Object.prototype
will not be available on the returned object.. - Refs:
dba245f796
, #6055
- This prevents issues with querystring properties using otherwise reserved property names such as
querystring.escape()
now usesObject#toString()
for objects rather thanObject#valueOf()
.- This brings it more in-line with the functionality of
encodeURIComponent()
. 5dafb435d8
, #5341
- This brings it more in-line with the functionality of
readline
[Docs]
- Readline history can now be disabled by setting the
createInterface()
optionhistorySize
to0
.- Previously, setting to
0
would just use the default of30
lines. - Refs:
0303a2552e
, #6352
- Previously, setting to
- Deprecated the following undocumented readline functions, which are only intended for internal use:
isFullWidthCodePoint()
,stripVTControlCharacters()
,getStringWidth()
,emitKeys()
- Refs:
ca2e8b292f
, #3862
Readline#emitKeypressEvents(stream)
now always provides the key info parameter in'keypress'
events to the provided stream.- Refs:
0a62f929da
, #6024
- Refs:
repl
[Docs]
- It is now possible to assign a variable to
_
, which usually holds the result of the last expression within the REPL.- Doing this will print a warning and disable the behavior of holding the last expression.
- Refs:
ad8257fa5b
, 5535
- Improvements have been made that decrease the number of errors when REPL completion fails.
- Refs:
3ee68f794f
, 6328
- Refs:
stream
[Docs]
- Writing a
null
chunk while in object mode is now invalid and will throw a TypeError.- Refs:
e7c077c610
, #6170
- Refs:
timers
[Docs]
set{
Timeout
|
Interval
|
Immediate
}()
now throw immediately if they are not provided functions.- These methods already threw for non-functions, just when it would timeout.
- Refs:
ac153bd2a6
, #4362
tls
[Docs]
tls.Server
's'clientError'
is now'tlsClientError'
.- This was done because
http
now has'clientError'
. - Refs:
1ab6b21360
, #4557
- This was done because
tls.createServer()
'ssessionIdContext
now uses sha1 instead of md5 to make the default hash.- This still only applies if
sessionIdContext
is not set manually, andrequestCert
is set totrue
. - Refs:
df268f97bc
, #3866
- This still only applies if
tls.createSecurePair()
has been deprecated in the docs in favor ofTLSSocket
.- Refs:
31de5cc436
, #6063
- Refs:
tty
[Docs]
- The previously deprecated, global
tty.setRawMode()
method has been removed.- Please use the tty instance method instead.
- Refs:
a2c0aa84e0
, #2528
url
[Docs]
url.resolve()
now drops auth information if the host changes.- This is a security measure to help ensure authentication credentials are not leaked.
- Refs:
eb4201f07a
, #1480
util
[Docs]
- Subclassed errors now format as
[MyError: message]
rather than justMyError {}
.- Refs:
e2f47f5698
, #4582
- Refs:
Date
's now always useDate#toISOString()
for formatting.- Refs:
93d6b5fb68
, #4318
- Refs:
util.inspect()
now uses c++ bindings to detect JavaScript builtins & primitives.- Refs:
24012a879d
, #4098
- Refs:
- Removed the previously deprecated
util.pump()
. Please useReadableStream#pipe()
instead.- Refs:
007cfea308
, #2531
- Refs:
- Removed the previously deprecated
util.exec()
. Please usechild_process.exec()
instead.- Refs:
4cf19ad1bb
, #2530
- Refs:
- TypedArrays now format like regular arrays.
- Also applies to ArrayBuffer and DataView.
- Refs:
34a35919e1
, #3793
util._extend()
has been deprecated in the docs in favor ofObject.assign()
.- Refs:
d8290286b3
, #4903
- Refs:
util.log()
has been given a docs deprecation notice.- Refs:
236b7e8dd1
, #6161
- Refs:
vm
[Docs]
- The
vm.Script
optiondisplayErrors
now attaches the line of code that caused the error to the stack trace.- Refs:
57003520f8
, #4874
- Refs:
zlib
[Docs]
- The
close
event from zlib instances no longer emits on synchronous calls.- This only effects all
*Sync()
methods. - Refs:
8b43d3f52d
, #5707
- This only effects all
- Gzip trailing garbage after a gzip stream is no longer discarded and now throws an error instead.
- Note: Null byte padding is not affected, since it has been pointed
out at various occasions that such padding is normal and
discarded by
gzip(1)
, too. - Refs:
54a5287e3e
, #5883
- Note: Null byte padding is not affected, since it has been pointed
out at various occasions that such padding is normal and
discarded by
Native Modules (Addons)
- The module ABI has changed due to a minor addition to module initialization.
- This only means that native addons will need to be recompiled.
- Refs:
71470a8e45
, #4771
- The
NODE_MODULE_VERSION
is now48
. - Some previously deprecated internal functions have been removed.
- Refs:
757fbac64b
, #6053
- Refs:
General Node
- Internal tooling no longer ships in node tarballs, reducing their size by about 10%.
- Refs:
90a5fc20be
, #5695
- Refs:
--
- All printed warnings are now prefixed with
(node:pid)
.- Refs:
d01eb6882f
, #3878,94b9948d63
, #3833
- Refs:
--
- Error messages are now more consistent across all modules.
- All now start with a capital letter, contain no other regular words with capitals, and do not contain ending periods.
- Additionally, argument names and other code is now always between double quotations (
"
). - In some cases, errors are also now more informative.
- Refs:
20285ad177
, #3374,53a95a5b12
, #5616,8bb60e3c8d
, #5590,ec49fc8229
, #5981
--
- Node.js no longer supports Windows Vista or previous versions, and will refuse to run on those versions of windows.
- Additionally, the installer will not install on those windows versions.
- The minimum supported versions of windows are now Windows 7 and Windows Server 2008 R2.
- Refs:
1cf26c036d
,55db19074d
, #5167
--
- Node.js no longer supports building on OS X versions older than 10.7.
- Refs:
204f3a8a0b
, #6402
- Refs:
--
- Installing via
Makefile
(tools/install.py
) no longer attempts to change the target location of node in npm's shebang to the locally built node.- Instead, it is kept as
#!/usr/bin/env node
, which looks for node globally. - Refs:
8ffa20c495
, #6098
- Instead, it is kept as
Dependencies
- Shared c-ares builds are now supported once again.
- Refs:
2253be95d0
, #5775
- Refs:
- V8 has been upgraded to 5.0.71.32 + floating patches.
- Refs: deps/v8