bootboxjs / bootbox

Wrappers for JavaScript alert(), confirm() and other flexible dialogs using Twitter's bootstrap framework

Home Page:http://bootboxjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request - Drop jQuery

yhojann-cl opened this issue · comments

Please, add a release without jquery dependency.

Short answer: no.

Long answer: removing jQuery as a dependency is a wish-list item that I would like to do, but there's quite a bit of related work that would need to be done (I'm assuming what you're really after is better compatibility with Bootstrap 5?). As the most active collaborator, if I'm not doing it, it probably isn't happening.

PRs are always welcomed, although you would need to make sure that the test suite is updated to verify that the jQuery-less version still behaves the same as the current version.

I'll leave this open for now, in case @tarlepp has a different response to add, since he's been at least somewhat active.

Yes I needed to use bootstrap 5 with reactjs, but using bootbox (in public/assets/ as static file) it generates jquery dependency errors, I have entered it in the main public/index.html, but it keeps telling me that jquery does not exist, which is why I thought I had to install jquery via npm or static in public/. I thought it was a lot of dependency for a simple alert message so I ended up using a native modal box.

Thanks anyway for understanding.

Technically, you could use Zepto or jQuery Slim (I think), but the UMD wrapper might be setup to expect jQuery specifically.

We use jQuery as a templating engine more than anything else, I think, but we also use the jQuery functions defined in Bootstrap 2/3/4 directly (i.e. $(template).modal('show');). So, like I said, a bunch of related work.

Bootbox really, at it's core, is just a Bootstrap Modal generator, with some helper functions that attempt to mimic the native functions. Because of that, one thing you might have run into with react is that using something like bootbox.prompt(), bootbox.confirm(), or bootbox.alert() is not a blocking call (we cover this in the docs, but, well, not everyone reads that). So, if your react code expected the modal to stop the processing thread, you'd run into "why is this thing still going?" issues. Even in Bootstrap 5, modals are just positioned divs.

An interesting experiment, if you have time, is to see if the dialog element will accept Bootstrap's styling. That element, unlike a div, can mimic the native dialogs and is style-able with CSS. It only works natively in recent(ish) Chromium-based browsers, though, so caveat emptor.

Dropping jQuery would need some serious work (and that means some serious time) + new major version - imho.

I don't really have time to do massive refactoring like that :( but as @tiesont mentioned PRs are always welcome.

Pls keep Jquery :-)
Its used in about 70% of Fortune 500 Companies ...
;-)

Pls keep Jquery :-) Its used in about 70% of Fortune 500 Companies ... ;-)

And flash player is used in big companies like as chinese trains system but this does not approve its use: https://arstechnica.com/tech-policy/2021/01/deactivation-of-flash-cripples-chinese-railroad-for-a-day/