You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2015/10/20 15:56:27 UTC

[jira] [Commented] (TAP5-2511) Named AMD modules cannot be added to JavaScript stack

    [ https://issues.apache.org/jira/browse/TAP5-2511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14965132#comment-14965132 ] 

Jochen Kemnade commented on TAP5-2511:
--------------------------------------

I wonder what we should do if we find a define call with a name that does not match the module name, e.g. if the jquery module defined "jQuery" or "$" instead of "jquery"? Use the module name, use the original name in the define call? Fail?
By the way, there could be files that define multiple named modules at once, like our stacks do. What should happen if a module named "core" defines "t5/core/dom"?

> Named AMD modules cannot be added to JavaScript stack
> -----------------------------------------------------
>
>                 Key: TAP5-2511
>                 URL: https://issues.apache.org/jira/browse/TAP5-2511
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Jochen Kemnade
>
> The {{define}} statement rewriting logic in {{org.apache.tapestry5.internal.services.assets.JavaScriptStackAssemblerImpl.ModuleReader}} breaks stacks with named modules. For example, jquery 3.0-alpha1 (https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.js) uses
> {noformat}
> define( "jquery", [], function() {
> 		return jQuery;
> 	});
> {noformat}
> The ModuleReader turns that into
> {noformat}
> define("jquery", "jquery", [], function() {
> 		return jQuery;
> 	});
> {noformat} which will not work. We should probably not rewrite named define calls.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)