-
Notifications
You must be signed in to change notification settings - Fork 399
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
Improve build process #1573
Comments
Try adding |
@evs-chris /slaps forehead, ticks checkbox |
I'm thinking of taking a stab at #1252. Would anyone be opposed to switching to Mocha, having individual test modules be UMD, and having a big aggregate UMD test suite for the grunt build to run? QUnit is broken in-browser for me right now, and I don't know about everyone else but AMD hurts my head a little. I think it may lower barrier to entry (#1251) a little to not use require.js for tests and the sample dev page. I have tried out using the Ractive bundle in samples and tests along with the sourcemaps, and (in Chrome) you get a nice AMD-ish experience albeit with a strange absolute path for the Ractive source (see gobble-relative-sourcemaps?). So, I'd like to:
Does that sound like an agreeable path forward? Taking it a step further, is there a reason not to replace grunt with npm scripts? [1] JSDom still requires gyp, which is awful for those unfortunate enough to have to run directly on Windows. I'd actually prefer the default method of testing to be in-browser and to remove phantomjs as a devDependency in the main package.json. Headless testing could be built into a build script using a sub-module (directory with its own package.json) for deployment checks and Travis. That would make getting started on Windows a thousand times easier and let those of us who use node 0.11 most of the time not have to switch back and forth to 0.10 (I have yet to get the phantomjs bindings to build with 0.11). |
Strongly in favour of all of this! The only hurdle I can see to ditching AMD is that some of the tests depend on individual modules, which might make stuff awkward - though I guess if each test module gets bundled and UMD-ified, and Ractive itself is skipped during that bundling process, then that wouldn't be too difficult to overcome. Sourcemaps are still a little wonky since there are multiple steps (6to5, bundling, and ultimately minification) - in theory sorcery will give you accurate mappings back to the source, though in practice.... It does also make IE bugs harder to debug, though we could mitigate that by annotating the bundled source code with module paths. Will open an issue on Esperanto. Definitely don't think we'd regret replacing PhantomJS with JSDOM. (Though I didn't realise it still requires gyp. I don't know how Windows people get any work done!) @rstacruz has our back: https://www.npmjs.com/package/mocha-jsdom
Nope. |
I have noticed that Chrome will jump to the wrong spot in the mapped file every now and then. In some situations, it will just jump to line 1. For init breakpoints/exceptions, it looks like Chrome is still preparing the map when it drops you on a line, so you end up offset by the UMD boilerplate when it does finish with the map. Overall though, it's pretty ok.
It's looking like JSDOM isn't quite complete enough for our test suite, and I've only gotten to the event tests (alphabetically). I'm looking at 29/328 failures where everything is happy in-browser for the most part. Note that Mocha only counts actual tests and not assertions like QUnit.
It does, but only for contextify, which is waaaay less painful to build than phantom.
Without VirtualBox or some equivalent, I'd be entirely without hair. I haven't found anything like htmlEqual for Mocha, so there are some oddities here and there depending on what browser you're using. IE apparently does namespaces a little differently, so it fails a test that Firefox and Chrome are ok with for SVG. It's easy to work around, though. Since Mocha has a built-in grep to narrow what tests you want to run, I vote we skip having tests for individual modules and just use the main page. That would eliminate the odd module test page generation step. It's kinda nice to be able to expand the test to see the code in it right in the browser. I'll try to get the rest of the tests ported over and a demo branch up tomorrow. I'd like to get some feedback and maybe see if someone else can get JSDOM to cooperate. |
Actually I ended up hand rolling that one - there was an existing plugin but IIRC it behaved strangely in some situations (or maybe didn't like SVG, or something). So it should be possible to just use this, except using whatever
Makes sense. So we'd use something like |
Nice! I completely missed that.
It seems that some of the test suite is not liking the transition because everything was good up to magic and then on merge and misc, already passing tests started failing. |
Will close this issue as most stuff is now taken care of. Still interested in using mocha everywhere, as it has some nice features, but I reckon that's a separate issue. In any case, there's currently a real dealbreaker in the form of mochajs/mocha#553 - there's no equivalent of QUnit's notrycatch option, which means you get a useless non-interactive non-sourcemapped stack trace in the browser, rather than a proper one in the console. |
Following #1485, there are a few tasks:
noConflict
Once that's out of the way, there are a few things we can do to tidy up the source code itself, some of which will decrease file size (using Esperanto instead of RequireJS+AMDClean already reduces the minified filesize a bit, but there's more we can do)
The text was updated successfully, but these errors were encountered: