Skip to content
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

Update to bootstrap@4.0.0-beta #410

Merged
merged 28 commits into from
Nov 7, 2017
Merged

Update to bootstrap@4.0.0-beta #410

merged 28 commits into from
Nov 7, 2017

Conversation

srvance
Copy link
Contributor

@srvance srvance commented Aug 13, 2017

Updating to BS4 beta, all tests pass.

The following issues are observed in the components in the demo app:

  • Accordion:
    • Change card-block to card-body
    • fix failing tests
  • Alert: none in the functionality
    • The spacing on the forms between the checkboxes is too tight
    • The dropdown resizes in a way that crops the longer text when the shorter options are selected (This seems to be an ember-power-select issue and unrelated to BS4)
  • Button: none
  • Button group: none
  • Collapse: none
  • Dropdown:
    • Neither regular nor button dropdowns work (Reason: The show class moved to the menu)
    • The regular dropdown spacing seems too close together (See Forms)
    • Dropup drops down (Reason: I think this has to do with the use of Popper and how BS4 defers several elements of styling to it)
    • fix flicker of dropup
    • TODO: Specialize dropdown toggle so that the caret span is unnecessary
  • Forms:
    • The inline spacing in the first example is too tight (Reason: BS4 requires the addition of the spacing classes. We need to apply defaults and a means to override.)
    • verify validation markup
  • Modal: none
  • Navbar:
    • Shows as responsive and collapsed by default (Reason: Class was changed from navbar-toggleable-* to navbar-expand-*
    • Menu icon empty (Reason: This is actually an issue with the way the toggle passes the color scheme into the navbar in the demo app. It could also be seen as a bug in how bs-navbar handles null or undefined values as its defaults, so that has been fixed.)
    • Checkbox spacing is too tight
  • Nav: none in the functionality
    • Form spacing is too tight (checkboxes are okay now) (See Forms)
  • Popover:
    • Styling looks wrong, but content and location are fine
  • Progress: none in the functionality
    • No way to restore default color from the Type dropdown (This seems to be an ember-power-select issue)
    • TODO: Dependencies between options should be enforced on the form
  • Tabs
    • Dropdown for grouped tabs doesn't work
    • Not sure if custom tabs are working correctly
  • Tooltip
    • Tooltips have no arrows
    • Clicking on one of the first four tooltips makes it do you can't dismiss the tooltip without toggling the clickable tooltip

Additional:

  • Move BS4-specific component docs to base
  • Add tests for responsive breakpoints

@simonihmig
Copy link
Contributor

Hey @srvance, thanks for tackling this!

I am just wondering if looking at the demo app is the best way to approach this. I think it is still to coupled to BS3, as it is just meant to drive the docs site. Given that, I think that we might get too many "false positives" when looking at it for visual issues?

Shouldn't we just compare the rendered output of the (BS4) component and compare that to the markup the BS docs site suggests, and see if there is some mismatch?

@srvance
Copy link
Contributor Author

srvance commented Aug 13, 2017

I've had good results in the past running the demo app with BOOTSTRAPVERSION=4 ember s to try things out. I'll take the approach you suggest, as well.

So far, I'm wondering if the docs have completely caught up with the implementation and how much of the implementation was moved into the js. For example, see the first bullet here and note that there is a lot of raw styling appearing now when you toggle a dropdown in the BS docs.

Anyway, this may take awhile. The changes are significant. I'm just starting the investigation. Any findings at this point should be taken as tentative. 😄

@srvance
Copy link
Contributor Author

srvance commented Aug 14, 2017

@simonihmig It appears that things like dropups, popovers, and tooltips are now being handled by Popper.js, which injects styling directly onto the element. There's an ember-popper, still in alpha, that we could use for the same effect. It seems BS4 has delegated that part of the styling, though, only using Popper to manage it. I filed twbs/bootstrap#23399 to see if I'm missing something.

@simonihmig
Copy link
Contributor

@srvance What kind of styling do you see managed by popper.js? I just had a look, and it seems to me this is just limited to positioning things. So e.g. for popovers and tooltips this are similar CSS props like top or left but now managed by popper.js instead of an own implementation as it was for BS3 (Btw, for 4-alpha seems this was managed by tether.js). For Dropdowns it seems to be indeed substantially different, as it required now some inline style attribute, whereas before this was just limited to applying classes.

@srvance
Copy link
Contributor Author

srvance commented Aug 14, 2017

Definitely positioning styling, but also something complicated to replicate. What do you think of bringing in ember-popper to bridge the gap and helping to bring it to release? Or would you rather just bring popper.js in directly?

@jfrux
Copy link
Contributor

jfrux commented Aug 17, 2017

Accordion seems to be wrong, the checklist says there are no changes but card-block is not the class for accordion body. It's card-body now. Otherwise, padding is lost on the left and right.

This is true for a lot of class names across the system, it's pretty significant from my knowledge from alpha6.

@srvance
Copy link
Contributor Author

srvance commented Aug 17, 2017

Thanks for the sharp eye, @joshuairl! Let me know if you see anything else.

@srvance
Copy link
Contributor Author

srvance commented Aug 19, 2017

Fixes #421

@srvance
Copy link
Contributor Author

srvance commented Aug 19, 2017

@simonihmig Two things:

  1. Would you mind looking at the form spacing issue mentioned above? See the comment for some analysis.
  2. How do you feel about a dependency on ember-popper to have the same behavior as BS4?

}
}),

appliedType: 'light',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this separate property needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type is used by the TypeClass mixin and I needed somewhere to store the value while giving it a default value. I got tired of wonder why the hamburger menu didn't show when running the demo app in BS4. It's bitten me three times already. It's because it sets type to undefined if the checkbox is unchecked. Perhaps I shouldn't override the use of default, though. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing something, but can't you just return a literal 'light' in the CP's getter, and remove the this.set call in the setter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my first approach, but I needed the setter to redirect the set anyway. I'll look at it again and see if it can be reduced or simplified.

@simonihmig
Copy link
Contributor

Would you mind looking at the form spacing issue mentioned above? See the comment for some analysis.

Sorry, but which comment are you referring to? Might be missing something...

How do you feel about a dependency on ember-popper to have the same behavior as BS4?

Yeah, sorry for the late feedback on that topic... I think that is acceptable. popper.js itself and the ember addon seem solid, tested, small. The addon also supports older Ember versions (even 1.11+), popper is tested for all browsers, including IE10+ (don't know about IE9).

Some questions though:

  • should this be used only for BS4 components, while the BS3 still relies on our own proprietary code? In that case we should make sure to not add bloat, like adding popper for BS3, or shipping our BS3-positioning code for BS4.
  • Or we could refactor also the BS3 implementations to drop our custom positioning code and delegate to popper. I guess that would be ok, as long as it positions things the same way it is expected for BS3

@srvance
Copy link
Contributor Author

srvance commented Aug 19, 2017

which comment are you referring to?

Yeah, I was a little vague. In the todo list above, the comment about spacing next to the "Forms" sub-item.

@srvance
Copy link
Contributor Author

srvance commented Aug 19, 2017

re popper, let me see if we can use it for both and reduce the code.

@simonihmig
Copy link
Contributor

Towards inline form spacing: that's hard with our current API. I wouldn't like to have to introduce some very explicit properties like inlineLabelSpacing or inlineControlSpacing. On the other hand we don't expose the things like labels and control elements as contextual components with our current API. Would that be the case users could just apply simple assignments like {{el.label class="mb-2 mr-sm-2 mb-sm-0"}} which seems much better to me than introducing just another layer of complexity.

I would tend to "postpone" this for now. I don't know but I actually never used inline forms, and if you do need them, you can still implement them with your own custom markup, nobody forces you to use those form.element. One of their stronger points is the markup generation for validation, and I have so far not seen any example of custom validation (not the HTML5 built-in) in an inline form. So maybe it makes more sense to as I said postpone this for now and come up with some different/additional form API that gives you more control over the markup? Somewhat related to #249 I guess?

What do you think?

Regarding the popper thing, If you want me to help or take this over (like exploring using that as the replacement for our existing BS3-based custom positioning), just say so. You should not think that you are obliged to work on all this upcoming BS4 stuff exclusively! 😉

@srvance
Copy link
Contributor Author

srvance commented Aug 21, 2017

I'm fine deferring the spacing. Inline forms are mostly what's used in the demo app for the meta-controls, which is where this becomes apparent. We should probably just add some spacing there if we want to support it in BS4.

I won't have much time to look into popper until next weekend. Feel free to look into it if you want. That will cover a large amount of what's left.

How do you feel about a compatible API change for the dropdown toggle?

@basz
Copy link
Contributor

basz commented Sep 21, 2017

hio, i don't think it is possible at the moment (bs4-beta branch) to use a navbar-expand class on navbars. So no extension to avoid breaking al together

from https://getbootstrap.com/docs/4.0/components/navbar/

"Navbars require a wrapping .navbar with .navbar-expand{-sm|-md|-lg|-xl} for responsive collapsing and color scheme classes."

@simonihmig
Copy link
Contributor

@srvance I merged #437, so this can be rebased to master to bring in the new popper integration.

Do you want to continue work on this, or should I tackle the remaining tooltip, popover and dropdown issues, given they are related to this popper integration? (I'm ok with both)

@sdhull
Copy link
Contributor

sdhull commented Oct 2, 2017

Not sure if this is being tracked and I just didn't see an item for it, but BS4 significantly changes how form validation errors are displayed. For instance, .has-danger class does nothing now.

And on an ease-of-use note, it would be awesome if errors added to a model (eg model.errors.attributeName) by ember-data were simply displayed by default.

@srvance
Copy link
Contributor Author

srvance commented Nov 2, 2017

Other than the test failure, no. The remaining checklist items can be follow on. I don't think the dropdown toggle is an API change.

@bgentry
Copy link
Contributor

bgentry commented Nov 3, 2017

I'm getting errors on this branch when I hover over an item that has a tooltip. I suspect it's related to ember-popper changes?

@srvance
Copy link
Contributor Author

srvance commented Nov 5, 2017

@simonihmig I'm finding my time is more limited than anticipated right now. Unless you see a showstopper, let's track outstanding issues separately and merge this. I'll let you make the final call on the right timing for this, but I think it's ready for broader use.

@simonihmig
Copy link
Contributor

@srvance no problem at all! Agree, will merge this soon. There will be some more -rc.x releases I guess before hitting 1.0, so we will be able to iterate an BS4 support when problems arise.

@bgentry can you please elaborate, what errors exactly do you see? (there was an ember-popper issue with IE11 fixed recently, but I guess that's not what you are referring to?)

@bgentry
Copy link
Contributor

bgentry commented Nov 5, 2017

@simonihmig just tried this again, looks like another ember-popper update fixed the errors (e06ee9a) 👍

@simonihmig
Copy link
Contributor

@bgentry Oh, that's great! Thanks for the super quick feedback!!!

@simonihmig simonihmig merged commit 061eb87 into master Nov 7, 2017
@srvance
Copy link
Contributor Author

srvance commented Nov 8, 2017

🎉 ❗️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants