yiisoft / yii2-bootstrap

Yii 2 Bootstrap 3 Extension
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
185 stars 193 forks source link

Upgrade to bootstrap 4 #77

Closed samdark closed 5 years ago

kathysledge commented 9 years ago

How about creating a seperate repo yii2-bootstrap4, which developers can specify in composer.json?

cebe commented 9 years ago

not sure this is needed, we have bootstrap extension 2.0.x branch for bootstrap 3 and go with bootstrap 4 in 2.1.

freezy-sk commented 9 years ago

@cebe I think that upgrade to Bootstrap 4 should bump package version to 3.0.0

cebe commented 9 years ago

would be good if you both could cover your suggestions with arguments :)

freezy-sk commented 9 years ago

@cebe My suggestion is based on simple semantic versioning. Bootstrap 3 will be still alive, so if they change something in that branch, 2.x.y is here to reflect all that changes. Bootstrap 4 is refactored with so many breaking changes that 3.0.0 of this package should be nice starting point for maintaining all new features which will be introduced during B4 lifecycle.

cebe commented 9 years ago

Yii does not follow semantic versioning, so 2.1 can break BC. For patch releases we do not distinguish between bugs and features. See https://github.com/yiisoft/yii2/blob/master/docs/internals/versions.md#yii-versioning

freezy-sk commented 9 years ago

@cebe Yes, I know how is versioned main framework repository, but I still think that it's much more clearer if this package will be incremented to 3.0.0. instead of 2.1.0 because it's like whole new package. It will be also easier to maintain 2.x.y branch with new features and bugfixes for B3 (and users which can't easy upgrade frontend of their projects) and 3.x.y will be for B4.

kathysledge commented 9 years ago

It's just that Yii 2 has been all about seamless integration with Bootstrap. There's not enough added value (flexbox may be useful?) to update all our components to the new ones. In addition, our theme is heavily customized with Less, and these would all have to be re-written. Yii 2.1 is still Yii 2, and should be a few minute refactor to upgrade, not an entire re-write of our views. When Bs4 is actually launched, users of 2.0 or 2.1 can have the option of specifying it in composer.json, and use the new widgets.

Alternatively, rename this repo to yii2-bootstrap3 and have that override yii2-bootstrap (which is now Bs4).

Sammaye commented 9 years ago

LESS and SASS are very similar you won't find much rewriting to be done.

BS4 will be really good, especially in better dealing with responsive typography after the IE8 drop, finally we will actually be able to natively have real responsive typography in BS instead of using breakpoints on certain headers etc.

Looking at first glance the components don't look like they have been massively rewritten on the frontend, they still use the same classes in most places. Most of BS4 is on the backend. They keep saying about this grid tier for better mobile handling (which would be awesome, I did this manually) but all I see is the BS3 grid tiers so I don't think the docs are even truly documenting what they have done yet.

niefufeng commented 9 years ago

唔,相当期待bootstrap4

pasci84 commented 9 years ago

I wouldn't bind Yii to a fixed version of bootstrap as others (eg Joomla) do. As @df2 stated it would be very clean if there were two repos each extending Yii with a bootstrap-version. That way they could be maintained independently and the 3-version dropped at some point. Also the planning of the yii-repos allows this, as bootstrap is not in the core but in its own repo. Yes, there would be some duplication of code as the bootstrap versions are semantically close, but the gain for devs and admins would be huge...

Conclusion: I totally agree with the idea to specify this in the json-file. Default should be bs4 and optionally we could change it back to bs3 and be sure that everything runs fine the way it was before.

Sammaye commented 9 years ago

+1 ideally we rename this repo to yii2-bottstrap3 and make a new yii2-bootstrap4 repo

realtebo commented 9 years ago

Please, duplicated yii2-bootstrap as -3 and -4, and, please again, release an 'alpha' version ASAP.

Move a COMPLEX webapp from 2.0.x to 2.1 AND from BS3 to BS4 is NOT a easy task in a lot of real world applications, with a lot of custom widgets and extensions. We need to do extensive alpha-work and testing on each our apps

lukos commented 8 years ago

Like others have said, many existing projects are using yii-bootstrap version "*". If you upgrade the project without renaming it, anyone running composer update on an existing project will suddenly cause a lot of breakage and might not know why - I think lots of questions will appear on the forums.

I can't see any reason not to create a yii-bootstrap4 project (easier to understand than yii-bootstrap3!) and keep them both separate.

YasserHassan commented 8 years ago

Bootstrap version in a project is determined by other components besides the framework such as the template and jQuery extensions used. Developers should be able to decide the time to move from BS 3 to 4 in the time they see fit. They might be held back from upgrading because one or more of those components have not yet adopted BS4. That's why being able to decide which BS version to use with the framework and changing that at any time (even to downgrade from v4 to v3 later for any reason) would be very important. Specifying BS version in composer.json is probably the best way to go.

jacmoe commented 8 years ago

I can't see any reason why you shouldn't upgrade to Bootstrap 4 because the code is much cleaner and it is easier to customize because they reorganized and unnested the css structure quite a bit. Moving from Less to Sass might be daunting, but you will be powerful. I expect rapid adoption all over the board.

YasserHassan commented 8 years ago

@jacmoe there would be no reason to upgrade to Bootstrap 4 in a stable system if it does not provide an added value. The upgrade will require work to implement, test, and adjust. And before that you need to make sure that each and every component you use (e.g. Select2) has upgraded to BS4 and it's Yii2 package is upgraded to the component's new version too. It could be better for some businesses to spend that time and effort in adding new features to their system and they should be able to select the upgrade time best suiting their situation.

jacmoe commented 8 years ago

If that stable system is going to be maintained for the foreseeable future then I think moving from Less to Sass would help tremendously in keeping the code modular and manageable, and - from what I've seen - Bootstrap 4 doesn't change that much interface-wise. It just becomes leaner and much easier to extend/override. I think that would result in more time to make an effort in adding new features. :) But let's see. I am stoked and predict rapid adoption!

jacmoe commented 8 years ago

So what I am saying is that it definitely has added value. :)

jacmoe commented 8 years ago

One last note which - I hope - demonstrates the benefits of upgrading:

http://v4-alpha.getbootstrap.com/layout/grid/#example-usage

Mixins!

Instead of having Yii2-bootstrap use col-md-3 and other specific classes it could now use semantic classes instead.

.container {
  max-width: 60em;
  @include make-container();
}
.row {
  @include make-row();
}
.content-main {
  @include make-col();

  @media (max-width: 32em) {
    @include make-col-span(6);
  }
  @media (min-width: 32.1em) {
    @include make-col-span(8);
  }
}
.content-secondary {
  @include make-col();

  @media (max-width: 32em) {
    @include make-col-span(6);
  }
  @media (min-width: 32.1em) {
    @include make-col-span(4);
  }
}

If the layout changes then - instead of performing a mass-edit all across the project - all it takes is a simple change in one file. And it would also mean that yii2-bootstrap could be used with Zurb Foundation as well, just by changing the grid/layout mixins :)

YasserHassan commented 8 years ago

Not everyone needs to do that and if they do, not everyone needs to do it now. My comment was not about arguing the new version's technical benefits but rather about putting the project owners in control and letting them decide what and when and if they perform that upgrade according to to their project circumstances and priorities.

craigpotter commented 8 years ago

Would like too see a way to use Bootstrap 4 with Yii2 We got a project planned to go live mid year. Seems a bit pointless developing this with bootstrap 3.x at the moment as we will need to rewrite it all for live to use BS 4.

I know Bs4 is still in Beta but I think people should be given a chance to use it at their own risks. BS make it clear not to use it for production. If Yii2 also did the same. I don't think their will be an issue.

kop commented 8 years ago

+1 to the @craigpotter message. I'm having a new project too and I believe that it does not have much sense to start with 3.x branch. Some option to use BS4 would be really cool.

dillix commented 8 years ago

I also want to start new project with BS4 support. Is there any news about yii-bs4 branch?

marnap89 commented 8 years ago

Is there any news about yii-bs4 branch?

I ask the same question :)

samdark commented 8 years ago

No. Noone touched it.

alanwillms commented 8 years ago

@samdark people can start working on it as soon as you decide how to handle the version name.

samdark commented 8 years ago

I'd handle it via branch i.e.:

  1. Create 2.0 branch from current code. Bugfixes for 2.0.x will be there.
  2. master will hold BS4 version. Tags will be 3.0.x.
cebe commented 8 years ago

@alanwillms you can start working on it and send a pull request, we will handle branching then.

dillix commented 8 years ago

Great news!

mikehaertl commented 8 years ago

To chime in on the discussion: Whatever decision is made, developers should have free choice. Like:

I'm also tending towards moving things to another repo like yii2-boostrap4. This would show that Yii acts very carefully and tries to avoid messing up existing setups by any means. Because I agree to what @lukos said above: developers may have "yiisoft/yii2-bootstrap": "*" in their composer.json and may upgrade to Bs4 by accident.

It would also make it very clear that it's BS4. Something that is not obvious from "2.1.x".

What exactly is the advantage of keeping everything in one repo?

cebe commented 8 years ago

What exactly is the advantage of keeping everything in one repo?

the bootstrap4 compatible code of this extension is only a slight modification of bootstrap3 compatible code, so it would rather be a new version than a completely new repo.

Sammaye commented 8 years ago

Problem to making a new veersion is BS4 gets rid of IE8 support

On 24 May 2016 at 14:25, Carsten Brandt notifications@github.com wrote:

What exactly is the advantage of keeping everything in one repo?

the bootstrap4 compatible code of this extension is only a slight modification of bootstrap3 compatible code, so it would rather be a new version than a completely new repo.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/yiisoft/yii2-bootstrap/issues/77#issuecomment-221267233

craigpotter commented 8 years ago

I don't see the problem with making it a new version.... If you don't want to use bootstrap 4, don't use "yiisoft/yii2-bootstrap": "*" in composer.

Lock in the BS3 version.

I guess this was the whole point of moving this away from the core so people could do this.

Sammaye commented 8 years ago

Well, I guess so long as we make one major version BS3 and then all after BS4 is would work (thinking of updates)

On 24 May 2016 at 15:11, Craig Potter notifications@github.com wrote:

I don't see the problem with making it a new version.... If you don't want to use bootstrap 4, don't use "yiisoft/yii2-bootstrap": "*" in composer.

Lock in the BS3 version.

I guess this was the whole point of moving this away from the core so people could do this.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/yiisoft/yii2-bootstrap/issues/77#issuecomment-221283381

justinvoelker commented 8 years ago

I agree with @craigpotter about keeping it in the same repo. If someone wants to stay on BS3, they should not use "yiisoft/yii2-bootstrap": "*" in composer.

That said, since that is the default in a new install of Yii, is there anything in a stock Yii install that would break if the repo were updated to BS4? Projects whose views have not been changed from the Gii-generated pages should not require changing after the repo moves to BS4. This allows all of the projects with the default views in place to not require manual editing to make them work with BS4.

To those of us with heavily customized projects, we will A) recognize the need to lock the composer version to BS3 or B) update our projects to use BS4.

mikehaertl commented 8 years ago

If you don't want to use bootstrap 4, don't use "yiisoft/yii2-bootstrap": "*" in composer.

Yes - if you know about this issue and how versions here are matched against Bootstrap. Many developers will not be aware of this. So at least it should be made very clear in the upgrade guide.

craigpotter commented 8 years ago

I don't think that will be a problem.

It could be added to the README.md, also the yii2-bootstrap docs.

I don't think the guys will have an issue also adding a note to the getting started guide as well - http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-via-composer

mikehaertl commented 8 years ago

the bootstrap4 compatible code of this extension is only a slight modification of bootstrap3 compatible code, so it would rather be a new version than a completely new repo.

Still that's not really a reason why everything should be in one repo. This extension is about Bootstrap and Bs3 and Bs4 are two incompatible frameworks, each with different markup.

What if you want to use both, Bs3 + Bs4 in a single project? For example your frontend should be updated to Bs4, while your backend module should stick with Bs3.

With a separate repo (and yii\bootsrap4 namespace) this is easy. All in one repo makes it much harder. I still wonder where exactly is the problem if we have it in a separate repo?

And the argument "we can document the upgrade path" can also be used in the opposite direction: The well informed developer is never a problem. He will read the upgrade guide and know how to get Bs4 if he wants it. The problem is really the uninformed developer: He needs our care and we should not give him a hard time if there's a simple way to avoid it.

craigpotter commented 8 years ago

Using Bs3 & bs4 in a project is an interesting issue.

One thing that crosses my mind though.... Why would you do that?

It sounds like a massive headache trying to support 2 versions.

BS3 isn't accepting new features. Just fixes.

mikehaertl commented 8 years ago

One thing that crosses my mind though.... Why would you do that?

It's not that you want to do that. But large projects often develop their own dynamics. One reason I can think of: You have 2 customized Bs3 versions, one for frontend, one for backend with 1000s of customizations. Then one day management decides, that we need that one cool nifty feature from Bs4 in our frontent - tomorrow!!! If you now can update frontend to Bs4 independently of backend, you can lean back and relax. In the other case you're into serious trouble as you have to update your customized Bs3 backend, too.

craigpotter commented 8 years ago

If you have that level of customisation, it would either be in stylesheets or you won't be using the yii-bootstrap functionally surely ? If they have modified files in the Vendor folder, they are stupid. If they extended the classes, it shouldn't break but I mean its up to the core team how they want to handle it.

If they move BS4 to a new repo, it has the possibility of having to replicate fixes on both repos.

Be interested to here what @samdark or @cebe think.

mikehaertl commented 8 years ago

If they move BS4 to a new repo, it has the possibility of having to replicate fixes on both repos.

That's not so much different from replicating fixes between branches. Also both versions may diverge, because incompatible Bs4 changes may be reflected in the yii2-bootstrap API at some point.

jacmoe commented 8 years ago

If BS4 is the current version of Bootstrap, then bs3 should just be a tag and the project needs to move forward. Alternatively, and probably the best way, a bs3 branch that will receive only critical fixes should be made. And current version of BS for the main branch would be BS4.

If people really have modified Bootstrap, that is their problem. They will hopefully learn from their mistakes.. Den 25/05/2016 14.16 skrev "Michael Härtl" notifications@github.com:

If they move BS4 to a new repo, it has the possibility of having to replicate fixes on both repos.

That's not so much different from replicating fixes between branches. Also both versions may diverge, because incompatible Bs4 changes may be reflected in the yii2-bootstrap API at some point.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/yiisoft/yii2-bootstrap/issues/77#issuecomment-221555906

samdark commented 8 years ago

Agree with @jacmoe and @mikehaertl.

KAMAELUA commented 8 years ago

Can someone explain to me, can I use bs4 now? If so, what I need to do? @samdark @jacmoe

freezy-sk commented 8 years ago

@KAMAELUA just use yii2-bootstrap dev-2.1 which uses Bootstrap 4.0.0.alpha2 but be careful because there are 991 commits since 4.0.0.alpha2 was tagged

ffelaar commented 8 years ago

Need a bit more assistance. I am including in composer.json the line: "yiisoft/yii2-bootstrap": "~2.1", and had to change minimum-stability to dev

I get an error that says :

Problem 1

  • bower-asset/bootstrap dev-master requires bower-asset/jquery >=1.9.1,<=2 -> no matching package found.
  • yiisoft/yii2-bootstrap 2.1.x-dev requires bower-asset/bootstrap dev-default#48938155eb24b4ccdde09426066869504c6dab3c -> satisfiable by bower-asset/bootstrap[dev-master].
  • Installation request for yiisoft/yii2-bootstrap ~2.1 -> satisfiable by yiisoft/yii2-bootstrap[2.1.x-dev].

Please assist - i want to use bootstrap 4.

webstylemedia commented 8 years ago

Hey guys any news? In 2.1 still old bootstrap 3. :-(

cebe commented 8 years ago

should not be: https://github.com/yiisoft/yii2-bootstrap/blob/2.1/composer.json#L22