Add `noConflict`
See original GitHub issueFeature 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:
- Created 5 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is extension to umd plugin
Oh sorry, didn’t know it even existed.