Issue Details (XML | Word | Printable)

Key: MOJO-1139
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Harlan Iverson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Mojo

Create a JS fragment or similar that includes all JS necessary files

Created: 01/Jun/08 06:21 PM   Updated: 01/Jun/08 06:21 PM
Component/s: javascript-tools
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Environment: n/a

Complexity: Intermediate


 Description  « Hide
Create a JS fragment or similar that includes all JS necessary files.

Please leave feedback, maybe discuss on list.

The end result of this is two things:

  • convenience and a (more) compelling reason to use Maven for JS builds (where MAKE seems to have a lot of traction, what the?)
  • the foundation for functionality needed to create the biggest, most bad-assed Google AJAX API killer ever.

Think:
Mate Maven JS artifacts with the Dojo dependency system

This would be the use case:

I have MyCoolLib that depends on Prototype and Scriptaculous.
MyCoolLib is broken into core, and sub-functionalities A and B. Scriptaculous and possibly Prototype are further broken up using this same model.

I want to be able to include MyCoolLib (any sub module) and everything that it requires to run without explicitly knowing assembly/file names of packages that are depended upon within the HTML file.

===================================
Prototype

+- prototype.js

Scriptaculous

+- scriptaculous.js

+- dragdrop.js

+- slider.js

MyCoolLibrary

+- coolstuff_core.js

+- coolstuff_a.js

+- coolstuff_b.js
===================================

Order matters for both dependencies and local files (assemblies). MyCoolLib might be one or more JS files, and the order of its own files matter--likewise for each dependency.

  • One possible solution could be to always assume that every artifact has only one assembly.
  • Another would be to add an intra-assembly dependency extension to the assembler document, in its own namespace.

===================================

<assembler xmlns:dep="http://mojo.codehaus.org/javascript-maven-tools/#assembly-dependency">
<scripts>
<script>
<dep:dep script="prototype.js" groupId="com.prototype" artifactId="prototype"/>
<fileName>coolstuff_core.js</fileName>
<includes><!-- ... --></includes>
</script>

<script>
<dep:dep script="coolstuff_core.js"/>
<!-- slider depends on dragdrop, depends on scriptaculous, depends on prototype (which is already depended on by core) -->
<dep:dep script="slider.js" groupId="com.scriptaculous" artifactId="scriptaculous"/>
<fileName>coolstuff_a.js</fileName>
<includes><!-- ... --></includes>
</script>

<script>
<dep:dep script="coolstuff_core.js"/>
<fileName>coolstuff_a.js</fileName>
<includes><!-- ... --></includes>
</script>
</scripts>
</assembler>

===================================



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.