New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start down path of new build system: #528
Conversation
- Move tests to karma test runner and mocha framework, also adding chai assertions - Add gulp tasks for testing, watching, concatting and compressing - Update travis file to use new build system - Remove jstestDriver stuff - Reorganize a bit so that it's easier to see what's going on - Create a dist folder to hold the output of builds (should probably look at having a bower branch/repository where these are held, instead of master)
@@ -13,7 +13,7 @@ page. For instance, instead of doing this: | |||
do this: | |||
|
|||
```html | |||
<script type="text/javascript" src="dygraph-dev.js"></script> | |||
<script type="text/javascript" src="dygraph-combined.dev.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dygraph-dev was pretty fragile due to the ordering of the files. The build system now creates a dygraph-combined.dev.js that puts everything in the right order, maintains that order in one place and includes the dygraph-options file that is only for dev.
This is fantastic! I'm on vacation at the moment, but I'll plan to take a look at this sometime in the few days. |
Also cc @kberg in case he'd like to take a look. |
Sorry for the slow responses! I'll plan to take a look at it this week. |
Apologies for the long radio silence. I'm looking at this now. |
No worries, I understand things get in the way. |
First of all: a huge thanks for doing this! I would like to merge this once we get a few issues sorted out. It will make me very happy to replace the home-grown dygraphs build system (with lots of shell scripts) with something more modern & standard. Again, sorry the review took so long. The good news is that I haven't been reviewing any other dygraphs code, either (only one PR has been merged since you sent yours out), so the merge conflicts shouldn't be difficult to resolve. My biggest bit of feedback is that I'd like to maintain file revision history (and keep I love that we're getting code coverage! It would be nice to get it on a per-file basis, though, so that we could act on it and publish it on coveralls.io. I've run into issues with code coverage & source maps in other projects. I solved it in one using this script, which takes an LCOV code coverage file and applies a source map to it. Something similar would work for this setup, though this isn't necessarily a problem that needs to be solved in this PR. I'm curious to hear your thoughts on gulp vs. grunt. I have no strong preference either way. More specific questions/nits:
If you're up for doing one more round of changes on this, I think it's basically good to go. We should be able to get it in in less than two months :) |
I can answer a few of these right now, the rest is going to have to come at a later date when I can actually work on it.
Also, you can specify ".only" on any "describe" or "it" to run just that test for development, which would reduce run time significantly.
|
Oh, and gulp vs grunt, I prefer gulp for its pipeline management versus config management that grunt does. Basically in gulp you setup a bunch of pipelines and manage input/output. Grunt you configure a bunch of plugins ahead of time and then run a bunch of tasks individually. |
The repo I referenced runs tests using the concatted (but not minified) source. Then it uses the script to map (coverage on concatted, source map)→coverage on sourcemapped files. I'm all in favor of dygraphs using some kind of module system to track dependencies, but I don't think we have to hold off on getting coverage data until then.
My preference is to only commit the
I'm fine with this so long as we drop the Alternatively, we could get rid of
As discussed above, I'd prefer to keep
My preference would be to keep the primary files (
I don't follow this. dygraphs doesn't depend on jQuery. It doesn't depend on anything!
I'm fine either way, I'd just like to have it so that running |
(also, let me know if you'd prefer me to take it over from here—I'm happy to do so.) |
I'm playing around with a variation on this. One thing I noticed: I don't think the |
Looks like it had to be:
|
Sorry for going silent, I got slammed at work with an Alpha release that took all of my mental cycles. This is the first weekend I've had back. I had not seen that error, I'll spend some time today, seeing if I can do a two-stage commit to maintain the history you're looking for. |
Hey there -- I've actually been hacking around on getting this going today, too. Unless you feel strongly, I think it's going to be easiest if I take it from here. (BTW, did you script conversion of the tests? that would be a very helpful script to have!) |
Alright, I'll let you take it. I did not script that conversion, there were too many inconsistencies between tests, so I just did it by hand. |
Wow! I'm impressed (& appreciative!) of the time you must have put into that manual migration. I'm drilling down into a few remaining Karma failures in my branch. Do you know if there's a simple way to pass a |
I've sent out #565 which supersedes this. Please take a look if you're so inclined! And a huge thanks for setting this all up. You've helped modernize dygraphs in a big way. |
With karma you can run a reduced set (including one) of tests by placing a ".only" in any describe or it. All tests can be run in a real browser by passing the command line option for the browser or setting it in the karma.conf. I typically will have two different run configurations in my webstorm ide to run in phantomjs or chrome. But you could do it with a parameterized gulp take too. |
I'm pretty sure we don't want to push this to master, but that's where this was diffed against.