tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis Stepanov <denis.stepa...@gmail.com>
Subject Re: Compatibility for 5.4
Date Thu, 25 Oct 2012 11:39:58 GMT
I'm looking into current changes and I have few suggestions.

Some time ago I have rewritten the javascript part of Tapestry using CoffeScript and pure
jQuery, I would like to use it in the future with minimal changes, to do so there should be
an abstract layer between core components and client logic.

Right now ProgressiveDisplay has this code:

jsSupport.require("core/zone").invoke("deferredZoneUpdate").with(clientId, link.toURI());

it is very implementation specific, I would suggest to create a service similiar to the ClientBehaviorSupport.
ProgressiveDisplay will call addProgressiveDisplay(Element element, String clientId, Link
link) first parameter should be always element to allow additional configuration. Client side
service implementaton could be easily replaced or extended.

Also Zone component:


     Element e = writer.element(elementName,
                "id", clientId,
                "data-container-type", "zone");

        if (insideForm)
        {
            JSONObject parameters = new JSONObject(RequestConstants.FORM_CLIENTID_PARAMETER,
formSupport.getClientId(),
                    RequestConstants.FORM_COMPONENTID_PARAMETER, formSupport.getFormComponentId());

            e.attribute("data-zone-parameters",
                    parameters.toString(compactJSON));
        }

should be:

  Element e = writer.element(elementName, "id", clientId);

  clientSupport.addZone(e);
 
  if (insideForm) {
	clientSupport.addZoneInsideFormParameters(e, formSupport.getClientId(), formSupport.getFormComponentId());
  }

Without the abstraction layer I'll need to fork Tapestry and refactor core components, I like
how you can override almost everythink using the IOC but when it is inside component there
is nothing you can do.

If you ask, why did I choose to rewrite javascript logic, it is because I think tapestry should
not build own javascript framework/library with all that wrappers and helpers, I can only
understand using requireJS to load javascript dependencies. Tapestry javascript support should
be one small minified file. Why to have all that modules when everyone could just contribute
to the main core module? What are advantages of using jsSupport.require("core/zone") instead
of jsSupport.require("core")? Why to have modules like "core/spi", "core/console", "core/events"?
I would use requireJS to have modules "jQuery", "underscore", "tapestry-core", "tapestry-core-53-compatibility".

My philosophy is to have simple javascript using pure jQuery without wrappers around ajax,
console etc. and using events as the interface between different parts.

Denis



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Mime
View raw message