Some thoughts on Trongate Pages and the latest news article

Comments for “Some thoughts on Trongate Pages and the latest news article”

Posted by Dom on Monday 20th May 2024 at 08:34 GMT

Had there been a comments section on the news page I would have appended this to that but as there isn't I'll throw my thoughts into the ring here instead.

I had to take a good hard look at Trongate Pages when I came to the decision to fully support it in the Data Generator and it is indeed one of the great strengths of Trongate and rightly deserves to be centre stage and I found myself asking if it could be tweaked in some way to make it easier to extend. Let me expound on that last bit as I think that this is the crux of what has been going through my mind since I read DC's news article and watched the short video he put up on YouTube. One of the things that I would want in a what is in essence a 'page builder / creator' is a means to easily add well formatted code snippets. I write a lot on different aspects of programming and backing it up with examples always helps convey points to the reader. That can be easily achieved with something like the Prism library but doing so tends to go against the ethos of Trongate avoiding having a reliance on third party libraries.

Now to be fair DC has never said don't use third party libraries, just don't make the framework itself reliant on them. Perfectly laudable. I thought through how I might add certain things that I would want to Trongate Pages but came to the conclusion that it would be difficult to do in the way that it was currently structured. I also wondered if it would be possibly to do so without fundamentally breaking what was already there.

Let me state up front that I am not a fan of the concept of V1 forever. All software has to evolve and versioning is a good way of indicating that it has evolved. I do however subscribe to the view that wherever possible breaking changes should be avoided. Again though there are times when it becomes difficult if not impossible to avoid them and therefore there needs to be an acknowledgement that they are sometimes unavoidable.

This may be such a moment for Trongate pages.

I do not think that DC can, or indeed should be expected to produce endless additional features to Trongate pages as people will no doubt start to demand as users of the framework realise what a neat little hidden gem it is , with the little caveat that 'it would be so much better if it only did x as well'. There's a Module Market for that and this is an area that could very easily lead to a crop of paid for modules which in turn would help to support the framework as a whole.

This brings us at last to what I would do, or at least try to do if this were me. My gut instinct would be to break it apart. Make use of Trongate's inbuilt modularity. Each of the current bits that you can add to a page, would become an element / module in its own right with an overseer module , Trongate Pages itself. That module would 'know' how to draw into itself element modules meaning that anyone could then create separate element modules providing all sorts of additional things to them (Trongate pages) as a whole. Obviously this means that there would need to be clear guidelines as to how these elements were constructed. That would be where Interfaces and Traits come into their own along with abstract classes.

Possibly all this could be done with breaking anything but were that to be the case I suspect that it would be more by luck than design.

I don't expect that this will prove to be a popular idea, far from it but I do think that Trongate pages is indeed a little hidden gem that has the potential to be so much more than it currently is.
Level One Member


User Level: Level One Member

Date Joined: 12/01/2024

Posted by Davcon on Tuesday 21st May 2024 at 22:53 GMT

Your comments are gratefully appreciated but I'm going to respond in a manner that is far more crude than you deserve. All of the following is said with gratitude and macho love.

Regarding 'v1 Forever'
Trongate was built as a reaction against insane rewrite culture. I was eager to send home the message that this framework places massive value on stability. I think the PHP community has a need for a framework that puts stability first. I always stressed, as strongly as possible that 'v1 forever' never meant it won't be upgraded. I also stressed - as strongly as the English language would allow - that whilst there's an aspiration to remain v1 forever, nobody from Team Trongate can guarantee that it'll be v1 forever. That's because we don't have control over the PHP language and we don't know what's coming up in the future. So, v1 forever is more a statement of intent rather than a policy regarding semantic versioning. These days I don't use the phrase much because naysayers lack nuance.

Regarding the future of Trongate Pages:
I agree that there may need to be some kind of rebuild of Trongate Pages in the future. I think we could do with something that resembles HTMX. The goal would be to give PHP developers something that they can work with without getting entangled in a rat's nest of JavaScript.

Regarding abstract classes etc:
I don't know anything about all that stuff and you're a genius.



This comment was edited by Davcon on Tuesday 21st May 2024 at 22:55 GMT

Founding Member


User Level: Founding Member

Date Joined: 3/11/2018

Posted by djnordeen on Wednesday 22nd May 2024 at 11:13 GMT

Well said.
You can also submit pull requests to improve Trongate Pages, as the source code is there.
Early Adopter


User Level: Early Adopter

Date Joined: 20/08/2021