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.

Alternative for "browser" key with higher priority

See original GitHub issue

I’ve stumbled upon this issue in https://github.com/mwilliamson/mammoth.js/pull/106

browser key is widely used for defining which file should be used in browser environment. Some tools might use this field optionally, but they also have an alternative which is tool-specific, for instance, in webpack.

Could you add support for something like browserify.browser with higher priority in addition to browser?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:20 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ljharbcommented, Feb 16, 2018

I don’t see any harm, other than added complexity, of adding such a key - but since all the bundlers and ecosystem tools expect this definition of the “browser” field, i don’t think it would be beneficial for authors - anyone using the browser field for the purpose you describe would end up getting bug reports from the majority of the ecosystem.

In other words, adding a “browserify” key won’t change the reality that “browser” already has a permanent meaning, and that for your use case, you’d want a custom field name regardless.

0reactions
nazar-pccommented, Feb 16, 2018

Right now D3 doesn’t use browser field at all. Not sure why, but in past they have clearly used it for specifying browser build separately from Node.js build: https://github.com/d3/d3/blob/c57952f349dff8bb8035316cedc8878bf7d8b97e/package.json#L18-L19

  "main": "build/d3.node.js",
  "browser": "build/d3.js",

I did a mini-research on common fields about ~1.5-2 years ago and wouldn’t bother to do it again, but back then there were more projects like that.

I think if at this point you are still not convinced to scope browserify’s stuff under browserify key (which by the way already exists) even optionally as other projects do, then I’m disappointed and have really nothing to add.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Optimizing resource loading with Priority Hints - web.dev
Priority Hints indicate the relative priority of resources to the browser. They can enable optimal loading and improve Core Web Vitals.
Read more >
KeyboardEvent.keyCode - Web APIs - MDN Web Docs
When implementing a shortcut key handler, the keypress event is usually better (at least when Gecko is the runtime in use).
Read more >
How to Select the Priority Level for a Program in Windows 11
Select Task Manager's Details tab. Then right-click the EXE process for the software you just started to select Set priority. Choose a Realtime ......
Read more >
Priority Hints - What Your Browser Doesn't Know (Yet) - Etsy
Priority Hints are a newly released browser feature, currently available in Chrome and Edge, that give web developers the option of signaling ...
Read more >
6 Tools to Permanently Set Process Priority in Windows
For example, if you're running a processor intensive task such as video encoding, and it has a higher priority than your web browser,...
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