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 2011/10/19 15:41:40 UTC

jsf.js code restructuration (Leo please read)

Hi everyone, I finally am through with my code refactoring with the 
exception of a small patch which must be done after the next step.

The next step would be following:
I have now several files.

a) *The jsf.js* which is the existing über file
b) *jsf-minimal-modern.js* which is the core jsf with a baseline of ie9+
c) *jsf-minimal.js* which is the same with a baseline of ie6

d) *jsf-i18n.js* which is the i18n language messages as separate 
include, which can be added to b and c if needed.

e) *jsf-legacy.js* which is only the code needed for firefox 3.5+ and 
ie6+ support (legacy browser suppot) in addition to minimal-modern.js

f) *jsf-experimental.js* experimental features which very likely will 
make it into future jsf versions, which also can be added to  b and c
(a has them in already)

So far this works out very well, but I am not sure where to host the 
files and how do we include it. Currently they are located on the same 
location as our uncompressed debugging files.

Ideally it should be that we can write something like

  <h:outputScript name="jsf-minimal-modern.js" library="myfaces" 
target="head"/>
  <h:outputScript name="i18n.js" library="myfaces" target="head"/>

And the links are correctly set and also a jsf.js include from an f:ajax 
or h:outputScript is subsequently suppressed.

But we probably need a patch in our impls for that mechanism.

Once this is established we can switch our standard file from *a* to *c* 
which makes more sense for almost all users. Leo what is your opinion on 
that.

Another option would be to allow a config param via web.xml so that one 
of the core *jsf.js* files is loaded as *jsf.js* and then add for instance

  <h:outputScript name="i18n.js" library="myfaces" target="head"/>
additionally. But even then I think we need a patch to reach the proper 
location for the additional files.



Werner




Re: jsf.js code restructuration (Leo please read)

Posted by Werner Punz <we...@gmail.com>.
Ok I patched the 2.1.4-SNAPSHOT core with the needed code to get the 
modular builds in.
Leonardo please review the patch before merging it in. I personally 
think I did not break anything, but having a second eye would make sense.

https://issues.apache.org/jira/browse/MYFACES-3361 has attached the 
patch for the core.



Werner


Am 10/20/11 12:48 PM, schrieb Werner Punz:
> Am 10/19/11 9:10 PM, schrieb Werner Punz:
>>
>> org.apache.myfaces.JSF_JS_MODE
>>
>> and these possible values:
>>
>> a) normal (by default)
>> b) minimal-modern
>> c) minimal
>> d) legacy
>> e) experimental
>>
>> I think the jsf-i18n.js should be on META-INF/resources/myfaces
>> instead META-INF\internal-resources\javax.faces .
>>
>> Does this sounds good? suggestions are welcome.
> Actually we only need three values
> normal which is ignored
> minimal
> and
> minimal-modern
>
> legacy and experimental are separate includes which should not be added
> by the runtime itself but by the user (the same as i-18n)
>
> Werner
>
>
>



Re: jsf.js code restructuration (Leo please read)

Posted by Werner Punz <we...@gmail.com>.
Am 10/19/11 9:10 PM, schrieb Werner Punz:
>
> org.apache.myfaces.JSF_JS_MODE
>
> and these possible values:
>
> a) normal  (by default)
> b) minimal-modern
> c) minimal
> d) legacy
> e) experimental
>
> I think the jsf-i18n.js should be on META-INF/resources/myfaces
> instead META-INF\internal-resources\javax.faces .
>
> Does this sounds good? suggestions are welcome.
Actually we only need three values
normal which is ignored
minimal
and
minimal-modern

legacy and experimental are separate includes which should not be added
by the runtime itself but by the user (the same as i-18n)

Werner



Re: jsf.js code restructuration (Leo please read)

Posted by Werner Punz <we...@gmail.com>.
Am 10/19/11 5:20 PM, schrieb Leonardo Uribe:
> Hi
>
> I remember with jsf-uncompressed.js there is a custom ResourceLoader
> that redirects javax.faces:jsf.js to that file. Maybe we can do
> something similar, and create another custom ResourceLoader. See:
>
> http://svn.apache.org/repos/asf/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/InternalClassLoaderResourceLoader.java
>
> The only question left is how users can configure this. I think a web
> config param could be created. For example (suggestions about better
> names are welcome)
>
> org.apache.myfaces.JSF_JS_MODE
>
> and these possible values:
>
> a) normal  (by default)
> b) minimal-modern
> c) minimal
> d) legacy
> e) experimental
>
> I think the jsf-i18n.js should be on META-INF/resources/myfaces
> instead META-INF\internal-resources\javax.faces .
>
> Does this sounds good? suggestions are welcome.
>
Sounds good to me, that way we do not break compatibility to mojarra in 
the page source,and I will take care that if mojarra is loaded the 
extension packages wont cause any browser errors.
I also will change the builds in a way that the extension packages will 
go into the myfaces subdirectory tomorrow.


Werner



Re: jsf.js code restructuration (Leo please read)

Posted by Leonardo Uribe <lu...@gmail.com>.
Hi

I remember with jsf-uncompressed.js there is a custom ResourceLoader
that redirects javax.faces:jsf.js to that file. Maybe we can do
something similar, and create another custom ResourceLoader. See:

http://svn.apache.org/repos/asf/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/resource/InternalClassLoaderResourceLoader.java

The only question left is how users can configure this. I think a web
config param could be created. For example (suggestions about better
names are welcome)

org.apache.myfaces.JSF_JS_MODE

and these possible values:

a) normal  (by default)
b) minimal-modern
c) minimal
d) legacy
e) experimental

I think the jsf-i18n.js should be on META-INF/resources/myfaces
instead META-INF\internal-resources\javax.faces .

Does this sounds good? suggestions are welcome.

regards,

Leonardo Uribe

2011/10/19 Werner Punz <we...@gmail.com>:
> Hi everyone, I finally am through with my code refactoring with the
> exception of a small patch which must be done after the next step.
>
> The next step would be following:
> I have now several files.
>
> a) *The jsf.js* which is the existing über file
> b) *jsf-minimal-modern.js* which is the core jsf with a baseline of ie9+
> c) *jsf-minimal.js* which is the same with a baseline of ie6
>
> d) *jsf-i18n.js* which is the i18n language messages as separate include,
> which can be added to b and c if needed.
>
> e) *jsf-legacy.js* which is only the code needed for firefox 3.5+ and ie6+
> support (legacy browser suppot) in addition to minimal-modern.js
>
> f) *jsf-experimental.js* experimental features which very likely will make
> it into future jsf versions, which also can be added to  b and c
> (a has them in already)
>
> So far this works out very well, but I am not sure where to host the files
> and how do we include it. Currently they are located on the same location as
> our uncompressed debugging files.
>
> Ideally it should be that we can write something like
>
>  <h:outputScript name="jsf-minimal-modern.js" library="myfaces"
> target="head"/>
>  <h:outputScript name="i18n.js" library="myfaces" target="head"/>
>
> And the links are correctly set and also a jsf.js include from an f:ajax or
> h:outputScript is subsequently suppressed.
>
> But we probably need a patch in our impls for that mechanism.
>
> Once this is established we can switch our standard file from *a* to *c*
> which makes more sense for almost all users. Leo what is your opinion on
> that.
>
> Another option would be to allow a config param via web.xml so that one of
> the core *jsf.js* files is loaded as *jsf.js* and then add for instance
>
>  <h:outputScript name="i18n.js" library="myfaces" target="head"/>
> additionally. But even then I think we need a patch to reach the proper
> location for the additional files.
>
>
>
> Werner
>
>
>
>