You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Werner Punz <we...@gmail.com> on 2019/10/10 10:10:39 UTC

MyFaces reimplementation in typescript

Hi, this is not really official so its done when its done, but last friday
I have started to pick up my work regarding the
reimplementation of jsf.js for myfaces in typescript which I started a
while ago but put on hiatus due to more pressing issues.

The problem was, our old codebase is now around 10 years old.
I already de-junked some parts of it by removing the code for old browsers,
with IE11 being our main baseline.
But a lot has changed in those 10 years. In other words the code still is
outdated and ugly so time for a change.
What has changed  in the last 10 years?

First of all typescript, which is really a nice language and compiles into
various variants of ecmascript

Secondly the build system, node and webpack are a perfect combination which
remove a load of work

Third frameworks and browsers. Given that jsf.js is a library I dont have
the luxury of being able
to use third party libs like jquery, but fortunately many constructs are
either baked in into IE11+ variants
of browsers already or can be minimally shimmed without having to pull node
dependencies in.

The idea was to basically have a small set of core libs in the base which
easy the handling of node.querySelectorAll
have something streamlike and also optional, or in other words, reduce code
bloat by going functional
where it makes sence but omit it where it does not make sense at all. I
rely here on another project of mine
which started as tinkering into small functional variantes over core
functionality and a set of shims needed.
I do not want to pull a full dom query engine in given the browsers support
querying anyway.

Fourth: Functional patterns have become mainstream. Face it for things like
querying a dom tree, asynchronouse processing, which we do a lot
or handling deeply nested configurations etc.. functional patterns are
superior. I would not want to apply them over everything
but there are things where it makes absolutely sense to apply them, just
the right tool for the job and the good stuff is the browsers
have already core functionality baked in for many of those tasks.

Fifth testing: Javascript nowadays has a set of really well working and
nice testing frameworks.
So far I use a combination of mocha, sinon and chai and they are powerful
enough that
i can basically use unit testing on micro level aka, really on the method
entry points within the implementations by
dynamically mocking interfaces and objects.

So far I have about 57-58 testcases with about 30% of the entire
implementation covered.

Nothing except the tests is working yet, but I am making good progress:

I am doing this for now on a scratchpad project on github, you can follow
the progress there.
When I am ready I will merge the code into myfaces for the time being as
optional implementation which can
be turned on via a config parameter and once we know that everything is
stable enough we can relegate
the new impl as default (myfaces 3.0 maybe?)

Either way here is a sneak peek:

https://github.com/werpu/jsfs_js_ts/blob/master/src/main/typescript/impl/Impl.ts

and also here is the link to the temporary scratchpad project:

https://github.com/werpu/jsfs_js_ts/

Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
At the moment not really, but feel free to check out the github code
if you want and if you find areas for improvement tell me.
I will come back once, I need help.

I have not worked over the comments yet, so they are full of typos
and often missing (I am a lazy documenter)

I did not want to put the code into myfaces before I have
it up and running sufficiently, hence the github project.

At the moment I have covered most of the core functionality
with my tests the last area pending are the push part and the
redirect part.

So I think I am around 80% or so.



Am 18.10.19 um 14:24 schrieb Kito Mann:
> Awesome news, Werner! If there are any specific (and small :-) areas 
> that I can contribute, please let me know.
> ___
> 
> Kito D. Mann | @kito99 | Java Champion | Google Developer Expert | 
> LinkedIn <https://www.linkedin.com/in/kitomann/>
> Expert training and consulting: PrimeFaces, PrimeNG, JSF, Java EE, 
> Polymer, Web Components, Angular
> Virtua, Inc. | virtua.tech <http://virtua.tech>
> JSFCentral.com <http://JSFCentral.com> | @jsfcentral
> +1 203-998-0403 <tel:(203)%20998-0403>
> 
> * Listen to the Enterprise Java Newscast: http://enterprisejavanews.com 
> <http://enterprisejavanews.com/>
> 
> 
> 
> 
> On Thu, Oct 10, 2019 at 6:10 AM Werner Punz <werner.punz@gmail.com 
> <ma...@gmail.com>> wrote:
> 
>     Hi, this is not really official so its done when its done, but last
>     friday I have started to pick up my work regarding the
>     reimplementation of jsf.js for myfaces in typescript which I started
>     a while ago but put on hiatus due to more pressing issues.
> 
>     The problem was, our old codebase is now around 10 years old.
>     I already de-junked some parts of it by removing the code for old
>     browsers, with IE11 being our main baseline.
>     But a lot has changed in those 10 years. In other words the code
>     still is outdated and ugly so time for a change.
>     What has changed  in the last 10 years?
> 
>     First of all typescript, which is really a nice language and
>     compiles into various variants of ecmascript
> 
>     Secondly the build system, node and webpack are a perfect
>     combination which remove a load of work
> 
>     Third frameworks and browsers. Given that jsf.js is a library I dont
>     have the luxury of being able
>     to use third party libs like jquery, but fortunately many constructs
>     are either baked in into IE11+ variants
>     of browsers already or can be minimally shimmed without having to
>     pull node dependencies in.
> 
>     The idea was to basically have a small set of core libs in the base
>     which easy the handling of node.querySelectorAll
>     have something streamlike and also optional, or in other words,
>     reduce code bloat by going functional
>     where it makes sence but omit it where it does not make sense at
>     all. I rely here on another project of mine
>     which started as tinkering into small functional variantes over core
>     functionality and a set of shims needed.
>     I do not want to pull a full dom query engine in given the browsers
>     support querying anyway.
> 
>     Fourth: Functional patterns have become mainstream. Face it for
>     things like querying a dom tree, asynchronouse processing, which we
>     do a lot
>     or handling deeply nested configurations etc.. functional patterns
>     are superior. I would not want to apply them over everything
>     but there are things where it makes absolutely sense to apply them,
>     just the right tool for the job and the good stuff is the browsers
>     have already core functionality baked in for many of those tasks.
> 
>     Fifth testing: Javascript nowadays has a set of really well working
>     and nice testing frameworks.
>     So far I use a combination of mocha, sinon and chai and they are
>     powerful enough that
>     i can basically use unit testing on micro level aka, really on the
>     method entry points within the implementations by
>     dynamically mocking interfaces and objects.
> 
>     So far I have about 57-58 testcases with about 30% of the entire
>     implementation covered.
> 
>     Nothing except the tests is working yet, but I am making good progress:
> 
>     I am doing this for now on a scratchpad project on github, you can
>     follow the progress there.
>     When I am ready I will merge the code into myfaces for the time
>     being as optional implementation which can
>     be turned on via a config parameter and once we know that everything
>     is stable enough we can relegate
>     the new impl as default (myfaces 3.0 maybe?)
> 
>     Either way here is a sneak peek:
> 
>     https://github.com/werpu/jsfs_js_ts/blob/master/src/main/typescript/impl/Impl.ts
> 
>     and also here is the link to the temporary scratchpad project:
> 
>     https://github.com/werpu/jsfs_js_ts/
> 
> 
> 
> 
> 
> 



Re: MyFaces reimplementation in typescript

Posted by Kito Mann <ki...@virtua.com>.
Awesome news, Werner! If there are any specific (and small :-) areas that I
can contribute, please let me know.
___

Kito D. Mann | @kito99 | Java Champion | Google Developer Expert | LinkedIn
<https://www.linkedin.com/in/kitomann/>
Expert training and consulting: PrimeFaces, PrimeNG, JSF, Java EE, Polymer,
Web Components, Angular
Virtua, Inc. | virtua.tech
JSFCentral.com | @jsfcentral
+1 203-998-0403 <(203)%20998-0403>

* Listen to the Enterprise Java Newscast: http://enterprisejavanews.com




On Thu, Oct 10, 2019 at 6:10 AM Werner Punz <we...@gmail.com> wrote:

> Hi, this is not really official so its done when its done, but last friday
> I have started to pick up my work regarding the
> reimplementation of jsf.js for myfaces in typescript which I started a
> while ago but put on hiatus due to more pressing issues.
>
> The problem was, our old codebase is now around 10 years old.
> I already de-junked some parts of it by removing the code for old
> browsers, with IE11 being our main baseline.
> But a lot has changed in those 10 years. In other words the code still is
> outdated and ugly so time for a change.
> What has changed  in the last 10 years?
>
> First of all typescript, which is really a nice language and compiles into
> various variants of ecmascript
>
> Secondly the build system, node and webpack are a perfect combination
> which remove a load of work
>
> Third frameworks and browsers. Given that jsf.js is a library I dont have
> the luxury of being able
> to use third party libs like jquery, but fortunately many constructs are
> either baked in into IE11+ variants
> of browsers already or can be minimally shimmed without having to pull
> node dependencies in.
>
> The idea was to basically have a small set of core libs in the base which
> easy the handling of node.querySelectorAll
> have something streamlike and also optional, or in other words, reduce
> code bloat by going functional
> where it makes sence but omit it where it does not make sense at all. I
> rely here on another project of mine
> which started as tinkering into small functional variantes over core
> functionality and a set of shims needed.
> I do not want to pull a full dom query engine in given the browsers
> support querying anyway.
>
> Fourth: Functional patterns have become mainstream. Face it for things
> like querying a dom tree, asynchronouse processing, which we do a lot
> or handling deeply nested configurations etc.. functional patterns are
> superior. I would not want to apply them over everything
> but there are things where it makes absolutely sense to apply them, just
> the right tool for the job and the good stuff is the browsers
> have already core functionality baked in for many of those tasks.
>
> Fifth testing: Javascript nowadays has a set of really well working and
> nice testing frameworks.
> So far I use a combination of mocha, sinon and chai and they are powerful
> enough that
> i can basically use unit testing on micro level aka, really on the method
> entry points within the implementations by
> dynamically mocking interfaces and objects.
>
> So far I have about 57-58 testcases with about 30% of the entire
> implementation covered.
>
> Nothing except the tests is working yet, but I am making good progress:
>
> I am doing this for now on a scratchpad project on github, you can follow
> the progress there.
> When I am ready I will merge the code into myfaces for the time being as
> optional implementation which can
> be turned on via a config parameter and once we know that everything is
> stable enough we can relegate
> the new impl as default (myfaces 3.0 maybe?)
>
> Either way here is a sneak peek:
>
>
> https://github.com/werpu/jsfs_js_ts/blob/master/src/main/typescript/impl/Impl.ts
>
> and also here is the link to the temporary scratchpad project:
>
> https://github.com/werpu/jsfs_js_ts/
>
>
>
>
>
>
>

Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Am 10.10.19 um 12:10 schrieb Werner Punz:
> Hi, this is not really official so its done when its done, but last 
> friday I have started to pick up my work regarding the
> reimplementation of jsf.js for myfaces in typescript which I started a 
> while ago but put on hiatus due to more pressing issues.
> 

Sorry for the misleading title, I wanted to write myfaces jsf.js 
implementation.

Cheers

Werner



Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Hi

Status: Xhr Core Functionality tested except for the file upload part,
Push Code moved over but still needs tests

Whats left:
Multipart requests still pending
Some additional tests which check the request parameter patterns
Tests for push
Integration tests must pass on all supported browsers


Here is the code coverage so far

https://imgur.com/a/wEmO2lH



Am Do., 10. Okt. 2019 um 12:10 Uhr schrieb Werner Punz <
werner.punz@gmail.com>:

> Hi, this is not really official so its done when its done, but last friday
> I have started to pick up my work regarding the
> reimplementation of jsf.js for myfaces in typescript which I started a
> while ago but put on hiatus due to more pressing issues.
>
> The problem was, our old codebase is now around 10 years old.
> I already de-junked some parts of it by removing the code for old
> browsers, with IE11 being our main baseline.
> But a lot has changed in those 10 years. In other words the code still is
> outdated and ugly so time for a change.
> What has changed  in the last 10 years?
>
> First of all typescript, which is really a nice language and compiles into
> various variants of ecmascript
>
> Secondly the build system, node and webpack are a perfect combination
> which remove a load of work
>
> Third frameworks and browsers. Given that jsf.js is a library I dont have
> the luxury of being able
> to use third party libs like jquery, but fortunately many constructs are
> either baked in into IE11+ variants
> of browsers already or can be minimally shimmed without having to pull
> node dependencies in.
>
> The idea was to basically have a small set of core libs in the base which
> easy the handling of node.querySelectorAll
> have something streamlike and also optional, or in other words, reduce
> code bloat by going functional
> where it makes sence but omit it where it does not make sense at all. I
> rely here on another project of mine
> which started as tinkering into small functional variantes over core
> functionality and a set of shims needed.
> I do not want to pull a full dom query engine in given the browsers
> support querying anyway.
>
> Fourth: Functional patterns have become mainstream. Face it for things
> like querying a dom tree, asynchronouse processing, which we do a lot
> or handling deeply nested configurations etc.. functional patterns are
> superior. I would not want to apply them over everything
> but there are things where it makes absolutely sense to apply them, just
> the right tool for the job and the good stuff is the browsers
> have already core functionality baked in for many of those tasks.
>
> Fifth testing: Javascript nowadays has a set of really well working and
> nice testing frameworks.
> So far I use a combination of mocha, sinon and chai and they are powerful
> enough that
> i can basically use unit testing on micro level aka, really on the method
> entry points within the implementations by
> dynamically mocking interfaces and objects.
>
> So far I have about 57-58 testcases with about 30% of the entire
> implementation covered.
>
> Nothing except the tests is working yet, but I am making good progress:
>
> I am doing this for now on a scratchpad project on github, you can follow
> the progress there.
> When I am ready I will merge the code into myfaces for the time being as
> optional implementation which can
> be turned on via a config parameter and once we know that everything is
> stable enough we can relegate
> the new impl as default (myfaces 3.0 maybe?)
>
> Either way here is a sneak peek:
>
>
> https://github.com/werpu/jsfs_js_ts/blob/master/src/main/typescript/impl/Impl.ts
>
> and also here is the link to the temporary scratchpad project:
>
> https://github.com/werpu/jsfs_js_ts/
>
>
>
>
>
>
>

Re: MyFaces reimplementation in typescript

Posted by Hazem Saleh <ha...@apache.org>.
I think this a great idea Werner. Thanks for bringing this to the group.

Thanks and Best Regards

> On Oct 10, 2019, at 5:00 PM, Werner Punz <we...@gmail.com> wrote:
> 
> Am 10.10.19 um 12:10 schrieb Werner Punz:
>> Hi, this is not really official so its done when its done, but last friday I have started to pick up my work regarding the
>> reimplementation of jsf.js for myfaces in typescript which I started a while ago but put on hiatus due to more pressing issues.
> 
> Ok first numbers, unless I have forgotten anything, the codebase now is after
> compression including i18n around 67 kbyte before 100kbyte.
> Not that this number matters anything anymore, given that modern devices
> are fast and have lots of storage.
> But it shows that I dropped 33% code so far compared to the already dejunked js version.
> 
> 
> 

Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Update:

Currently I am atm at 66 implemented tests and the parts covered
so far are up to the request -> xhr request queue -> request response call

The entire response part will be tackled next, so my guess is, roughly 
50% of the codebase now is reimplemented and so far very clean and 
maintainable.


Small examples (method documentation partially still pending)


https://github.com/werpu/jsfs_js_ts/blob/master/src/main/typescript/impl/util/AsyncQueue.ts

https://github.com/werpu/jsfs_js_ts/blob/master/src/main/typescript/impl/Impl.ts

https://github.com/werpu/jsfs_js_ts/blob/master/src/main/typescript/impl/xhrCore/XhrRequest.ts

You can check the rest out yourself.

I will constantly work to clean out even the already rewritten code.
Number one prio this time simply is maintainability before performance
and memory usage.
We are not as constrained anymore as 10 years ago.



Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Am 10.10.19 um 12:10 schrieb Werner Punz:
> Hi, this is not really official so its done when its done, but last 
> friday I have started to pick up my work regarding the
> reimplementation of jsf.js for myfaces in typescript which I started a 
> while ago but put on hiatus due to more pressing issues.
> 

Ok first numbers, unless I have forgotten anything, the codebase now is 
after
compression including i18n around 67 kbyte before 100kbyte.
Not that this number matters anything anymore, given that modern devices
are fast and have lots of storage.
But it shows that I dropped 33% code so far compared to the already 
dejunked js version.




Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Biweekly update...

Sorry for that, but I was bound by work last week, so I was able
to pick up the work today in the morning.

I debugged some minor issues Udo discovered out today. Thanks Udo
for doing a session here in Vienna with me.

It now works more or less in the Tobago Codebase he is working on.
So please try to use the implementation and send me bugs on github (for the
time being until i have moved the code into myfaces then things will 
move over to jira).

After christmas I will start a discussion on how to integrate the code 
into myfaces. So that we can get the code into 3.0-M2 or MyFaces Next M2
or however we are going to call it.


Werner


Am 29.11.19 um 12:53 schrieb Werner Punz:
> Weekly update:
> 
> Function complete:
> 
> The new codebase now is function complete, I just added an alpha-1 tag.
> Work is still done regarding improving the code a little bit
> improving the jsdoc  comments and also Udo wants to get something 
> regarding shadow dom updates in.
> 
> But we are now on the same function level except for the dropped stuff 
> as the old implementation.
> 
> So what does that mean? The code is not fully ready to be merged into 
> the myfaces codebase but you can start to test it by dropping it in 
> yourself.
> 
> In https://github.com/werpu/jsfs_js_ts/tree/master/dist/window
> you can find builts for the development and production environments.
> Please drop it in and give it a testrun, any feedback, negative, 
> positive, bugs, is appreciated.
> 
> Cheers
> 
> Werner
> 
> 


Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Weekly update:

Function complete:

The new codebase now is function complete, I just added an alpha-1 tag.
Work is still done regarding improving the code a little bit
improving the jsdoc  comments and also Udo wants to get something 
regarding shadow dom updates in.

But we are now on the same function level except for the dropped stuff 
as the old implementation.

So what does that mean? The code is not fully ready to be merged into 
the myfaces codebase but you can start to test it by dropping it in 
yourself.

In https://github.com/werpu/jsfs_js_ts/tree/master/dist/window
you can find builts for the development and production environments.
Please drop it in and give it a testrun, any feedback, negative, 
positive, bugs, is appreciated.

Cheers

Werner



Am 22.11.19 um 17:45 schrieb Werner Punz:
> The usual weekly update...
> 
> Changes can be seen as usual on the github project:
> 
> https://github.com/werpu/jsfs_js_ts
> 
> Following
> 
> all my integration tests now pass
> IE11 support now is in
> 
> I now also have relative concrete code and performance numbers
> 
> dev build: unmangled roughly 250 kbypte,
> prod: compressed es5 level 89Kbyte,
> if you pull the es level up to es2015, 69kbyte.
> Higher ES Levels than 2015 don´t have a huge impact anymore.
> 
> Speed, roughly 25% slower than the old code, which was highly optimized 
> and low level
> on an extreme case with a form with a few hundred inputs (my spreadsheet 
> test) on chrome.
> IE11 might have a higher hit, not tested yet.
> 
> The reason is a higher abstraction I have. Instead of operating directly
> on nodes and setting the attributes straight on dom
> I now operate on JQuery like monads and selectors which then route into 
> the dom.
> Instead of looping over elements, I stream, flatmap map and reduce them.
> Instead of pulling the map and having asynchronous callbacks I work now 
> with
> promises and shim them if not provided.
> 
> All this improves readability but sacrifices some performance.
> Given that normally the performance of the ajax part is not really where 
> the problem is,
> I can live with that for the time being, should the users complain
> (which I frankly doubt given that jquery and other frameworks
> usually provide bigger slowdowns), then I could have another round of 
> optimizations.
> 
> I guess 5-10% still is possible without sacrificing readability too much.
> 
> The plus side is, the code is very readable now and we can ramp
> up Ecmascript versions on the fly without a single code change.
> 
> Happy weekend
> 
> Werner
> 
> 
> 
> 
> 
> 
> 
> 
> Am Fr., 15. Nov. 2019 um 16:24 Uhr schrieb Werner Punz 
> <werner.punz@gmail.com <ma...@gmail.com>>:
> 
>     Another small update...
> 
>     112 Tests atm (including the base framework)
> 
>     and the first 9 of my around 18 integration tests now pass properly,
>     have not looked to deeply into the others so I am not sure how many
>     really still fail atm.
> 
>     The build now also works on windows, the reason for that was, that I
>     have to send in my Mac for repairs soon (keyboard), so I had to move
>     the
>     build over to the desktop computer and for testing ie11 doing it on
>     Windows 10 makes perfect sense.
> 
>     Also the viewstate handling now got a major cleanup and is very readable
> 
>     https://gist.github.com/werpu/f46ccb54ce89acc0df933050df35f3cf
> 
>     I still postpone the eval and viewstate to the post update processing
>     phase on the client
>     this has never caused any troubles with the old implementation so I
>     keep
>     it, it just now is cleaner.
> 
>     In the example the viewstate is stored and then after all udpates are
>     performed the viewstate is applied by the second method.
> 
> 
>     So what is still pending...
> 
>     a) First all my 18 integration tests must pass and I have to convert
>     parts of them to permanently integrated unit tests where it makes sense.
>     (just ported the test for the viewstate handling over into a unit test)
> 
>     b) I have to get the code then running on the only supported legacy
>     browser (IE11)
>     it should theoretically work with a bunch of fixes, practically I
>     probably have to change the
>     packaging format and other smaller tweaks.
> 
> 
> 
> 
> 



Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
The usual weekly update...

Changes can be seen as usual on the github project:

https://github.com/werpu/jsfs_js_ts

Following

all my integration tests now pass
IE11 support now is in

I now also have relative concrete code and performance numbers

dev build: unmangled roughly 250 kbypte,
prod: compressed es5 level 89Kbyte,
if you pull the es level up to es2015, 69kbyte.
Higher ES Levels than 2015 don´t have a huge impact anymore.

Speed, roughly 25% slower than the old code, which was highly optimized and
low level
on an extreme case with a form with a few hundred inputs (my spreadsheet
test) on chrome.
IE11 might have a higher hit, not tested yet.

The reason is a higher abstraction I have. Instead of operating directly
on nodes and setting the attributes straight on dom
I now operate on JQuery like monads and selectors which then route into the
dom.
Instead of looping over elements, I stream, flatmap map and reduce them.
Instead of pulling the map and having asynchronous callbacks I work now
with
promises and shim them if not provided.

All this improves readability but sacrifices some performance.
Given that normally the performance of the ajax part is not really where
the problem is,
I can live with that for the time being, should the users complain
(which I frankly doubt given that jquery and other frameworks
usually provide bigger slowdowns), then I could have another round of
optimizations.

I guess 5-10% still is possible without sacrificing readability too much.

The plus side is, the code is very readable now and we can ramp
up Ecmascript versions on the fly without a single code change.

Happy weekend

Werner








Am Fr., 15. Nov. 2019 um 16:24 Uhr schrieb Werner Punz <
werner.punz@gmail.com>:

> Another small update...
>
> 112 Tests atm (including the base framework)
>
> and the first 9 of my around 18 integration tests now pass properly,
> have not looked to deeply into the others so I am not sure how many
> really still fail atm.
>
> The build now also works on windows, the reason for that was, that I
> have to send in my Mac for repairs soon (keyboard), so I had to move the
> build over to the desktop computer and for testing ie11 doing it on
> Windows 10 makes perfect sense.
>
> Also the viewstate handling now got a major cleanup and is very readable
>
> https://gist.github.com/werpu/f46ccb54ce89acc0df933050df35f3cf
>
> I still postpone the eval and viewstate to the post update processing
> phase on the client
> this has never caused any troubles with the old implementation so I keep
> it, it just now is cleaner.
>
> In the example the viewstate is stored and then after all udpates are
> performed the viewstate is applied by the second method.
>
>
> So what is still pending...
>
> a) First all my 18 integration tests must pass and I have to convert
> parts of them to permanently integrated unit tests where it makes sense.
> (just ported the test for the viewstate handling over into a unit test)
>
> b) I have to get the code then running on the only supported legacy
> browser (IE11)
> it should theoretically work with a bunch of fixes, practically I
> probably have to change the
> packaging format and other smaller tweaks.
>
>
>
>
>
>

Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Another small update...

112 Tests atm (including the base framework)

and the first 9 of my around 18 integration tests now pass properly, 
have not looked to deeply into the others so I am not sure how many 
really still fail atm.

The build now also works on windows, the reason for that was, that I 
have to send in my Mac for repairs soon (keyboard), so I had to move the 
build over to the desktop computer and for testing ie11 doing it on 
Windows 10 makes perfect sense.

Also the viewstate handling now got a major cleanup and is very readable

https://gist.github.com/werpu/f46ccb54ce89acc0df933050df35f3cf

I still postpone the eval and viewstate to the post update processing 
phase on the client
this has never caused any troubles with the old implementation so I keep 
it, it just now is cleaner.

In the example the viewstate is stored and then after all udpates are 
performed the viewstate is applied by the second method.


So what is still pending...

a) First all my 18 integration tests must pass and I have to convert 
parts of them to permanently integrated unit tests where it makes sense.
(just ported the test for the viewstate handling over into a unit test)

b) I have to get the code then running on the only supported legacy 
browser (IE11)
it should theoretically work with a bunch of fixes, practically I 
probably have to change the
packaging format and other smaller tweaks.






Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Am 08.11.19 um 15:30 schrieb Werner Punz:

> Might be ideal to have it in for 3.0.0-M2 so that the users can start to 
> field test it.
> 
> 
Small update, filesizes

67054 Nov 11 20:04 jsf.js
17095 Nov 11 20:04 jsf.js.br
19503 Nov 11 20:04 jsf.js.gz
327790 Nov 11 19:28 main.js.map

There might be some possibility to reduce the code further more
but not without sacrificing readability by removing parts
of the underlying framework (which is bundled in)

I guess we can live with that. I also enabled extra
build outputs with brotli and gzip compression.
You can see those sizes there, we should think about
serving those instead of the raw js file in prod.
(gzip is ie11 supported, brotli in the newest browsers)



Cheers

Werner







Re: MyFaces reimplementation in typescript

Posted by Werner Punz <we...@gmail.com>.
Am 10.10.19 um 12:10 schrieb Werner Punz:
> Hi, this is not really official so its done when its done, but last 
> friday I have started to pick up my work regarding the
> reimplementation of jsf.js for myfaces in typescript which I started a 
> while ago but put on hiatus due to more pressing issues.

Another status update. I have covered now everything except multipart 
requests. Also I have updated to typescript 3.7+ due to the elvis 
operators they just added, that way I could reduce some usage of my own 
framework which partially emulated an elvis propert resolution, a little 
bit and replace it with in language constructs.

Lots of tests already are implemented and cover now the entire
implementation (test coverage itself still is a tad too low for some parts)

You can see it here https://imgur.com/a/cpwyucP,
So what is left:

Next week I probably will dump the codebase the first time into my
browser based integration tests, to see how it works and if it works for 
the first time and then also the first checks against IE11 will be 
performed.

After that work on xhr, then Udo requested to have a talk
about what we can do about shadow dom support on the 13th
of december.

So I expect a first implementation I can commit into the myfaces 
codebase sometime early next year (take this with a grain of salt)

Might be ideal to have it in for 3.0.0-M2 so that the users can start to 
field test it.