question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Browserify v17 wishlist

See original GitHub issue
  • node@10 compatible streams via readable-streams@3
  • module-deps module replacements without redirect module https://github.com/browserify/browserify/blob/e52476bdf6259a238c6d944dde6a9d6c85aad631/index.js#L718-L720 (includes dedupe redirects)
  • better hook for plugins to interact with browserify options before being consumed internally
  • support for parsing “more modern js” out of the box
  • resolve all npm audit reports + add CI task
  • document explicit platform support for (1) browserify (2) bundles
  • public + documented API for replacing modules deep in the graph (can currently do it via js by mutating the builtins obj example)
  • drop older platform support to make these improvements easier ^

this is my personal list, happy to add others

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:21 (13 by maintainers)

github_iconTop GitHub Comments

4reactions
mikealcommented, Feb 3, 2020

Making this work without jumping through all the hoops should be a priority since Node.js native ESM is landing.

2reactions
hawkerboy7commented, Apr 11, 2020

Hi, May I suggest the following feature?

Adding a function or argument to the require function to allow the ‘client-side’ code to determine whether or not a file (which is required) should break the bundle process if it is not found.

It allows for some files to be optional, like local settings. This feature partially already exists by using the argument ignoreMissing. But it is static and cannot be dynamically changed by your ‘client-side’ code.

This will help solve issues people have trying to use a try catch to get modules optionally, which is a mechanism that does not work for the require function since it is executed client-side after the bundle process.

var settings = {a: 1, b: 2};
var item = require("./item");
var localSettings = require.ignoreIfMissing("./local-settings");
if (localSettings !== undefined) {
 settings = localSettings;
};

OR

var settings = {a: 1, b: 2};
var item = require("./item");
var localSettings = require("./local-settings", {ignoreIfMissing: true});
if (localSettings !== undefined) {
  settings = localSettings;
};

With this setup:

  • if the file item.js is not found the bundle breaks (the way Browserify already works) which is good and expected.
  • if the file local-settings.js is not found the bundle would just return undefined (or null) but not break allowing you to optionally have the file local-settings.js but determined to be optional by your ‘client-side’ code.

I’ve copied the code examples from my other post here. https://github.com/browserify/browserify/issues/901#issuecomment-611471829

Read more comments on GitHub >

github_iconTop Results From Across the Web

#780357 - RFP: node-browserify -- provides a nodejs type require ...
Fixed in version node-browserify/17.0.0+ds-1 ... Package: wnpp Severity: wishlist Owner: Ross Gammon <rossgammon@mail.dk> * Package name : node-browserify ...
Read more >
Browserify
Browserify lets you require('modules') in the browser by bundling up all of your dependencies. Install Documentation · Source Code · Help + Articles...
Read more >
Incident Response - Hybrid Analysis
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to fight malware.
Read more >
browserify on Twitter: "browserify 17 is out! As usual, the ...
Release v17.0.0 · browserify/browserify. Upgrade events to v3.x. EventEmitter instances now have an off() method. require('events').once can ...
Read more >
how to make shared url with react native share api clickable
Like next 11 will use v17, since all my apps use the latest nextjs, they will be compliment with a v17 version of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found