New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Update to Bootstrap 4 #181
Conversation
… but it's still not right.
…t until forms are updated.
First of all thanks @srvance for tackling this! I have not really spend much time thinking about how to add BS4 support. What is your general idea here, it seems you are completely switching to BS4!? As there are probably many apps out there using ember-bootstrap with BS3, I would not want to force them to switch. So a way of supporting both with the same add-on would be cool. Don't know yet how much effort this would require. Any thoughts? |
There are a lot of changes. I should have a better assessment later today. It's definitely not a drop-in replacement. Here are some things I have seen so far.
|
They have a migration doc. It doesn't get into all of the details, but it points you to the right places so far. |
…-to`. May have to be a fully extended component to avoid class overwriting.
Most of the changes I'm finding are through visual inspection of the dummy app and weren't caught by the tests. We should talk about whether testing strategy needs to change or completeness increased to ensure compatibility. At least presence of classes needs to be covered more completely, e.g., |
In the dummy app on the Modals page, unchecking the Open checkboxes results in an "Assertion Failed: Backdrop element should be in DOM" error in the console. Is this expected? |
Just a little bit left, but I'm not sure I will finish it today.
|
Just fixed the modals assertion bug and the broken examples in the dummy app! Pushed to master. |
Nice. I had fixed a bunch of dummy app stuff, as well. |
… but it's still not right.
…t until forms are updated.
…-to`. May have to be a fully extended component to avoid class overwriting.
Rebased after the dummy app fixes. |
…n the bs-tab template. May need to change when we figure out how to handle dropdowns in navs.
@simonihmig I need your input now. Take a look at the Open Questions. Progress bars are going to be problematic because |
Also, can you take a look at the bs-form/element integration test failure? It seems like it may be too implementation specific but I'm not confident I understand the intent. Should it really just be testing that certain things are aligned together rather than the specifics of their location? |
I should note that I am in the process of updating the dummy app, to make it the base for the github page (http://kaliber5.github.io/ember-bootstrap/), including an interactive demo section (kind of what the dummy app is currently, but with better examples and code snippets). There will be merge conflicts, so maybe don't spend too much time on the dummy app now! |
I would not expect BS4 support to land with e-b 1.0. For me the main question is still how/if that should be integrated with the current BS3 based addon:
|
Right now, as long as we unbundle ember-cli-less and bootstrap and let the user install the one of their choice, this branch gives complete compatibility with both versions with the exception of progress bars, which will be fixed in BS4 soon. It needs some more validation, but it appears we could go live with a mutually compatible version. |
What do you mean with unbundling Bootstrap? For the consuming app the default blueprint only adds bootstrap to the app's bower.json (with the right version, which should be changes if BS4 is to be used), and imports (unless deactivated) assets from And ember-cli-less is only used for the dummy app (as a devDependency), we could even switch to plain CSS. |
And by compatibility you mean the components use the BS4 classes also when used in a BS3 context? I am not sure if that is what we want? Might to lead to undesired side effects? |
I mean that we either should not include bootstrap with ember-bootstrap and just have them install the bootstrap of their choosing. Changing the bower.json is easy. I don't know if an install option is feasible. The biggest problem becomes the preprocessor.
Switching to plain CSS would be better. While ember-cli-less is installed as a devDependency, it still causes conflicts on build to have both competing to create a single css.
Yes, components use extra classes. It's a little dirty, but not too bad a tradeoff for mutual compatibility and simpler implementation. BS4 is better about namespacing than BS3 was, so I see the chance of conflict and undesired side effects to be minimal. I asked mdo if they have a mechanism for version checking, but it doesn't seem they do without scraping comments. |
We could conditionalize the obsolete and new classes if we could inject a version check of some sort. From an API perspective, I introduced new components that we should probably put in 1.0 in preparation even if we don't support BS4 immediately. |
I'm pretty much done until we decide how to move forward and they release another BS4 alpha to address the progress bar. |
That's the dropdown/item and the nav/link, right? It seems they just add some static classes, so do we really need them? As opposed to just updating the docs? IIRC we had a similar discussion about that with the navbar, whether it makes sense to create components just for static markup? :) I am open to different views though... What exactly is the issue with the new progress bar? I will try to put a strategy together how we could integrate BS4 support without dropping BS3, that covers the issues you mentioned (Less vs. Sass, different tests, etc.). But that will have wait for the new year! ;) You mentioned you were working on a project that required BS4. Is the current state of your fork enough to get you going? I fear that the final, frictionless integration of BS4 might not be possible in the very short-term... Nevertheless and again thanks a lot for your work so far, really appreciate it! Have a happy New Year! 🎇🍾 |
Hm, this just came to my mind about the nav/link component: currently I reopen the base A bit unsure still about the dropdown/item though. If we add that, then probably also dropdown/divider... |
re dropdown/item and nav/link: It's just static classes, but it's also what makes it so you have no code changes to switch from BS3 to BS4. A dropdown/divider would do the same thing if it included both BS3 and BS4 classes. This is really a mutual compatibility technique that we wouldn't need if the classes were the same or we were willing to impose some porting requirements. There's a similar open question for nav dropdown items; they don't render properly in BS4 without some additional classes.
Their first implementation attempted to use the HTML5
It is. I'm using it already. I can't track the head of bootstrap's |
Have a happy new year! I went a little crazy on this because I'm working on a fun personal project. |
@srvance pushed to master:
|
FYI, I'm waiting for the next bootstrap alpha release before putting more into this. @simonihmig Have you thought more about how you want to release this? The idea of maintaining two codebases in parallel just seems like a lot of extra risk and effort compared to a few extra bootstrap classes for the remainder of BS3's life cycle. |
I just looked and they cut a new release three days ago. It may take me a couple days to get back to it. |
I may be able to contribute to this too. |
Closing this in favor of #206 |
Update to Bootstrap 4.
Compatibility
General
Features
btn-default
changed tobtn-secondary
. Applied both via computed property sincebtn-default
was handled throughtype-class
.btn-xs
dropped; no code change required. The stateful button feature was dropped, but we can retain it.btn-xs
dropped; no code change required.dropdown-toggle
automatically adds the caret; it does not duplicate if the caret span is present. Add component so thatdropdown-item
class can be applied for BS4.divider
was changed todropdown-divider
; do we want to create a component that's mutually compatible or let people use the one appropriate to their version since it's only adiv
with a class?row
class in horizontal layouts. That change still won't work if the form group is used directly.nav-item
class. How should we handle dropdown nav items?nav-link
class can be applied for BS4icon-bar
style was removed, but it's pretty easy to add in. The responsive breakpoint is no longer automatic, so some computed classes need to be added as well as a couple of new classes.progress
element instead of adiv
, but they're reverting back to something similar to the BS3 implementation.auto
, but I don't think we've implemented itOpen Questions
dropdown.divider
component?nav-item
class? We could create a contextualnav.dropdown
that would just add some classes. We would need an undocumentedinNav
parameter to put thenav-item
andnav-link
classes on the right places.nav-link
there.app.less
andapp.scss
in the dummy app?To Do
General
Features to update
and more
Features to add