Getting ready for Joomla 4 #126
Labels
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#126
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
You will see JCB is removing all repeatable fields from its back-end, this is because it has been deprecated.
I do not have the time to always be on top of the latest changes in the Joomla API, if you notice a change that will effect JCB, please open an issue on Github to give me and other a heads-up.
Lets work together so the JCB will function like a ship for us all over the troubled waters of Joomla's community driven development.
Objective is that JCB will always compile your component for the latest stable release of Joomla .
I am open for suggestions here, but it seems most doable to just keep adapting the compiler to work in the latest release of Joomla. So if you want to compile for earlier versions, you simply install and earlier JCB.
The other option is to allow compiling for each main release, like Joomla 3, then Joomla 4 and so on. This may cause JCB to become so large that it will be hard to manage, JCB was build with this as the way forward. So it will naturally scale this way.
I keep my eyes open, as I can, for any changes in joomla.
As far as consoling for each main release, that could be a tough on. As you said it could make JCB very large in size.
And when joomla moves to a new major release, let's say from 3 to 4, version will be the next official version, but 3 is supported for 2 years.
In some ways I think that it would be nice to be able to compile for 2 different main versions, but on the other hand it could end up being problematic. A new feature or field type could be introduced for joomla 4, as an example, that isn't supported in version. So if you're building your component and it has this new field, it would fail on joomla since it's a joomla 4 field.
I let others provide input as well, but I think allowing compiling of multiple major versions could end up causing issues, incompatibility problem, and just overall a major headache.
Any help I can do will not hesitate
best regards
Many of the JRequest classes have been depreciated. Such as JRequest::getInt
https://api.joomla.org/cms-3/classes/JRequest.html
The use of JError in the compiler needs to be changed before Joomla! 4.
Replacing something like:
JError::raiseError(500, implode('
', $errors));
With JFactory::getApplication()->enqueueMessage();
https://api.joomla.org/cms-3/classes/JError.html
I wanted to share that Joomla! officially released Joomla 4 alpha 1 today, which has been a long time coming. Alpha, of course, is still a long ways from stable, but is a step closer.
https://www.joomla.org/announcements/release-news/5718-joomla-4-0-alpha-1-release.html
I'm in.
Good to hear. Llewellyn has been doing a lot of changes lately, as can be seen with the new snippet area. But i know the Joomla dev team are doing tons of changes for v4. I've never successfully gotten v4 alpha to install on my hosting server, and my localhost i haven't upgraded yet.
Any major depreciated code thet you know of would be of great help. I know that Llewellyn has a project open for changing the routing system, which will be a requirement.
I haven't played around too much with it, but I have installed the alpha release. There are some new plugin types, but I have yet to build a plugin that installs correctly - the plugin xml file is missing when the install is done. Either there's something wrong with the extension installer, or they've changed something that I'm not seeing.
I'll look over the announcements to see if there's anything that stands out.
According to the J4 announcement, all J3.x deprecated functions will be removed in J4. Just a quick search through vanilla 3.8.2 I find 510 files with deprecated functions. Searching for "\s*\s@deprecated" (which should be found on each deprecated function) - I'm coming up with 1045 deprecated functions in the core.
Certainly, all of these aren't being used in JCB - but I think a good starting place would be to catalog all of these functions and find if/where they're used in JCB.
This is something else on my list of things to read up on:
https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4
I've got 30something extensions to prepare for J4
I think the most major issue we will face will be the router, for the most part I can see only a few other things that may need some tweaking.
I am thinking to start a branch that just prep the compiler for the new Joomla 4.x components. Yet I have not had time to really install Joomla 4 and start tinkering with it. So if any of you can install JCB on Joomla 4 and tell us what broke, that will be a start. Also installing your JCB build components on v4 and giving some feed back will help.
I have been removing stuff as I come across them. But it seems some things are completely changing and would require more work.
I see PHP 7 only is also part of the change... that is going to push the market very hard, and leave many behind. So I think we can do this and stay ahead.
@stutteringp0et those 30+ extensions are they all in JCB or just some of them.
Well my hope is that from the time we have a stable Joomla 4.x JCB v3 should already be able to compile for it, and run on it. That will be ideal 👍
None are in JCB. I have a client who requires rapid project cycles, and JCB has really helped me to keep up with their needs.
I'll be re-releasing 3 or 4 of my extensions re-written in JCB.
J4 + JCB install aborts with an SQL error - but that might be because this is an alpha release. There are a lot of things broken. I tried looking at contact fields and everything broke...I had to re-load /administrator because the error killed all of the javascript nav items on the page.
I'm looking closely at the banners component.
Looking it up, that error was due to my mariadb version. MariaDB 10.2.1 and up allow text column default values.
Well there you go... lol still much todo, what is the planned release date for a stable Joomla4. Did they already set a date?
Anyway I am sure when the time comes we will cross this bridge. I personally think even once the stable release is out it will take a few months for every one to get the courage to move up. I also think many will not move for the first 6-8 months. Usually these major upgrades are painful and slow.
But to get JCB to work should not be that hard, lets say at most a months work in worse case. I just know that these new releases are always a nightmare, I really hope they do better this time around.
Now on MariaDB 10.2.10 - I'm getting this error:
Warning
JInstaller: :Install: Error SQL Field 'addcontributors' doesn't have a default value
JLIB_INSTALLER_ABORT_INSTALL_ABORTED
Maria is a picky broad!
The only thing I've seen about J4 release date is "someday" - I seem to remember the 3.x series taking about a year from alpha to release
We should try MySQL... I don't think the install tables are MariaDB ready. But yes it could take long... but then again they have been taking small steps towards this.
I remember some saying they are planning to insure that components that run on 3.8 will also run on 4.0 but we will see. It clearly is not there yet.
I remember seeing somewhere ghost they are pushing for a summer 2018 release. I saw that they have released alpha 2 already.
Here's a page of potential backward compatibility issues with J!4: https://docs.joomla.org/Potential_backward_compatibility_issues_in_Joomla_4
I switched to a server still running MySQL and got the same types of errors. Turns out, in the MySQL 5.7 docs, BLOB, TEXT, GEOMETRY or JSON columns cannot have default values.
https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html
In a test on J!4 Alpha 2 received the following error:
Warning
JInstaller: :Install: Error SQL BLOB/TEXT column 'params' can't have a default value
JLIB_INSTALLER_ABORT_INSTALL_ABORTED
This JAB-17 Prepare your extension for Joomla 4 seems very helpful, but also proves that we may need to make major improvements to JCB to target J4 more effectively. So I am planning a new branch for the J4 implementation.
I have a Joomla 4, alpha 2 install that i can run testing on when you get to the point that you need testing.
This isn't, necessarily, related ONLY to J!4, but will be part of Joomla! 3.9, moving forward.
According to Joomla!, they have been adding a new privacy tool suite to comply with GDPR requirements. In this the tool suite will "Provide an API for extension developers so they can report the data they collect and this info can be displayed in the new com_privacy extension", "Gain the consent of the registered users (form plugin), track their consent, log their activities, and take care about the consent retention time", and more.
I'm just "throwing that out", in the event you aren't aware, and want to add anything to the JCB Core.
This might be helpful on what is going to be needed for Joomla 4
https://joomla.digital-peak.com/images/blog/JWC17_Prepare_you_extension_for_Joomla_4.pdf
Thanks for provding an interesting extension.
Did you make release plan for J4 support? May be you can have two separate releases like for J3 and J4.
https://github.com/vdm-io/Joomla-Component-Builder/projects/4
@Ninja-007 I am working on this, but we are not yet ready to push anything out. Soon as that happens this issue will also get bumped 👍
Now that J4 beta 2 is out, things look to be firming up, and I'm going to be plunging into J4 Development this autumn. Once I get up to speed, will be following this project and hope to be able to help out
In a test on J!4 Beta 3 received the following error on installation:
An error has occurred.
500 behavior::modal not found.
@ohrionmartin it looks like J4 uses bootstrap::renderModal for that task...
Get JCB's Demo Component to work in J4! using the legacy approach
Admin Area
Comment out the Submenu from admin area:
admin/com_demo/views/looks/view.html.php (line 35-39)
Comment out: JHtml::_('behavior.tabstate');
from admin/demo.php
Displays the list of records on j4!
No breaking changes noticed on j3.10
Comment out: JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_demo.look'));
from admin/tables/look.php
Ability to view the list of records
No breaking changes noticed on j3.10!
Comment out the loader/spinner
from admin/views/look/tmpl/edit.php
Getting the following error when trying to perform any of the
Save
operations on J4!:An error has occurred.
0 Class
JApplication
not foundResolution:
JApplication
::stringURLSafe($this->alias); to $this->alias =JApplicationHelper
::stringURLSafe($this->alias); in admin/tables/look.phpL335
Note: (Breaks version history in J3.10! & Does not keep version history in J4!)new records
Getting the following error when trying to perform a
Batch
operation on J4!:An error has occurred.
0 Call to undefined method
DemoTableLook::getObserverOfClass()
Some of the observed Component folder structure changes in the admin area
Site Area
Comment out (from
com_demo/views/look/tmpl/edit.php
):Comment out the following lines to make the component install on both J3! & J4! from
com_demo/script.php
:hello did you have some news about j4 compatibility ?
Honestly there is not that much to do to get JCB to build legacy components for Joomla 4
We need the new router implementation and a few GUI tweaks.
There are also some integration issues with tags, history and categories to resolve.
I was very sure to have it finished before the end of last year, but one of my larges clients was not willing to wait any longer for JCB (in Joomla 4), and so I had to prioritize my time. I therefore build their new very large application in J3... this was a loss for JCB, since I to this day work on JCB as my own priorities dictates the need.
Yet we have suggested a working group to help take the small needed steps to slowly move JCB to Joomla 4.
There is also this serious reality that moving to native Joomla 4 is much more attractive to me, to skip the legacy step all together. This because of the new Powers area in JCB-pro as it allows for much better PHP conventions and best practices way beyond what we have now. Yet this path is a far larger task, and yet another reason for me to not wast time going legacy... lets just go native strait away.
The new native way of building components in Joomla 4 has much less work in terms of code needed to achieve the same in Joomla 3. But it is a complete different architecture and many of the smart advance features we have in JCB today will probably be lost initially... But I can tell you I am very exited about JCB as I firmly believe the best is yet to come... all things of real value takes time, so I am not willing to do some quick fix just to result in more regret.... JCB has always aimed at native Joomla implementation.
Wondering what the current state of J4 compatibility is. This last update from @Llewellynvdm was over 3 months ago, and if there has been progress - I'd hate to duplicate or undermine it with my meddling.
I have 2 projects that I would dearly love to implement in J4 instead of planning for migration - so I wonder what might be done to assist. I have contributed before, and I think I'm listed as a contributor (the pretty print PHP module requirement for XML generation is my fault :P ).
I see where @Llewellynvdm wants to skip legacy, but that seems far away...I don't see that progress anywhere in the issues. I do see that I was nominated for testing - which I accept....but I don't see anything to test.
Basically, I'm asking - if I were to offer an immediate and significant amount of time toward J4 compatibility (legacy or pure j4) - where would that time best be spent. In the long run, a J4 compatible JCB is going to benefit me more in time than building the components outside of JCB.
Put me in the game coach!
@stutteringp0et best way to get involved is to join the Telegram channel, and start attending the weekly (that is Mondays) meetings in the Telegram channel.
Reality is I am finding it very hard to explain what I am doing, as the compiler is not your average script. But to put it simple, I am refactoring the compiler into the new Powers area, and so decoupling the Joomla 3 approach to component development. The reality as I am doing this I see thing is the overall JCB architecture that needs change. Like the last release we move the whole MVC classes to extend the new native MVC classes in Joomla. The next I am looking at adding a switch to add namespacing to these classes. But as you know to do this will break most extensions build with JCB that has custom code. So to make this change I am thinking of adding a screening engin that will look at all your custom code going into your extension and making errors or warrnings where you are still using Joomla API without adding use of its namespacing. Yet at the same time I am working on an abstraction layer of the compiler. Yet each time I touch that... is see small issues that must globally change to accommodate these changes. The meanwhile trying to get the implementation path simple for newcomers.
So yes lots of work going into to JCB transition to Joomla 4. Most if which is related to the new power area, this means I need to release the new powers are to the public version if we want to take them along to Joomla 4 ;) to do this we need funding so we opened a donation initiative... which has not really achieved the amount needed. This means that moving the public version of JCB to Joomla 4 may take much longer then the pro version. Which is not what I actually wanted... so any donations toward Joomla 4 development will hasten it going public.
@stutteringp0et since you know the compiler better than most, you are probably able to help me in conversation over the abstraction steps I am taking... so even if you can't make it to the Monday meetings... any time you can give towards some conversation with me on Telegram could proof helpful and even help me identify what your able to do towards this work.
How well do you know the new powers area? have you used it in any way? I have added a new JCB package to the VDM packages called Power Updater this holds the core set of classes already moved to the powers area. This package will grow as we continue. We will also add a package called the compiler... which will hold all the compile classes in a JCB package. Anyway hope this is helpful as an introduction to joining me on this journey.
I'll jump into telegram. I haven't seen the powers area at all. I've only ever seen the public release.
and I threw $100 at the donation initiative
Hi ho -
I have a project I'd really like to build in J4...so I thought I'd spend some time and map out what's holding back JCB install in J4.
First, there's the "doesn't have a default value" error I detailed previously. The fix for that is easy enough. Everywhere in the installation SQL files, where you find "TEXT NOT NULL," replace it with "TEXT NOT NULL DEFAULT '',"
Then there are a lot of insert errors. What I'm seeing is that if an int or tinyint value is default, it's being inserted as an empty string instead of the default value (usually 0, which causes an error on any recent mysql or mariadb server).
Because it's always default values, the easiest thing to do would be to omit the values from the insert statement, but as it's generated programmatically - the solution is probably to insert the default value instead of an empty string.
Once I get past those issues, I hit a 500 error, which reports:
PHP Fatal error: Trait "VDM\Joomla\Utilities" not found in path/administrator/components/com_componentbuilder/helpers/componentbuilder.php on line 75
I'm out of time today, must attend the family (Christmas approaches). I'll return to this, probably tomorrow.
Festivities canceled for weather...
So, something happens between the first install and the 2nd, because I don't get the 500 error. I'm assuming that the files are being copied after they're called.
So, it's installed now. Many errors are displayed.
() JROOT/libraries/src/Dispatcher/LegacyComponentDispatcher.php:61
Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch()
JROOT/libraries/src/Component/ComponentHelper.php:355
Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143
Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186
Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:294
Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61
require_once() JROOT/administrator/index.php:32
At the moment I am refactoring the compiler, and the result will be that we will be able to build native Joomla 4 extensions.
Not that I mind making little changes to target a legacy kind of approach, I just don't have time.I am going directly for the right solution, and yes it take more work and yet, once I am done we will have the whole compiler in the new POWERS area, you can see some of the work that was already done here:
https://git.vdm.dev/joomla/Component-Builder/src/branch/staging/libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler
@Llewellyn that's how you're doing it - very impressed!
@Llewellyn
that is very good news. i am very happy. would you please say when we can see JCB for joomla4? (even beta version)
This is the only answer we have at this time:
#964 (comment)