Giter Club home page Giter Club logo

Comments (4)

teamdandelion avatar teamdandelion commented on May 21, 2024

Fixed, with changes to grunt it only compiles the full project if core files change, and if test/example code changes it only recompiles that section. We can still do a little more cleverness; if we make a change to the core files that does not change the typing, then there is no need to recompile the examples and test code since contract is unchanged. We can test this by diffing the plottable.d.ts file before and after compilation.

from plottable.

teamdandelion avatar teamdandelion commented on May 21, 2024

Right now our build (& times) looks like this:
compile core - 3s
compile test - 3s
compile examples - 3s

I suspect there is substantial overhead (about 3s) in running a seperate compile task, which means that compiling core, test, and examples is inefficient when we could just compile everything in around 3s in a single go. The reason we don't right now is that it's convenient to have all of the core compilation go to a single output file, but we want to send test compiled artifacts and examples compiled artifacts to different places. If we compiled everything to intermediate representation (eg axis.ts -> axis.js) and then concatenate the results together into the final script (plottable) then we would have a 3s full build instead of a 9s full build. The trick would be getting the scripts concatenated in the right order I think, right now the tscompiler is handling this for us. However, we know the order in which to put them (it is right there in reference.ts) so it would be as "simple" as writing a parser that uses a regex to suck it out of reference.ts and then concats them all together in that order.
@derekcicerone can you comment on whether this seems reasonable?

from plottable.

teamdandelion avatar teamdandelion commented on May 21, 2024

Although we can always take the simpler approach - just implement the proposal above to check whether the d.t.s interface changed - in most cases we won't change the typing so it won't trigger the recompile of test or examples, so we get 3s compile is most cases and 9s compile only in the case where we modify the plottable API.

from plottable.

derekcicerone-zz avatar derekcicerone-zz commented on May 21, 2024

I think you should use the concatenation support built into the TypeScript compiler. It already handles ordering of the files.

If you stick with the current tooling, consider breaking up the watch task into 3 separate targets if possible. Then each one will only run if necessary.

Beyond that I don't have much advice because I would solve this via IDE support - not Grunt.

from plottable.

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.