webpack / node-libs-browser

[DEPRECATED] The node core libs for in browser usage.
MIT License
448 stars 78 forks source link

Incompatibility between Node.js core libs and webpack's lib #78

Open azu opened 6 years ago

azu commented 6 years ago

I've collected the gap between Node.js core lib and webpack/browserify's shim lib.

Latest results is in following repository.

Env

Gap list

Node.js Browser shim Issue Link
assert defunctzombie/commonjs-assert Error code and Error message are different Issue, Article
assert.deepEqual does't support Map, Set, Iterator etc... Issue, Document, Release
require("assert").strict Docs, Release
buffer feross/buffer ---
child_process --- ---
cluster --- ---
console Raynos/console-browserify ---
constants juliangruber/constants-browserify ---
crypto crypto-browserify/crypto-browserify ---
dgram --- ---
dns --- ---
domain bevry/domain-browser ---
events Gozala/events eventNames Issue
getMaxListeners Issue
prependListener Issue
prependOnceListener Issue
off Issue
fs --- ---
http jhiesey/stream-http ---
https substack/https-browserify ---
module --- ---
net --- ---
os CoderPuppy/os-browserify os.constants
path substack/path-browserify path.posix Issue
path.parse(path) Issue
path.win32
path.format(pathObject)
process shtylman/node-process process.channel
process.platform Issue
process.execArgv Issue
process.cpuUsage([previousValue])
process.emitWarning(warning[, options])
punycode bestiejs/punycode.js ---
querystring mike-spainhower/querystring ---
readline --- ---
repl --- ---
stream substack/stream-browserify ---
string_decoder rvagg/string_decoder --- Repository
sys defunctzombie/node-util ---
timers jryans/timers-browserify ---
tls --- ---
tty substack/tty-browserify ---
url defunctzombie/node-url url.URL(WHATWG URL) Release, Document, Issue
url.format does't support WHATWG URL Release, Document
util defunctzombie/node-util util.callbackify(original)
util.inspect.custom
util.inspect.defaultOptions
util.promisify(original)
util.promisify.custom
util.inspect() options maxArrayLength, breakLength
util.isDeepStrictEqual
vm substack/vm-browserify vm.isContext(sandbox)
zlib devongovett/browserify-zlib zlib.bytesRead

Tests

Also, I've written the test for these new methods/properties.

Node.js 10 pass the tests, but the code that is bundled by webpack is failed.

goto-bus-stop commented 6 years ago

eventNames, getMaxListeners, prependListener and prependOnceListener are available in events@2.0.0 (https://github.com/webpack/node-libs-browser/pull/74). off will be available in events@3.0.0.

billiegoose commented 6 years ago

path.posix, path.parse, and parth.format are available in path-browserify@1.0.0

jhnns commented 5 years ago

@azu thanks for compiling that list. That will definitely be helpful when updating the libraries 👍

We can't do that too frequently as updating these libraries might be breaking change for a lot of people.

niksy commented 2 years ago

Since node-libs-browser is not active and updated anymore, I’ve taken time and created package which is based on this one but updates it to modern implementation.