Jump to content

ProcessWire Core & jQuery Future !


Mustafa-Online

Recommended Posts

Hi Everyone, all around the Internet i see developers advice to not depend on jQuery anymore, (Frameworks & CMS's ) for example:

and many more .. I wanna know what is the situation gonna be with (ProcessWire + jQuery)? Any RoadMaps related to it?
The current included version in "wire" directory is jQuery v1.11.1 .. is it possible to use PW with Vuejs or React  (I'm Talking about the core not the frond-end development) 

__PW.png.4f06de055e450d5f9ca92cf235897220.png

  • Like 6
Link to comment
Share on other sites

15 minutes ago, Mats said:

If Jquery is removed i'd like to see plain vanilla js and no framework in between. Just like like there is no PHP framework in PW.

My belief has always been this: if there's a tool available, use it. PW would greatly benefit from a reactive / flux-based (Vuex) way of doing things. If the backend were a complete SPA, that would be absolutely magical!

Link to comment
Share on other sites

Technically PW Admin uses the API available.

It's just a front end. So if someone wants to create a totally new admin front end that uses some js libs
like

https://vuejs.org/

https://mithril.js.org/

https://preactjs.com/

http://www.celljs.org/

It's totally possible. But keep in mind that many third party modules depends on jQuery. So if this is implemented in the core it should be ProcessWire 4 or something indicating a huge change.

:)

  • Like 7
Link to comment
Share on other sites

Just now, clsource said:

Technically PW Admin uses the API available. It's just a front end. So if someone wants to create a totally new admin front end that uses some js libs

Absolutely -- totally possible, and that's just what I was thinking about the other day.

1 minute ago, clsource said:

So if this is implemented in the core it should be ProcessWire 4 or something indicating a huge change.

Definitely.

Link to comment
Share on other sites

So, we should build the next PW admin without uikit framework too? Because we will no longer depend on jQuery but will depend on UIKit or any other library that we need to function properly. Really I don't understand which is the trending goal of eliminating jQuery like a disease?

  • Like 5
Link to comment
Share on other sites

Vanilllllllllla js for the win.

Although for me its the right tool for the job. Jquery is mostly a sugar to make browsers play nice, and a toolkit of repeatable actions (fade, move, etc). Vue and React are MV* for two way data binding... so basically doing mostly a different job (altough like angular your find front end animation helpers too).

Soooo, frameworks go out of fashion (remember when everyone was using Backbone?!), but vanilla won't :) and right tool for the job.

  • Like 4
Link to comment
Share on other sites

For me, the reality is that when I use "vanilla" scripts, each one coming from different developers with its own code for dom traversal and manipulation, yes they are in plain js without dependencies ... but with a tons of redundant code for the same tasks ... so when I finally managed to finish a complex website with sliders, accordions, calendar, date selectors, drop-down menus, parallax, forms and looong, etc. each has its own code to select nodes, add/remove classes and looong, etc. I have a lot of repetitive code, for what? For a trend? yes it's true jQuery 1x is obsolete and fat due to the support of old browsers, but jQuery 3x is as slim as you need. The reality is that we need a library for common tasks (give it the name you want). For today jQuery allows me to do simple tasks on a regular website without additional efforts (ie a website like processwire.com, not a web application, or a project for Córdoba).. well.. if someone create that library, pleeeease use an API similar to PW/JQUERY.. it's so easy to use and learn for us, the non pro developers!!

  • Like 18
Link to comment
Share on other sites

I'm not strictly against ditching jQuery in favour of Vue / React / whatever it is that all the hip developers use right now, but it's true that this would be a major change, and I'm not sure how much sense it would really make. "That's what others are doing" is not a very good reason in itself, but if it would enable us to do something that we currently can't, I'm all ears :)

(Note: in the end this decision is obviously up to Ryan, and as far as I know there are currently no plans for ditching jQuery / jQuery UI.)

Personally I'm still somewhat fond of jQuery. It simplifies a lot of stuff, deals with browser incompatibilities, and provides polyfills for some missing features. It's not the best tool for massive JavaScript applications, but that's not what the admin is all about either. Also, minified and gzipped jQuery 3.x is 32Kb, so anyone calling it "huge" could use a reality check. Sure, it is huge if you're only using it to implement a simple slider or menu or something along those lines, but that's a rather limited use case.

That being said, it is true that the core is currently using a relatively old version of jQuery, so going up a couple of major versions could be a good first step?

---

On a related note: at least a couple of third party modules already use Angular, and back in the day Antti even released a module that automatically loads it. For third party stuff it could make sense to build a set of modules for loading common frameworks and then require those as needed. That won't solve the problem of having to load jQuery and it won't make the entire admin a Vue/React/whatever app, of course.

  • Like 11
Link to comment
Share on other sites

@teppo I do have to agree - one would need to determine what what purpose it would have and, yes, how much sense it would make. In my view, I think front-end frameworks bring a lot to the table, and that they could indeed enhance the experience. Having known jQuery for a long time, I'd be inclined to make this a slow process, if it were up to me. For my own projects, I'm no longer using jQuery for a multitude of reasons, one of which is its age (and not necessarily because all the cool kids are doing it).

Given that the PW admin has multiple aspects to it, and that it could well be considered an 'app' from that perspective, I think a front end framework could fit in well. Sure, there are a whole bunch of other things to consider, like modules needing jQuery, but there's nothing wrong with that, and PW could just load it in when the first module in the queue asks for it.

I would really like to see the PW admin become a single page app.

  • Like 1
Link to comment
Share on other sites

34 minutes ago, Mike Rockett said:

 I'm no longer using jQuery for a multitude of reasons, one of which is its age

I'm very interested why foremost it's age is a good reason to turn away from jQuery. It's no new cool kid on the block, but it is matured, very well documented and wide spread. It was no "dead end" like some of the other "cool" JS frameworks have been. It feels like a good ol' companion. It's not the right tool for every job nor a holy grail, but in pretty much use cases it works well and affordable in a sense that there is no steep learning curve.

  • Like 8
Link to comment
Share on other sites

1 minute ago, titanium said:

It was no "dead end" like some of the other "cool" JS frameworks have been.

Cool JS frameworks will become history just because sooner than later someone releases just another even cooler JS framework rendering the previous ones obsolete. BTW, the WordPress guys have been debating for months or maybe for more than a year which one to pick...

On the other hand, jQuery is still going strong as others have also pointed it out above. :) 

  • Like 4
Link to comment
Share on other sites

Good to see I'm not the only one scratching my head over the current jQuery-is-bad movement. To me, wiring in a full-fledged MVsomething framework only makes sense if the complete data exchange is abstracted away, otherwise backend code and frontend (speak backend UI) logic will get even tighter bundled (or bungled?). This would mean that all backend calls would need to be some kind of RESTful using JSON, XML or something along these lines, and plainly, PW isn't at that point right now and getting there would need quite a bit of work.

I'm not a real wiz when it comes to MVC/MVVM frameworks, but I do have some experience building complex RIAs, starting by building everything on top of ExtJS (2 and 3) in the good old days and later rolling my own two-way bindings for nested data structures. I've recently delved a bit into the currently trending frameworks, and I was utterly appalled by the unnecessary complexity, semantic mumbojumbo and lack of essential features each of those exhibited in varying degrees. Don't get me started on the massive breaking changes introduced in major frameworks I see every year. I've got one really complex app that needs a larger overhaul next year (warranted after 8 years, I feel), and I've come to the conclusion that it will be simpler, faster and more concise to build everything without any framework besides a lean CSS library and perhaps jQuery, especially if I want it to run the following 5+ years without finding myself using an orphaned framework.

If the PW backend could be completely JSONified, I'd be all for that, but even then, I'd currently prefer a framework-less default interface. Any MV* solution could then be an alternative, just like current admin themes.

  • Like 9
Link to comment
Share on other sites

I'm in the web design since 1998, and I remember when the war against inline styles began, you put a little style="margin-bottom:10px" in a unique element in the project and you are a renegade man from the old days, you need to create a new css class for it ... after decades learning to avoid them at all cost.. now in 2017 the new trend that coder influencers propose as good modern practices (because of React, etc) is using it! you get this and is OK.. Whaaat? !! ..hahaha.. the previous was a joke.. but seriously.. the best practice is to be practical, logic and simple always as @BitPoet said

  • Like 4
Link to comment
Share on other sites

I see the points being made here. @BitPoet, you're quite right -- didn't think about the jsonification of things. That could surely be implemented, but it brings us back to the question of purpose etc. Truthfully, doing this would be quite a mammoth task, considering all the aspects involved.

@titanium Well, I think age may have been a bad choice of word... I look at the updates, and it's been seemingly quiet (except for master branch, which has activity).

@szabesz Sure, understandable, though my thinking is more about what the newer frameworks are capable of, and less about their cool-kid-on-the-block status, which has never been something I think much about. Sure, it pops into the mind, "that's really cool" -- but jQuery was the same when it launched, and then sky-rocketed.

I can agree with a jQuery version bump at the very least... Someday, PW's default interface and experience could well be powered by a fully fledged MV* framework, and I'm convinced that it's quite fitting, considering that it's not a simple app at all.

  • Like 1
Link to comment
Share on other sites

Just my opinion, but I don't quite understand whats the benefit to get rid of one dependency to immediately replace it with another dependency. I have no experience with VueJS or Angular yet, but as far as I can see, you would be completely dependent on one of those frameworks.

In this case I'm maybe a little bit old school, but I like jQuery and also don't understand, why everybody wants to get rid of it as fast as possible. Also the comparison of ProcessWires API with jQuery was on of the first things, that got me interested.

Luckily it is not our decision to decide. ;)

  • Like 10
Link to comment
Share on other sites

JQuery simplifies things for JS, just like PW does for PHP cms. You could use vanilla JS or another framework that would make things harder for devs. Would you use PW if it were more complicated to use or so basic like pure PHP? I think jQuery is still the right tool for PW admin, or at least I don't see any real advantages using another (or using none).

  • Like 7
Link to comment
Share on other sites

On 10/31/2017 at 3:06 PM, Pixrael said:

So, we should build the next PW admin without uikit framework too? Because we will no longer depend on jQuery but will depend on UIKit

I do not see how UIkit is a dependency here. Ryan has just shown us that he could replace the old skin with a new one in a relatively short period of time. UIkit 3 is currently a modern, easy to personalize "framework" on which experienced developers have been working for months if not years. How could the ProcessWire community build something better than that? Without some sort of framework there is no documented/conventional way to implement things which makes it hard (if not impossible) to adhere to some sort of "standards".

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...