The Joomla.request()
method that executes an XHR request current supports 2 callback methods:
There needs to be a callback method that executes regardless or whether or not the request failed
onComplete
callback methodJoomla.request()
and suggest using fetch()
Labels |
Added:
?
|
PS can't be done without a proper way to patch the missing pollyfil for ES5
If that's your thinking then both the backend and frontend templates should support IE11 too.
Casseopia CSS grid should be moved to BS grid.
The media_source
may aswell just be moved back to ES2013 and minified with terser...oh sorry, I mean UglifyJS.
kinda the industry standard
Erm, not, it isn't. There are many big players out there that have completely dropped support for IE11. Why? Because it holds back development.
also it requires zero effort from the ES20XX to get to a fully functional ES5 script
So why not just have Joomla ship es6.js
files only and let devs transpile and use the necessary polyfills to get thier Joomla site working in IE11?
Of course it's possible, but why the hell do we need to ship ES5 in core?
Like I said, if Joomla needs to ship ES2013 JS, then it may aswell also replace its CSS vars and grid
es5 files should only be there for reference and use for Developer for easier use in ie11 usage scenario if needed.
Joomla Backend and Frontend is not bound to ES5. But 3rd party devs should be able to create a ES5 compatible templates. that's the reason the ES5 files exists.
I'm not sure if @wilsonge want's to ship them or only have them as reference for 3rd party.
@HLeithner So what if nobody out there develops a IE11 compatible template? Do they have to develop one themselves?
If the ES2015 JS is shipped to provide support for old browsers, then I don't see the CSS shouldn't support IE11. Either support it, or don't. It's pointless shipping something half baked for IE
Of course it's possible, but why the hell do we need to ship ES5 in core?
Because in many countries (England is one of them, so I expected to be more conservative here) have a way too high percentage of IE usage.
And since I like to talk with actual figures, here is the official IE usage from your country's gov site:
https://twitter.com/TheRealNooshu/status/1247565222384218112
@C-Lodder compiling and providing the script as I said before is a zero effort if the right tools are used. Seriously with my proposal (type=module/nomodule) there is no problem and we're using progressive enhancement the right way. I seriously don't get why we need to ditch something that effectively is automatically generated...
Because it's still holding the JS back.
Joomla doesn't even load ES6 files
Problem is that people have some short of problem with the defer attribute, you can load today ES6+ files even in Joomla 3.x, eg:
I can't see anyone converting the JS to modules
To add type=module
you don't have to do something special, the current scripts will works as they are
We can't use newer DOM methods cause Joomla's build scripts don't even polyfill them.
That's a limitation of the build tools. The scripts need to be processed by a bundler, then the polyfilling will also be transparent
Because it's still holding the JS back.
Mate, seriously have you seen what most Joomla devs ship on the js? Also patching the various jQuery dependant scripts will yield more performance than switching to delivering some files as ES6 but still loading jQuery and bootstrap.js
@dgrammatiko @Fedik is there anything to do here? Has it been resolved? Is it a non-issue?
Has it been resolved?
I agree with @C-Lodder here, fetch is a better native function but unfortunately we are fashionably late here to do anything before 4.0 stable. Probably a viable alternative is to introduce another core.js
, let's call it core-js-api.js
with modern functions and less code. That said I still have a couple of improvements in the pipeline: #32748 and #32747 but they don't seem to attract any attention so their fate is questionable...
In sort I guess we could open a discussion on what a modern core.js could be but not for 4.0 stable, there's no manpower to do the required work...
Anyways that's my 2c here
I think we can add onComplete
callback. Maybe I will try to look sometime.
Introducing promise
or replace to fetch
will be b.c. However people already can use fetch
in their own scripts.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-04-11 10:11:09 |
Closed_By | ⇒ | Fedik |
Just use fetch()
Also drop the unneeded wrapper around the Events in the same file
PS can't be done without a proper way to patch the missing pollyfil for ES5