Web based family history software

Question Breaking code changes

  • magic-sunday
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 8 months ago - 6 years 8 months ago #1 by magic-sunday
Breaking code changes was created by magic-sunday
Hi,

the current master has to many breaking code changes in my opinion. My modules won't work any longer and I didn't know where to look up the required changes to fix them to get them working again. I would be easier if deprecated stuff would be marked as @deprecated and removed in the after next version. This way my IDE would inform me about upcoming changes.

For instance:

- Fisharebest\webtrees\Functions\FunctionsPrint::printFindIndividualLink => removed? How to replace?
- FunctionsEdit::selectEditControl()
- FunctionsEdit::editFieldInteger()
- WT_AUTOCOMPLETE_JS_URL => Whats happend with this?

webtrees, latest dev
Last edit: 6 years 8 months ago by magic-sunday.

Please Log in or Create an account to join the conversation.

  • bertkoor
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
6 years 8 months ago #2 by bertkoor
Replied by bertkoor on topic Breaking code changes
Hi,

Our lead developer said last week he's on a short holiday. I think that the current release v1.7.9 is the last in the 1.7.x series and development has since concentrated on the next release which supposedly is 1.8.0. Don't know whether that's in the Master or Development branch... I think indeed the next release (currently) will break many compatibilities.

If the next version is not fully compatible I'd personally put that in a clearly recognisable named branch and also increase the major version number instead of just the minor version.

So in the current situation, if you're extending on webtrees you're better off selecting a stable base. That would then be the 1.7 branch. Otherwise you're shooting on a moving target.

stamboom.BertKoor.nl runs on webtrees v1.7.13

Please Log in or Create an account to join the conversation.

  • bertkoor
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
6 years 8 months ago #3 by bertkoor
Replied by bertkoor on topic Breaking code changes

magic-sunday wrote: - Fisharebest\webtrees\Functions\FunctionsPrint::printFindIndividualLink => removed? How to replace?
- FunctionsEdit::selectEditControl()
- FunctionsEdit::editFieldInteger()
- WT_AUTOCOMPLETE_JS_URL => Whats happend with this?


This is the "offending" commit: github.com/fisharebest/webtrees/commit/1...d3d9c38d6b133453c5be

GitHub wrote: jQuery-3, Bootstrap-4, FontAwesome-4.7, Select2-4, remove popup windows
fisharebest committed on Mar 7
Showing 1,305 changed files with 30,782 additions and 48,586 deletions.


Yeah, that's one big refactoring commit...

stamboom.BertKoor.nl runs on webtrees v1.7.13

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #4 by fisharebest
Replied by fisharebest on topic Breaking code changes
> eah, that's one big refactoring commit...

Well, there are lots of changes!

* dropping support for PHP 5.3-5.5
* gaining support for PHP 7.1
* replacing old / unmaintained PHP libraries with newer ones
* replacing old CSS/JS libraries with newer ones
* redesigning the user interface to avoid popup windows, and work on tablet/touchscreen devices

Why only a minor version bump (1.7 -> 1.8) and not a major one (1.8 - 2.0)? Well, there are no significant changes to the user functionality - it's mostly just a technology upgrade.

Maybe all this is worth a 2.0 label? I don't really have a strong opinion. It's easy to change 1.8-dev to 2.0. It's hard to change 2.0-dev to 1.8.

There are currently no DB changes. I want to add support for multiple media files within each media object. This will require a DB change, but it might not happen until the subsequent release.

> Fisharebest\webtrees\Functions\FunctionsPrint::printFindIndividualLink => removed? How to replace?

The "find" buttons opened popup windows with a search box. We have combined this with the auto-complete using the "select2" library. Note that this is not yet complete. Eventually, we'll have more information shown in the results list, and it will have prettier formatting.

> FunctionsEdit::selectEditControl()

Replaced with Bootstrap4::select()
The only significant difference is that if you want an "empty/null" option, you have to include it in the options list, rather than specifying it as a parameter.

Ignore Bootstrap4::multiSelect(). It is about to disappear.

> WT_AUTOCOMPLETE_JS_URL => Whats happend with this?

Just give your edit control a suitable data attribute. e.g. <input data-autocomplete-type="PLAC" name="place">

If you are adding elements dynamically (e.g. using JS, after the page has loaded), then you'll need to initialise them with a JS call to autocomplete("#element_id");

Things might change before the final release, but hopefully not too much.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • makitso
  • Away
  • Administrator
  • Administrator
More
6 years 8 months ago #5 by makitso
Replied by makitso on topic Breaking code changes
> Why only a minor version bump (1.7 -> 1.8) and not a major one
> Maybe all this is worth a 2.0 label? I don't really have a strong opinion.

Greg, my 2 cents would be for a 2.0 label. With all the UI changes its going to be a major change for people.

Rob
www.skatekey.net ( webtrees 2.1 beta GitHub)
webtrees forum admin
PHP 8.1.21
Hosted at tigertech.net

Please Log in or Create an account to join the conversation.

  • bertkoor
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
6 years 8 months ago #6 by bertkoor
Replied by bertkoor on topic Breaking code changes

fisharebest wrote: it's mostly just a technology upgrade.


If that means all the old 3rd party themes & modules won't work anymore, that's a very major break in compatibility, and thus imho deserves a Major version bump.

stamboom.BertKoor.nl runs on webtrees v1.7.13

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #7 by JustCarmen
Replied by JustCarmen on topic Breaking code changes

If that means all the old 3rd party themes & modules won't work anymore, that's a very major break in compatibility, and thus imho deserves a Major version bump.


Agreed. You are right that none of the custom modules and themes will work out of the box after release. I am working hard to keep up with the changes. My modules work in the latest dev but people must be aware of the fact that every custom module and custom theme needs to be upgraded after release otherwise the site will break down. So I think this is a major change and so a major version bump is justified.


Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2


Check my website at www.justcarmen.nl

Please Log in or Create an account to join the conversation.

  • magic-sunday
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 8 months ago #8 by magic-sunday
Replied by magic-sunday on topic Breaking code changes
What I mean, it would be easier for development if a deprecated method won't be removed right now but rather it should be market as deprecated and removed in the after next version:
Code:
/** * @deprecated Will be removed in 1.9, Please use Bootstrap4::select */ public static function selectEditControl($name, $values, $empty, $selected, $extra = '') { if (!empty($empty)) { $values = ['' => $empty] + $values; } return Bootstrap4::select( $values, $selected, [ 'name' => $name, ] ); }

webtrees, latest dev

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago - 6 years 8 months ago #9 by JustCarmen
Replied by JustCarmen on topic Breaking code changes

What I mean, it would be easier for development if a deprecated method won't be removed right now but rather it should be market as deprecated and removed in the after next version:


That may sound like a good practice but it would also make major changes more complicated and will lead to messy code. And I personally don't see the benefit. When I look at the current development then it started somewhere around december/january I think. Following development these months gives me plenty of time to implement the changes into my modules. The only insecure factor is that I don't know when the next release is planned (and I doubt if Greg knows it at this stage of development). So as developers of custom themes and modules we might run into the situation that the release comes earlier than expected and we are not ready to release our modules. But so be it. People have a choice to wait with the upgrade of the webtrees release until their favorite module is ready or upgrade anyway and disable the module for the time being.

Making a function deprecate and remove it after the next release might lead to the same situation when you have not updated your module on time.


Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2


Check my website at www.justcarmen.nl
Last edit: 6 years 8 months ago by JustCarmen.

Please Log in or Create an account to join the conversation.

  • magic-sunday
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 8 months ago - 6 years 8 months ago #10 by magic-sunday
Replied by magic-sunday on topic Breaking code changes

but it would also make major changes more complicated and will lead to messy code


Why should this be more complicated or will lead to messy code? Each deprecated function will exists for instance for one/two/three minor versions. Given the developers enought time to change their code.

Benefits:
- Developer IDE warns you about deprecated function use
- Developer will know how to fix his extension, as the deprecated function normally will contain the code to replace or a hint what should be used instead
- No big code breaks
- If someone won't update an extension, you could easilier return to a previous version containing the deprecated functions and refactor your code.

Currently I don't have much time to analyse each line of changed code, to see if it may concern my extensions.

webtrees, latest dev
Last edit: 6 years 8 months ago by magic-sunday.

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago #11 by JustCarmen
Replied by JustCarmen on topic Breaking code changes

Currently I don't have much time to analyse each line of changed code, to see if it may concern my extensions.


I don't have either. But I do check from time to time if a module is still working in the latest dev. If not, mosts of the time it is clear where it breaks so I can change that part.


Carmen
Designer of the JustLight theme (comes with a light and dark color palette), Fancy Imagebar, Fancy Research Links and Fancy Treeview for webtrees 2


Check my website at www.justcarmen.nl

Please Log in or Create an account to join the conversation.

More
6 years 8 months ago - 6 years 8 months ago #12 by kiwi
Replied by kiwi on topic Breaking code changes

magic-sunday wrote: Given the developers enought time to change their code.


You're missing one important fact, or ignoring it. There is no team of developers working on this. There is (in all practical terms) only one.

So why if you have little time do you assume he has more?

With only one developer all your "benefits" are a bit pointless - he knows what he's changed.
Last edit: 6 years 8 months ago by kiwi.

Please Log in or Create an account to join the conversation.

  • magic-sunday
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 8 months ago #13 by magic-sunday
Replied by magic-sunday on topic Breaking code changes
There are much more than one developer of webtrees addons/extensions which use code from the core. There are no disadvantages of marking methods deprecated. It just makes developers life easier.

webtrees, latest dev

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}