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.

Feature Request

Describe the solution you’d like A flag to add static noConflict method for a global export, that returns new instance of exported value

Describe alternatives you’ve considered None that i can imagine

Teachability, Documentation, Adoption, Migration Strategy Used by jQuery https://github.com/jquery/jquery/blob/c9aae3565edc840961ecbeee77fb0cb367c46702/src/exports/global.js#L15-L25 Rollup seems have similar feature under --noConflict option

So it would be useful, for libs developers that want support same pattern

Should be relatively easy to support, since all we need is to add (pseudo code)

var `old${moduleNameOrBasename}` = globalToAssign;

`${globalToAssign}.noConflict` = function() {
  `${globalToAssign}` = `old${moduleNameOrBasename}`;

  return `${moduleNameOrBasename}`;
};

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ogonkovcommented, Sep 5, 2018

It is extension to umd plugin

0reactions
skyrpexcommented, Sep 5, 2018

Oh sorry, didn’t know it even existed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery.noConflict() | jQuery API Documentation
A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself). Many JavaScript libraries use $ as a...
Read more >
jQuery The noConflict() Method - W3Schools
The noConflict() method releases the hold on the $ shortcut identifier, so that other scripts can use it. You can of course still...
Read more >
How do I implement JQuery.noConflict() ? - Stack Overflow
Put the var j = jQuery.noConflict() after you bring in jquery and then bring in the conflicting scripts. You can then use the...
Read more >
jQuery - noConflict() - Tutorialspoint
Run $.noConflict() method to give control of the $ variable back to whichever library first implemented it. This helps us to make sure...
Read more >
How to Use jQuery noConflict Method - Tutorial Republic
In this tutorial you will learn how to implement jQuery noConflict() method to quickly resolve or fix conflicts between jQuery and other JavaScript...
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