PDA

View Full Version : Include external libs in fiddle, like jasmine



halcwb
2 Aug 2013, 12:56 AM
Would it be possible to have fiddle include exclude external libs. Specifically, jasmine! Then fiddle could be used to generate actual unit tests. This would be great for bug reports or issues.

P.s. I think fiddle only let you select one lib. But if you just include jasmine in extjs, i.e. call it ext-test, then you could use it in fiddle and create unit tests.

mitchellsimoens
2 Aug 2013, 3:44 AM
I'm currently working on a more robust solution in this area. It's taking a while as it's a lot of coding to do what I am attempting but including any external JS/CSS will be supported.

On my personal wish list is to integrate jasmine natively in the fiddle but that is something down the road. There are some bugs that are more important.

mitchellsimoens
2 Aug 2013, 1:19 PM
Just an update... it actually took almost 3 days to do it but there is going to be a concept of a file system so you can have a full MVC stack or a lib directory or whatever. You can also add remote resources also. When I say "resource" I mean a JS or CSS file. I pushed this update to our testing environment to do some internal crunching on it. Next week sometime will probably push to the production server if all goes well as a beta2 or RC release.

Also fixed an issue in a live preview (outside the fiddle app UI) with mock data.

Am also looking into the search issue right now.

existdissolve
2 Aug 2013, 2:51 PM
Just an update... it actually took almost 3 days to do it but there is going to be a concept of a file system so you can have a full MVC stack or a lib directory or whatever. You can also add remote resources also.

This will be an awesome addition. Thanks for the update!

mitchellsimoens
2 Aug 2013, 2:53 PM
This will be an awesome addition. Thanks for the update!

:) Here is some proof even. We also are moving from regular neptune to charcoal neptune... the blue was too much blue for my taste.

45186

halcwb
3 Aug 2013, 7:23 AM
In the meantime, I succeeded with fiddling using my favorite lib Underscore, by just pasting the minified source code at the top and then start using it.

Note, if you save your fiddle, you should comment the minified line, otherwise formatting will occur resulting in a large number of lines.

5c

mitchellsimoens
4 Aug 2013, 9:22 AM
@halcwb

As part of this release coming this next week I have it where all code is automatically run through js_beautify or cssbeautify which in the case of using a minified file I can see being a bad thing. So as part of having a filesystem each file can have settings and I just added a setting to toggle this automatic beautify. There are two values, off or auto and defaults to auto. If you set to off, obviously it won't beautify it. If set to auto, it will actually try to determine if the file is a minified file. The way I do this is calculate number of characters per line and if over a threshold (750 characters right now) then it will not beautify it.

So in the case of underscore, it calculated there was about 2,200 characters per line which is over the 750 threshold so it didn't beautify that file.

Hopefully this will help. I'm keeping beautify on auto by default so that people's code quality will be better, I see lots of code with tabs/space mix, indention gone crazy etc but of course you can override this behavior.