Code Monkey home page Code Monkey logo

Comments (11)

paulirish avatar paulirish commented on May 19, 2024

++

it'll need a fresh build of the closure compiler jar.. but dont see why not.

also you can now do inline base64 sourcemaps, fwiw.. http://trac.webkit.org/changeset/111389

from ant-build-script.

roblarsen avatar roblarsen commented on May 19, 2024

+++

I'm planning on playing catch up with issues here next week. I'm heading to India and there's only so much reading/sleeping I can do on the plane and in airports. I'll add this on the front of my queue since it's cool

from ant-build-script.

drublic avatar drublic commented on May 19, 2024

Rob, I've already played around a little bit with it. Will see what I can do until next week. Nothing pushed yet, but it will appear here.
Have a good flight and a lot of fun (I was in India in January, it's beautiful :))

from ant-build-script.

roblarsen avatar roblarsen commented on May 19, 2024

Thanks! I'm really excited for the trip. Both to see India itself and then to meet a bunch of people. I'll be meeting many Indian Sapient colleagues in person for the first time and then will also be presenting to a bunch of people from outside Sapient so it will be a great intro to the tech community in the NCR region.

Definitely let me know how it goes with the feature.

from ant-build-script.

drublic avatar drublic commented on May 19, 2024

After playing around a little bit yesterday I had the feeling I came up with the commits over here.
Problems I currently have: The file is not copied to the publish folder but remains in intermediate. Furthermore I had the impression that scripts are not concatenated correctly.

My test was: build from three scripts (plugins.js, somescript.js, script.js), all scripts were minified, somescript.js was not concatenated.
This may be because of changes I made or because of the new Closure Compiler version. I'll try to look into it again, but I wanted to share this so that you can look into it, if you want to.

from ant-build-script.

roblarsen avatar roblarsen commented on May 19, 2024

I started to look into this. We just solved the script concatenation holy grail, so I don't really want to revisit how we're doing it any time soon. This might be harder than just plugging in the latest version of Closure Compiler. The default way to generate one of these relies on concatenation in Closure Compiler. We're not doing that so... back to the drawing board. I really want this as a feature though so we'll have to sort it out somehow.

from ant-build-script.

roblarsen avatar roblarsen commented on May 19, 2024

Revisit.

from ant-build-script.

roblarsen avatar roblarsen commented on May 19, 2024

Revisited.

So... this is weird and I don't have a straightforward answer. @drublic your code works and could be built off of except for one diabolical issue- the issue that has me stumped (so far.)

Your code:

<apply executable="java" parallel="false">
  <fileset dir="${dir.source}/${dir.js}" excludes="${file.js.bypass}, **/*.min.js" includes="**/*.js">
  <exclude name="${dir.js}/otherscripts-concat.js"/>
  <exclude name="${dir.js}/scripts-concat.js"/>
  </fileset>          
  <arg line="-jar"/>
  <arg path="./${dir.build.tools}/${tool.compiler}"/>
  <arg line="--js"/>
  <srcfile/>
  <arg line="--compilation_level" />
  <arg value="${scripts.compilation.level}" />
  <arg line="--warning_level" />
  <arg value="${scripts.compilation.warninglevel}" />
  <arg line="--create_source_map" />
   <arg value="${basedir}/${dir.intermediate}/${dir.js}/source_map.js.map" />
  <arg line="--source_map_format=V3"/>
  <arg line="--js_output_file" />
  <mapper type="glob" from="*.js" to="${basedir}/${dir.intermediate}/${dir.js}/*.js"/>
  <targetfile/>
</apply>

...creates a single map file source_map.js.map that maps to (in my testbed) plugins.js

my understanding is that it should produce one _.js.map file for _each* file in the directory so that every file is mapped to a corresponding source JS when people inspect the code. I think this would work correctly concatenated as long as the source files were available to browse on the server. The problem is, there's no way (that I've seen) to do the same kind of filename mapping seen in the <mapper> element as a value for the --create_source_map argument. You can't have multiple mappers in an <apply> and I've tried some tricks with outputting things to stdout and using a <redirector> to send it to a properly mapped file (which in effect allows for two <mappers> per <apply>. that didn't work. I'd really like to get this in, but I'm not sure how to do it just yet.

Dear Github people, I am open to suggestions.

from ant-build-script.

roblarsen avatar roblarsen commented on May 19, 2024

Updating: Unless someone else comes in with a heroic pull request I'm pushing this out to a later release. I can do this using the <for> task and the list generated by the findAttribute class, but it will take some surgery on the whole minification and concatenation workflow. I will also need to make it configurable. It's going to take a little planning and there's not guarantee that it's going to work the way I expect so I'm pushing it out.

Still holding out hope for a hero :)

from ant-build-script.

thanpolas avatar thanpolas commented on May 19, 2024

so that every file is mapped to a corresponding source JS when people inspect the code

@roblarsen do you eventually concatenate the minified files for which a mapsource has been produced? I am having a problem when doing that as the sourcemaps become invalid for the produced concatenated file...

irrelevant: i guess you don't consider integrating grunt ha?

from ant-build-script.

roblarsen avatar roblarsen commented on May 19, 2024

old... and I'm not going to revisit this myself.

from ant-build-script.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.