CakePHP-Bootstrap / cakephp3-bootstrap-helpers

CakePHP 3.x Helpers for Bootstrap 3 and 4.
https://holt59.github.io/cakephp3-bootstrap-helpers/
MIT License
130 stars 79 forks source link

Combatible with cake php v4.1 #194

Open hkosmidi opened 3 years ago

hkosmidi commented 3 years ago

This is a (multiple allowed):

What you did

I used your plugin with cake php v4.1 but got several errors

What happened

Some functions didn't have proper return type in deceleration and yield errors

What you expected to happen

I have updated the function calls in 2 commits. Could you please check if they are ok. Is there way to merge in your codebase so to use your plugin through composer? https://github.com/hkosmidi/cakephp3-bootstrap-helpers/commit/9c48d6591bc9f47a2bba4313a8a272d718f593a9 https://github.com/hkosmidi/cakephp3-bootstrap-helpers/commit/3ba820d2e923f28472e51b42be71fedf9cc5c26c

Erwane commented 3 years ago

did you try this branch ? https://github.com/Holt59/cakephp3-bootstrap-helpers/tree/cake4-bs4-1.0.0 But it is for bootstrap 4.

hkosmidi commented 3 years ago

No I haven't. I use bootstrap 3 for now

Erwane commented 3 years ago

can you make a PR ? with tests ? or i can do it if you prefer

hkosmidi commented 3 years ago

Sorry I have not made any test, I just added the appropriate return types in functions. Feel free of course to merge them if you think the commits are correct

Holt59 commented 3 years ago

I've created https://github.com/Holt59/cakephp3-bootstrap-helpers/tree/cake4-bs3-1.0.0 with your two commits. This is 100% untested, I've only cherry-picked your two commits.

You can require it using "holt59/cakephp3-bootstrap-helpers": "dev-cake4-bs3-1.0.0".

Erwane commented 3 years ago

I'm trying different notations for this project but i don't know how to maintain 4 versions with comprehensive tags.

one way is 4 branches (cakeX-bsY) with tag attached like this : 4.3.1 is cake4-bs3 version 1. The risk is a "^4.3" dependency in composer.json apps and the require should be ~4.3.0 to load cake4-bs3 and all fixes

One alternative is tag 43.0.0 for cake4-bs3, 44.0.0 for cake4-bs4 and write documentation to require ^43.0

Holt59 commented 3 years ago

I've been thinking about it, and there are multiple issues... I think the best option would be to fork this to a cakephp4-bootstrap-helpers.

We could keep all development here, in custom branch names such as the ones we are using, and only push tags to the cakephp4- repository so there is no issue with composer.

Erwane commented 3 years ago

Ok, looks better but what about bootstrap versions ? version 3.xx for bs3 and 4.xx for bs4 ? Bootstrap 5 is in beta

Holt59 commented 3 years ago

Yes, 3.x.x for bs3, 4.x.x for bs4, etc. It's what's already done.

Erwane commented 3 years ago

So here, you keep branches : cake3-bs3, cake4-bs3n cake4-bs4, etc etc maintain tags for cakephp3 with bootstrap 3 and 4 in 3.x.y and 4.x.y And push the dev in cake4-bsX branches to new repository cakephp4-bootstrap-helpers with tags 3.x and 4.x for bootstrap versions ?

No PR in the cake4-bootstrap-helpers repository ? This part sound weird. Logic is to keep cake4 dev in this new repository, and push fixes from cake3 to cake4 no ?

Holt59 commented 3 years ago

Well, I'd say its a preference choice, I don't really mind:

We could completely separate development and only cherry-pick when needed.

I've created the Cake 4 repository and registered it on packagist: https://github.com/Holt59/cakephp4-bootstrap-helpers (the v3.0.0 and v4.0.0 corresponds to the cake4-bs3 and cake4-bs4 branches here).

I've also added you as collaborator to both repository so you should receive an invite.

Erwane commented 3 years ago

Thanks, i will check that. Why v3.0.0 ? you plan to use one branch by fix ? maybe branch v3.x and tags v3.0.0 for versions ?

Holt59 commented 3 years ago

Because that's what it was called here :) But it should be v3.0.x and we should have a v3.x branch:

I'll remove master and set the v4.x as master for Cake 4 and v3.x as master for Cake 3 — Or I could set v4.x as master for both.

hkosmidi commented 3 years ago

I also added this commit https://github.com/hkosmidi/cakephp3-bootstrap-helpers/commit/8b0d5db39c7b6c6c7a3065d13a8aaf203bc02b5a in order for DateTimeWidget to play along. Hope this helps

Erwane commented 3 years ago

The cake4 support will be moved to this repository. https://github.com/Holt59/cakephp4-bootstrap-helpers And this PR should fix Helpers initialization https://github.com/Holt59/cakephp4-bootstrap-helpers/pull/3

Waiting for @Holt59