Description

If :main namespace supplied - under :none optimization settings :output-to file should goog.require it. This would also allow script inclusion to be unified regardless of the level of optimization supplied, i.e.:

<script type="text/javascript" src="foo.js"></script>

Instead of

<script type="text/javascript" src="out/goog/base.js"></script> <script type="text/javascript" src="foo.js"></script> <script type="text/javascript">goog.require("foo.core");</script>

Environment

None

Attachments

5
  • 0005-Update-samples-to-new-none-opt-usage.patch
    0005-Update-samples-to-new-none-opt-usage.patch
    03 Dec 2014, 09:22 AM
  • 0004-Emit-all-deps-into-a-single-file.patch
    0004-Emit-all-deps-into-a-single-file.patch
    03 Dec 2014, 09:22 AM
  • 0003-Emit-goog.base-into-deps-file.patch
    0003-Emit-goog.base-into-deps-file.patch
    03 Dec 2014, 09:22 AM
  • 0002-Emit-goog.base-configuration-constants.patch
    0002-Emit-goog.base-configuration-constants.patch
    03 Dec 2014, 09:22 AM
  • 03 Dec 2014, 09:22 AM

Activity

Show:

David Nolen January 25, 2015 at 5:44 AM

Andrew, I went ahead and tackled this one.

andrewhr January 25, 2015 at 5:24 AM

Thanks @dnolen for the feedback. I will work on this patch.

David Nolen January 25, 2015 at 3:25 AM

The approaches taken thus far are unnecessarily complex. All that needs to happen is for the generated :none script to document.write the needed scripts and goog.require the :main namespace. I will take a patch that does this.

Thomas Heller December 3, 2014 at 7:20 PM

No :main might as well behave like it does now, this way the feature is completely optional and will not break any existing code. Thats usually worth something, don't know how much because as I said, :main is mandatory in shadow-build.

ClojureScript itself should probably be more conservative than that. I imagine there are alot of projects that still use /out/goog/base.js + other in their HTML, that won't change over night.

Completed

Details

Assignee

andrewhr

Reporter

Patch

Code

Priority

Created September 6, 2014 at 8:04 AM
Updated January 25, 2015 at 5:44 AM
Resolved January 25, 2015 at 5:44 AM