-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve JSF javascript #1598
Comments
Adding @blutorange as our TypeScript expert. |
I guess the decision which technology to use is up to somebody else, but I'd gladly help with the TypeScript part. If we are talking about https://docs.oracle.com/javaee/7/javaserver-faces-2-2/jsdocs/symbols/jsf.html (?), I already created a type declaration file for that here: https://github.com/primefaces/primefaces/blob/master/primefaces/src/main/type-definitions/core-jsf.d.ts (might need some updates for the recent release) |
I'm absolutely not the person to be able to help out with rewriting jsf.js (now faces.js indeed), but I did notice it's written in a quite horrible style. There's also an endless amount of warnings and even errors reported from it, that overal don't give a good impression. |
there is a implementation in TypeScript from a MyFaces member |
@hantsy Do you mean to introduce 3rd party client side technologies into JSF? I don't like the idea to bind 3rd party client side technologies into the JSF-implementation. JSF should remain (client-side) framework independent. I think, it would be good to extend |
Some time ago I've modernized jsf.js (faces.js) and removed the old FrameTransport but due to specs limit Again I'm not an expert in profiling JS so If someone could help or improve my version is welcome I'm not sure if with Faces 4 is finally possible to use ES6 JS or not but If it's ok I could provide a PR |
I've spent some time to investigate the overall deprecation of old software... Actually Safari 10 - 11 - 12 - 13 - 14 are not supported anymore by Apple Even a 10 years old Macbook can upgrade to https://discussions.apple.com/thread/253968805 IOS 11 with Safari 11 is availble since September 2017 ( 5 years ago ) IE11 is official in EOL from Microsoft https://docs.microsoft.com/en-us/lifecycle/announcements/internet-explorer-11-end-of-support Even more If you think that at the moment:
So it is more than safe to updagrade at least to full ES6 support |
JFYI |
In the current version of "faces.js" in the master of Mojarra, some things don't work correctly atm. For example consider the following page: <html xmlns="http://www.w3.org/1999/xhtml">
<head id="j_idt3">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ajax</title>
<script src="/test-faces22-ajax/jakarta.faces.resource/faces.js.xhtml?ln=jakarta.faces"></script>
</head>
<body>
<form id="form1" name="form1" method="post" action="/test-faces22-ajax/updateBody.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="form1" value="form1" />
<input id="form1:bodytag" type="submit" name="form1:bodytag" value="BodyTag" onclick="mojarra.ab(this,event,'action','@this','@none');return false" />
<input type="hidden" name="jakarta.faces.ViewState" id="j_id1:jakarta.faces.ViewState:0" value="5704712853588420397:-194852515398040622" autocomplete="off" />
</form>
</body>
</html> Also consider the following AJAX response: <?xml version='1.0' encoding='UTF-8'?>
<partial-response>
<changes>
<update id="jakarta.faces.ViewBody">
<![CDATA[
<body class="foo" title="fooTitle" lang="fooLang">
<span id="status"></span>
</body>]]>
</update>
<eval>
<![CDATA[
var body = document.getElementsByTagName('body')[0];
document.getElementById('status').innerHTML=
'BODY CLASS:'+body.className+
' BODY TITLE:'+body.title+
' BODY LANG:'+body.lang]]>
</eval>
</changes>
</partial-response> In the above example, the attributes on the body class are not being set. Switching the See test |
@pizzi80 can you fix this? |
Fixed How to run Faces TCK tests with the current master snapshot? I read the docs and tried the following test run:
but it doesn't compile
|
@pizzi80 the You'd probably wanted to set the Mojarra version. If the docs say otherwise we should update them I guess. Can you try something like the following, assuming you have compiled Mojarra master locally:
The last option is important too, since default is using httpunit/rhino, which totally dislikes the new faces.js. |
@pizzi80 eclipse-ee4j/mojarra#5225 didn't quite fix the Ajax problems. There's still many failures.
|
I did the PR before i know how to run this new Faces test suite... fixed with eclipse-ee4j/mojarra#5231 |
Hi sorry to chime in here so late: The Github project above mentioned and MyFaces basically are the same implementation and done by me. I started the project outside of MyFaces a few years ago, because we had the same growing pains Mojarra has faced/is facing in this issue. The project was stalled in a working condition, but with no TCK testing for a while, due to Covid and projects for quite a while but I had time end of 2022 to wrap things up just in time for the MyFaces release (hence also my request and work to move the Ajax tests away from HTMLUnit). Atm the Github version usually a litte bit ahead of MyFaces (currently, 1 bugfix of a rare corner case, raised by Tobago, which I will merge the next 2-3 days). Either way the code was written for modern browsers and more importantly readability and only has one real source dependency to another library which I have written (not necessarily needed, but makes the code way more readable) the rest of the dependencies either are build or test dependencies. It does 2 target builds one for JSF 2.x (javax namespace used by Tobago) and JSF 4.x (jakarta namespace used by Tobgao and MyFaces) So yes the new code is way more advanced, feel free to rip out anything you need (it is ASL licensed so taking code from there into Jakarta should be a non issue, if you want I can relicense the entire code as ASL2/EPL dual license to make things easier for you guys. (I just have to ask a small number of people from the Tobago Team which have provided several unit tests as pull requests for permission) Just ping me or comment, if you need help or want to have a dual ASL2/EPL relicense of the code! |
MyFaces already has moved to ES6 level we cut old ropes with 4.0, but stepping back from a language pov it would be easy, since we are in TypeScript (but given the we also cut out old browsers on dom level as well this is theoretical es5 and modern dom level does not make sense)! There is nothing in the spec I am aware of which would prevent to go with ES6. It really depends where you want to make the cutoff point regarding browser support! |
Today in the frontend web client, Typescript is preferred, if consider to rewrite the jsf.js(
faces.js
in Faces 4.0) in TypeScript or add a@types/jsfjs
to the existing work, make it more interchangeable with the modern front-end technologies today.BWT, if possible to write the facelet template with the popular frameworks directly, such as React components, and make the Faces managed beans/components(CDI beans) in the background worked as React server renderers.
The text was updated successfully, but these errors were encountered: