We start with a new application, using Ember 3.8 and bootstrap/SASS. There seem to be two add-ins available which support bootstrap within Ember, ember-boostrap and ember-cli-bootrap-sassy.
While the former implements ember components for most of the bootstrap features and also "replaces" the original bootstrap.js by it's own implementation, with the latter, it seems I can still use all the original components and js implementations.
From first glace, I would be much more comfortable with ember-cli-bootrap-sassy, since I could still use all bootstrap examples from the web, and having a "customized" version of bootstrap.js also seem somewhat counter-intuitive to me. Also, what about all the bootstrap features ember-bootstrap does not implement, but I still require? It seems like I might be ending with an appliation which would use ember-bootstrap, but additionally uses all sorts of "workarounds" for things not implemented.
Since I don't have much experience in this field, I would be glad for some recommendations and insights from experts.
So first of all a disclaimer: as the author of
ember-bootstrap, I am certainly a bit biased here! ;)But I think I have strong arguments in favor of
ember-bootstrap, otherwise I wouldn't have invested that ton of work. So the main one is that it follows the programming model of Ember, while usingbootstrap.jsdirectly doesn't and would often feel awkward in an Ember app:ember-bootstrapstrictly follow the so called "Data down Actions up" (DDAU) programming model in Ember$('#myModal').modal('show'))If that sound too abstract, take this simple example of a modal component. In
ember-bootstrapyou would do something like this:showConfirmationstate totrue(or even having that computed automatically with a computed property). Inbootstrap.jsyou would somehow have to imperatively call$('#myModal').modal('show')bootstrap.jsyou would have to attach event listeners first in your JavaScript (and later remove them!):$('#myModal').on('hidden.bs.modal', function (e) { // do something }).{{#if ...}}block or changing routes).These are the main points from my point of view, but there are even a few more:
ember-bootstrapplays nicely with Ember's testing layer. Withbootstrap.jsyou will at some point run into issues, for example the code usessetTimeout()calls for handling of transitions, which Ember's testing helpers don't know of, and so don't wait for. But often you have to rely in tests that your app is in a "settled state".ember-bootstrapinstead integrates into Ember's so called Run Loop, so things likeawait click('#show-modal-button')just work (i.e. the modal will be fully visible when the Promise resolves).bootstrap.jsneeds jQuery, whileember-bootstrapdoes not.And to add one more thing: all of the above applies to Bootstrap components that need JavaScript. For just static components like badges you can just write the appropriate Bootstrap flavored markup. In fact
ember-bootstrapintentionally does not provide components for these trivial Bootstrap components to not add any useless overhead.