[NEW THEME] 4. JS frameworks & approach

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB's style.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB or modifying styles of released phpBB versions. If you need support for phpBB please visit the Support Forums on phpbb.com.

If you have questions regarding creating styles please post in Styles Support & Discussion to receive proper guidance from our staff and community.
Post Reply
User avatar
Ger
Registered User
Posts: 293
Joined: Mon Jul 26, 2010 1:55 pm
Location: 192.168.1.100
Contact:

Re: [NEW THEME] 4. JS frameworks & approach

Post by Ger »

First off: this part of the discussion might be better off in it's own topic: BC for extension/styles.

But my opinion on this: I think it's a bit premature to discuss all of the possible drawbacks and extension/style developers running away while we (or I for one) have really no clue what we're talking about. If the whole concept of controllers, event listners etc. will remain untouched, that would be nice. The concept of $template->assign_vars() method should also be left as is, or at least offer a compatibility layer to translate 3.x calls to however it should be in 4.x. Since in the end every template system should have a structured method to assign variable pairs, that wouldn't be too hard I'd say.

That would leave 2 things: Template events and the JS framework. When the whole structure of a style changes, it's very hard to automate this. So yes, that would require handywork for the dev. I personally would be glad if I could just keep using jQuery since I have no experience in Vue or the other mentioned alternatives. Being a back-end developer myself I would prefer not needing to learn yet another framework.
Above message may contain errors in grammar, spelling or wrongly chosen words. This is because I'm not a native speaker. My apologies in advance.

GanstaZ
Registered User
Posts: 20
Joined: Wed Apr 11, 2018 4:58 pm

Re: [NEW THEME] 4. JS frameworks & approach

Post by GanstaZ »

I like the new theme framework, seems that it will be easy to use. Looking at examples in git repo, twig inheritance & blocks (something like this is needed) will be used with it.

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: [NEW THEME] 4. JS frameworks & approach

Post by hanakin »

Jquery is compatible with vuejs so jquery for ext is still valid the vuejs would be for specific cases if we use it for core only really
Donations welcome via Paypal Image

Brru
Registered User
Posts: 1
Joined: Wed May 30, 2018 4:26 am

Re: [NEW THEME] 4. JS frameworks & approach

Post by Brru »

Vuejs would solve a lot of the problems associated with 3.x and the appeal of using phpBB.

I am not saying strides haven't been made in the correct direction, but progress has been slow. The reasons are easy to understand when you rely on a voluntary system of developers. The problem goes even deeper when you account for the lack of enthusiasm for non-modern systems. Basically, no one volunteers to learn PHP or to develop in HTML/CSS anymore because you can't show it off. "Hey look I made some CSS on my github..." isn't something you hear anymore. Vuejs would fix that by bringing new enthusiasm that the contributor could actually show off and potentially lead somewhere.

Similar to the above, you could bring in more businesses willing to write in Vuejs styles. I am currently dealing with an issue where I inherited an old theme developed by a company that is no longer willing to continue theming in 3.2 and that leaves me high and dry. With Vuejs those companies might come back since they've moved onto more modern themes. Easier development = more money for these guys.

Vuejs would speed things up, easier mobile integration, compatibility with more languages, and it has potential to redefine phpbb as a project. All these are only scratching the surface.

User avatar
AmigoJack
Registered User
Posts: 110
Joined: Wed May 04, 2011 7:47 pm
Location: グリーン ヒル ゾーン
Contact:

Re: [NEW THEME] 4. JS frameworks & approach

Post by AmigoJack »

hanakin wrote: Wed May 02, 2018 1:08 am💯 not true pure js is getting better but still does not compare to jQuery and can not do anything vue can do
CHItA wrote: Wed May 02, 2018 6:29 amas far as I know, we only use jQuery to toggle classes and select elements
DavidIQ wrote: Wed May 02, 2018 9:01 amWe leverage jQuery for all things AJAX
I'm not convinced - to me the reasons being dependent on doing so are old enough to reconsider them. What has happened to the approach of "JS should enhance a website, not be a requirement"? For me, when a website can't be used/rendered without JS then I always imply lousy designer skills.

Back in 2010 I already wrote my own code to
  • use AJAX whenever I needed: 30 lines in 4 functions (uses re-attempts when a transfer has failed)
  • colorize password complexity
  • show the first thumbnails being used in a topic when viewing a forum (displaying a non-reduced picture when hovering the mouse cursor over that thumbnail)
  • render auto complete comboboxes, including normalizing texts (ignoring diacritics, so you're able to type in á but still find a and vice versoa; synonyming letters, so you're able to type in Б but still find b and vice versa...)
  • create, reorder, modify and change DOM elements, including loading another JS file - that's all no black magic and done pretty straight, being tested in MSIE, FFOX/WFOX, SAFA, CHRO/VIVA, OPER
  • enhance the editor: marking three lines and then hitting the LIST button will automatically start each line with the asterisk BBCode; marking a text and then hitting the URL button will automatically ask for an address; marking an address and then hitting the URL button will automatically ask for a text; hitting the URL button without any selection will ask for both; the textbox is freely resizable by dragging its bottomright corner...
and none of that is required - everything has a fallback when JS is not available/wanted. Not being dependent on any other framework, including their way of treating things, their releases, and their issues.

Those are my examples. What is so complicated in phpBB that it needs a JS framework? Can CSS issues only be resolved thru JS? What are most prominent examples?

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: [NEW THEME] 4. JS frameworks & approach

Post by hanakin »

1. No one said anything about css? That is not an issue.

2. The world has changed in the last nearly a decade js is no longer just an enhancement it’s becoming the norm for interactive performant components that provide for better UX/UI with less overhead and a cleaner more organized codebase.

3. Why yes you can add in some simple Ajax functionality with holy crap 30 lines that’s a lot! Should not take more than 10-15 these days. That’s not doing anything for handling two way binding and performant interactivity. Ajax is a tiny peice of what this is meant to do. It’s really not even worth mentioning any. It’s just assumed when you build two bindind components that utilize proper restful backends to deliver interactive UX.
Donations welcome via Paypal Image

User avatar
AmigoJack
Registered User
Posts: 110
Joined: Wed May 04, 2011 7:47 pm
Location: グリーン ヒル ゾーン
Contact:

Re: [NEW THEME] 4. JS frameworks & approach

Post by AmigoJack »

  1. I assumed this upon
    CHItA wrote: Wed May 02, 2018 6:29 amwe only use jQuery to toggle classes
    and since PHP classes can't be meant and HTML doesn't know classes only CSS classes remain. Also Font Awesome and its CSS is loaded thru JS instead of directly. Also this topic is titled "new theme, JS frameworks", being in the forum "Style Development" - do you want to tell me this all doesn't touch CSS?
  2. No, HTML5 and CSS3 already provide more than XHTML1 and CSS2 did and it should decrease (if not cease) the usage of JS, not increase it. Right now the navigation bar menus like "Quick links" don't work without JS, although it'd be doable thru CSS these days. Yes, the world has changed - I'm with you. The codebase however is less organized when you include it off third parties instead of being able to maintain it yourself.
  3. I understand that "two way binding" is just a new way of saying "in sync" (or even older: "consistent") - why is this even an issue? I can imagine an example where a user re-arranges HTML elements and this needs to be sent back to the server - a whole framework is needed to accomplish this? Which simple example am I missing? "RESTful backends delivering interactive UX" is newspeak for "after all HTTP has been RESTful to begin with, and since websites are always requested an interaction is mandatory" - an HTTP response has to be parsed anyway, it doesn't matter if its format is JSON or XML or CSV - but then again this can be written by ourselves (rather easily) instead of using a framework which has a few features helping us, many features we won't use and a couple of features we'll always miss.
I provided examples, and you answered (thus having enough time) but without examples. Arguing about code lines won't bring anything, especially when things like code comments, fallbacks and compression need to be considered, and when jQuery needs much more than 30.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1903
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: [NEW THEME] 4. JS frameworks & approach

Post by DavidIQ »

AmigoJack wrote: Tue Jul 31, 2018 9:54 amFor me, when a website can't be used/rendered without JS then I always imply lousy designer skills.
...or they built the site using Angular, VueJS, React or any of the many other available JavaScript frameworks. Nowadays disabling JavaScript means having a horrendous web experience, unless you stick to a small subset of sites you know work fine with or without so I think most people don't bother anymore and just enable ad blockers or use other things/extensions to take care of the reasons they disabled JS in the past.
Image

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: [NEW THEME] 4. JS frameworks & approach

Post by hanakin »

But code commenting is not required when using something like vue as your code focused and your footprint is rather small. It’s also abstracted to the dom which also removes a lot of requirements for comments.

Frankly it’s sounds more like you refuse to learn a framework or resource because you do not want to change your own workflow. All of your points seem to say the same thing why use a framework when you can create something with vanilla js. The answer is frameworks are mainstream and simplify the overhead for us to document everything and maintain said documentation making it easier for individuals new to the software to initially pick it up and stat working on it. Not to mention it brings/attracts individuals from an already robust community to help maintain and contribute our software. We can leverage the established communities for font-awesome, jquery, symphony, laravel, angular, vuejs, etc... frameworks and libraries is a staple of software development across numerous languages for this and many other reasons. Exspecially when you get into large scale projects such as phpBB.
Donations welcome via Paypal Image

User avatar
AmigoJack
Registered User
Posts: 110
Joined: Wed May 04, 2011 7:47 pm
Location: グリーン ヒル ゾーン
Contact:

Re: [NEW THEME] 4. JS frameworks & approach

Post by AmigoJack »

Yes, disabling JS nowadays doesn't bother most people. But then again virtually nobody is interested in privacy as well. And extensions like uMatrix cannot fully protect you from that either - in the end you cannot trust JS at all, because it is always able to post load anything and transfer anything. I mean: I can't (while you seem to be okay with JS when CSS3 could have be used).

Yes, I refuse to learn "a" framework, because (in contrast to libraries or toolkits) it always comes with a forced way of how things need to be done, and chances are one is getting in the way of another. As long as frameworks accomplish what you want I'm sure you're fine with them. It's just that you hand over control: if looking at how a framework does things make you realize it's going long routes which could be way shorter, or it's ignoring errors then you have no way to fix that (and a bug ticket doesn't mean by default anything gets fixed or even improved) - that's my experience (while yours seem to differ).

I said what I wanted, and it's still only a recommendation: reduce it to the core what you need and write it yourself. If you're able to, of course (since I also met people being unable to achieve things without frameworks - they unlearnt the basics).

Post Reply