Closed Scotchester closed 8 years ago
I don't understand the Travis failures at all. I also get totally different test failures locally. Would like to pair on this with someone tomorrow.
Also worth noting that Travis is still using these old versions:
$ node --version
v0.10.41
$ npm --version
1.4.29
$ nvm --version
0.23.3
Not sure why the tests are failing (it's happening locally as well). Regardless, shouldn't we leave jQuery and the component counting snippet even if cf-expandables isn't selected? Something like: https://gist.github.com/contolini/4c81fa0db1f8da52bf33
@contolini I actually started with that, and realized that we weren't getting jQuery as a dependency without cf-expandables. We'd have to add it as a standalone dependency to the generated project, which I don't think we want to do, do we?
Great catch. After some thought, I vote for something like this: https://gist.github.com/contolini/4c81fa0db1f8da52bf33
require( 'cf-expandables' )
line but comment it out so it can serve as an example.The rationale being: If someone doesn't want JS in their final product, it's trivial to delete the <script>
tag in index.html.
But if they do want JS, and all we provide them is an empty main.js file, figuring out the global.$ = require( 'jquery' )
line might be a PITA for them.
What about wanting JS but not wanting jQuery, though?
Maybe include a comment like this? https://gist.github.com/contolini/4c81fa0db1f8da52bf33#file-cf-js-L3
I still think I'd rather not install it by default. I'm not seeing the compelling reason to do that.
Some elucidation from the #fewd room:
i’d like to include it by default to help folks less-experienced with the JS bundling process the people who will want jQuery are less-experienced JS devs and i’m betting they’ll struggle with installing jquery and hooking it into webpack/browserify l33t folks who don’t rely on jquery will open main.js, see the require(‘jquery’) line, understand what it is, and delete it
Ok, yeah, I'm convinced. Updating now.
Updated and ready for review again!
And Travis is unborked! :tada:
:balloon:
Generated
main.js
no longer breaks on first run if the cf-expandables component was deselected during generation.Fixes #108
Notes:
Review: