bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

refactor(): Support bootstrap 3.0

Open lichtner opened this issue 13 years ago • 105 comments

Hi guys, thanks for your nice work. I would like to ask you when do you start support bootstrap 3.0. Some directives work some don't. E.g. modal doesn't work.

I am developing new app but for me (IMHO for many other developers too) is better to start to build new project on BS3 WIP version because I hope it come sooner then I finish my app.

I would like to propose create BS3 branch now and start to modify directives for it.

What do you think about it?

lichtner avatar Apr 17 '13 13:04 lichtner

Are there that many changes to the HTML?

jhiemer avatar Apr 17 '13 13:04 jhiemer

Some changes are in HTML e.g. in modal and I think it will be impossible support BS 2.3.1 and BS 3.0 in one branch. But I am beginner with angular may be it will be possible, I don't know...

E.g. modal looks like this:

<div class="modal">
  <!-- Button trigger modal -->
  <a data-toggle="modal" href="#myModal" class="btn btn-primary btn-large">Launch demo modal</a>

  <!-- Modal -->
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Modal title</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <a href="#" class="btn">Close</a>
        <a href="#" class="btn btn-primary">Save changes</a>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dalog -->
</div><!-- /.modal -->

lichtner avatar Apr 17 '13 13:04 lichtner

Indeed, the markup changed slightly. Then @angular-ui must decide whether to branch or not to branch. :-)

jhiemer avatar Apr 17 '13 13:04 jhiemer

@lichtner @jhiemer starting work on Bootstrap 3.0 would be awesome but we are still figuring out API exposed to templates so there would be significant maintenance overhead. Also demo pages would have to be updated.

We are trying to fix existing bugs and stabilize APIs but if someone would be willing to give us a hand and work on migration to 3.0 this would be awesome. BTW, do you guys know what is the target date for the BS 3.0 release?

pkozlowski-opensource avatar Apr 20 '13 19:04 pkozlowski-opensource

@pkozlowski-opensource I have honestly no idea when it will be released. I searched for it, but I could not find any valuable information...

jhiemer avatar Apr 21 '13 10:04 jhiemer

@pkozlowski-opensource @jhiemer They are currently at 94% completion to release: https://github.com/twitter/bootstrap/issues/milestones

I stumbled on this thread while searching for angular-bootstrap migration plans from 2.3 too 3.0.

gigablox avatar Apr 28 '13 21:04 gigablox

@pkozlowski-opensource This might be a noobish question but is Twitter Bootstrap v3 CSS independent of JS version? That is --- can we use the old 2.3 JS directives with the new v3 CSS?

This way --- at least people wont have to rework div structure in their apps when it comres time to update 3.0 directives.

I also threw this question up on stack if anyones after creds O_o http://stackoverflow.com/questions/16327846/is-twitter-bootstrap-v3-css-independent-of-js-version

gigablox avatar May 02 '13 13:05 gigablox

@gigablox answered on SO, here is the answer for ones that will stumble upon this question here:

So, the http://angular-ui.github.io/bootstrap/ project does not depend on Bootstrap's JavaScript (it is not wrapping it, not requiring etc.). Those are native AngularJS directives written from the ground-up to be lightweight and well integrated into the AngularJS ecosystem.

The only adherence to the Bootstrap project is Bootstrap's markup (HTML) and CSS.

If you ask a question "can I grab all the directives and use them with Bootstrap 3.0" the answer is "it depends". It really depends if and how much Bootstrap 3.0 decide do change its markup and corresponding CSS classes. I would presume that markup of some controls have changed and not for some others.

Now, the very good news with http://angular-ui.github.io/bootstrap/ is that most of the HTML markup and CSS classes are encapsulated in separate AngularJS templates. In practice it means that you can grab the JavaScript code of the directives and only change markup (templates) to fit into Bootstrap 3.0.

All the templates are located here: https://github.com/angular-ui/bootstrap/tree/master/template and by browsing them you should get an idea that it is pretty simple to update markup without messing with JavaScript. This is one of the design goals of this project.

I would encourage you to simply give it a try and see how CSS of Bootstrap 3.0 works with the existing directives and templates. If you spot any issues you can always update templates to Bootstrap 3.0 (and contribute them back to the project!)

pkozlowski-opensource avatar May 02 '13 17:05 pkozlowski-opensource

to have modal worked, add hide class to set display:none to modal and reset the modal's display to block

29x10 avatar Jul 17 '13 11:07 29x10

Bootstrap 3 RC1 has been released. http://blog.getbootstrap.com/2013/07/27/bootstrap-3-rc1/

ojraqueno avatar Jul 28 '13 02:07 ojraqueno

In addition to Bootstrap 3 RC1 being released, it is also now being hosted as the "main" version on the Bootstrap homepage, I would imagine that the uptake in BS3 will be pretty rapid now that they've done that. If anyone needs any help converting templates, give me a shout and I'll throw my shovel in.

Siyfion avatar Jul 29 '13 08:07 Siyfion

Also worth noting, they have removed the Bootstrap Typeahead control entirely, replacing it with support for the Twitter Typeahead control, twitter/bootstrap@88dd9de and http://twitter.github.io/typeahead.js/ .

I'd created an incredibly simple directive to wrap the twitter typeahead a while back, https://github.com/Siyfion/angular-typeahead if anyone is interested in adding functionality to it or making some suggestions.

Siyfion avatar Jul 29 '13 08:07 Siyfion

@Siyfion based on project's philosophy outlined here: we don't want to have dependencies on 3rd party JavaScript in this project. And I would be very cautious about simply wrapping typeahead.js as an AngularJS directive. Typeahead.js is duplicating tons of services already available in AngularJS (communication with a backend, caching etc.). It is a big library.

The typeahead directive in this repo is a superset of the original Bootstrap's typeahead. I think it already has most (if not all) functionality of the typeahead,js. Is there anything you've got in typeahead.js and missing from a irective in this repo?

pkozlowski-opensource avatar Jul 29 '13 11:07 pkozlowski-opensource

@pkozlowski-opensource No, in all honesty, nothing is missing from the current angular-bootstrap implementation; hence why I'm not using my own wrapper at the moment. I just assumed that Bootstrap's removal of support for it may lead this library to also remove it?

Siyfion avatar Jul 29 '13 11:07 Siyfion

@Siyfion no, we don't have plans of removing the typeahead directive from this repo. For me the version in this repo is closer to the typeahead.js than to anything else. So no, it is not going away :-)

pkozlowski-opensource avatar Jul 29 '13 11:07 pkozlowski-opensource

@pkozlowski-opensource good to know! Figured out a branching strategy for BS3 code yet? I'd really like to get started on modifying those templates! :smile:

Siyfion avatar Jul 29 '13 12:07 Siyfion

AFAIK, 3.0 add some changes to modal's css and collapse' css, make those behavior not working, had to keep 2.3's css style to make it working

29x10 avatar Jul 29 '13 13:07 29x10

@luthur Can confirm collapse broke. Glyphicons were ported to another repo https://github.com/twbs/bootstrap-glyphicons as well so any of them styled inline with templates dissapeared.

gigablox avatar Jul 29 '13 15:07 gigablox

@gigablox https://github.com/twbs/bootstrap/issues/8499

29x10 avatar Jul 29 '13 22:07 29x10

As far as collapse, an alternative is looking at angular-ui ui-utils Show/Hide/Toggle option - http://angular-ui.github.io/ui-utils (you lose the animation effect however)

joshuawoodward avatar Jul 31 '13 21:07 joshuawoodward