AngelDoReMi / closure-templates

Automatically exported from code.google.com/p/closure-templates
Apache License 2.0
0 stars 0 forks source link

Add support for defining RequireJS packages (patch included) #29

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Compile a soy template with a new option specified 
(--shouldWrapWithRequireDefFunction)

What is the expected output? What do you see instead?
The output JS should be wrapped in a "require.def" function, specifying package 
a slash delimited version of the namespace.  The output should also include a 
dependency on the soy_utils.js file

What version of the product are you using? On what operating system?
Not Applicable

Please provide any additional information below.
I've included a patch to add this functionality, and would greatly appreciate 
it being incorporated upstream

Thanks!

Original issue reported on code.google.com by jamonter...@gmail.com on 17 Sep 2010 at 2:15

Attachments:

GoogleCodeExporter commented 8 years ago
Sorry, I accidentally created this as a defect instead of an enhancement... and 
I don't seem to be able to change it.

Original comment by jamonter...@gmail.com on 17 Sep 2010 at 2:16

GoogleCodeExporter commented 8 years ago
Updated with the ability to specify the dependencies on the command line, 
rather than having them hard coded

Original comment by jamonter...@gmail.com on 17 Sep 2010 at 4:25

Attachments:

GoogleCodeExporter commented 8 years ago
We decided not to add requirejs support at this time, since it's (a) not part 
of Closure Tools and (b) not a de facto standard. But we'll keep an eye on it.

Original comment by kai.hu...@gmail.com on 25 Oct 2010 at 10:24

GoogleCodeExporter commented 8 years ago
That makes sense.  I'll play with this a bit more and see if I can come up with 
a generic way of decorating the output code that would work for requirejs, 
goog.provide, and any other future libraries in the space.

I'll update if I come up with something clean for it.  Thanks!

Original comment by jamonter...@gmail.com on 26 Oct 2010 at 12:41

GoogleCodeExporter commented 8 years ago
requireJS has now updated their API to conform to a commonJS asynchronous 
module definition proposal at 
http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition.  It's currently 
being used by RequireJS, Nodules, Dojo, Transporter, and partially implemented 
in Yabble as well.  I'm planning to update patch to conform to that as well, 
and I'll repost once that is done.

I look forward to your feedback on whether this would be accepted now that it 
is becoming a standard.

Thanks,
Jamon

Original comment by jamonter...@gmail.com on 15 Nov 2010 at 4:51

GoogleCodeExporter commented 8 years ago
I've updated my patch based on commonJS proposal.  Thanks in advance for 
considering this patch.

Jamon

Original comment by jamonter...@gmail.com on 15 Nov 2010 at 5:32

Attachments:

GoogleCodeExporter commented 8 years ago
accidentally forgot to update based to use "define" instead of "require.def", 
here's the updated version:

Original comment by jamonter...@gmail.com on 15 Nov 2010 at 5:38

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the info and the patches. However, Closure Templates is not 
currently set up to take in contributions from people not at Google.

Your patch will still be useful, though, because other users looking up this 
issue can download your patch and apply it locally.

Original comment by kai.hu...@gmail.com on 19 Nov 2010 at 2:44

GoogleCodeExporter commented 8 years ago
Closure Templates has migrated to GitHub: 
https://github.com/google/closure-templates. Please reopen this there if it's 
still an issue.

FYI, the project can now accept pull requests.

Original comment by brendan....@gmail.com on 27 Feb 2015 at 12:14