Code Monkey home page Code Monkey logo

Comments (16)

wookiehangover avatar wookiehangover commented on May 27, 2024

re: Jasmine

I think that's entirely down to opinion whether backboners (there has got to be a better way to say that) prefer Jasmine over Qunit. Speaking personally, after using Jasime exclusively for about 6 months with several backbone apps, I switched to Qunit for a number reasons--the primary being that I feel like the test runner is "better" (better look/feel, stack traces, try/catch options).

I definitely agree that there's more noise in the community about testing Backbone with Jasmine, but I don't think that necessarily is a corollary to best practices. IMO the lynchpin to making backbone apps easier to test is using Sinon.js, not Jasmine.

That said, I'm interested in whatever's pragmatic.

@addyosmani / @tbranyen what do you think about including examples for both test suites?

from backbone-boilerplate.

addyosmani avatar addyosmani commented on May 27, 2024

@wookiehangover That's fair enough :) Perhaps having examples for both test suites would be a compromise?

from backbone-boilerplate.

tbranyen avatar tbranyen commented on May 27, 2024

Hey @addyosmani thanks so much for the feedback. I'm going to keep this issue open once this open sourced so others can chime in.

  • Yes to jasmine, I think it would work really well. How to integrate along side with qunit is the question, maybe two folders?
  • Have not given any thought to internationalization, but thats a serious question to be considered
  • Totally want require.js devs to feel at home here. Going to work on a r.js build task that will allow you to define your config
    options in one place. Once I get an app working in here with require.js I'll be happy to do a write up.
  • Yup Grunt is totally being used here. I'll add something in the readme in the build section about why a task-oriented build process makes sense over something like stitch/hem/r.js.
  • I'll look into @mklabs project.
  • I think a sample project is a great idea!
  • Looking into reviewing Backbone specific plugins

from backbone-boilerplate.

iros avatar iros commented on May 27, 2024

I think personally having two different test strategies in place that effectively produce the same result is overkill. We can pick one and stick to it. While the Backbone.js qunit tests are no good, us providing better ones is a worthwhile investment. QUnit is easier to get started with imho, making it a better introductory framework.

Internationalization is nice, but the boilerplate is useful to get started on a new project. Sadly, no one starts with internationalization in mind and if we were to add facilities to this off the bat it would make the development much more complicated for most developers. It's important, but I don't think should be in the core.

I think a sample project should be another github repo.

from backbone-boilerplate.

webxl avatar webxl commented on May 27, 2024

Re: sample project

This might sound a little crazy, but I think the primary sample should be another than a TODO app. @addyosmani already has a few of those already: https://github.com/addyosmani/backbone-boilerplates. The gallery gets my vote. Perhaps with some HTML5 video/canvas/etc. goodness

from backbone-boilerplate.

webxl avatar webxl commented on May 27, 2024

+1 for jasmine

from backbone-boilerplate.

addyosmani avatar addyosmani commented on May 27, 2024

@webxl I'm not sure if the project you meant to reference was this http://github.com/addyosmani/todomvc, but you're right :) It might be useful just showing the project implemented as a Todo app. They're generally quite simple and would enable someone to easily compare how Backbone's 'out of the box' Todo app compares with a version written using this boilerplate.

@iros +1 on a sample project being in another repo, also +1 on just having one testing framework in there if you think it makes more sense.

from backbone-boilerplate.

mklabs avatar mklabs commented on May 27, 2024

Hi guys,

Firstly, sorry for the delay, but I didn't get any notification for this thread :(

Secondly, a big thanks to @tbranyen for creating this boilerplate. That seems to be exactly what I need.

Thirdly, another big thanks to @cowboy for creating the awesome build tool that is grunt. The more I use it, the more I like it.

That being said and related to #10, I know that @webxl has done some work and opened a pull request regarding this, but I did some parallel work on it today and ended up with something that works quite well.

I've took a slightly different route by using socket.io and wrapping the static server creation in a grunt task.

Here's a gist to illustrate: https://gist.github.com/1621995

Basically, this task creates and setup a connect server (might be an express server as well) with the necessary configuration to setup socket.io. Then a custom middleware is used to trick the static middleware a little bit to inject a client-side script and establish a new websocket connection. The socket object created when a new connection is made is then stored through grunt's configuration (via config('socket', socket)) making it usable from another task (which will most likely be triggered by grunt's built-in watch task). Finally, when changes are detected, grunt would retrigger the foo tasks which will use the socket object(s) to emit back to clients some event (which would trigger a page reload).

If you're ok, I might clean it a little bit and issue a pull request.

from backbone-boilerplate.

tbranyen avatar tbranyen commented on May 27, 2024

Hey @mklabs I'd hold off on the pull request for now. I'm working on a new repository to contain all the build tasks. That way they can be tested, documented and distributed outside of the boilerplate project. In the future it'd be nice to have a command line utility to automatically fetch/update them. Maybe even through NPM...

from backbone-boilerplate.

mklabs avatar mklabs commented on May 27, 2024

Sweet. Sounds like a reasonable option and a really good idea. I'd love to see that happen (even more if it's done through npm :p)

from backbone-boilerplate.

tbranyen avatar tbranyen commented on May 27, 2024

Okay some updates:

  • Still yes to jasmine and the option will be there in a new release option.
  • Looking into Jed and figuring out /via documentation how to integrate would help for internationalization
  • there is now a requirejs/amd branch that shows how modules sit
  • I think Ben does a pretty good job explaining why grunt in his readme, perhaps I can link to that: https://github.com/cowboy/grunt (under why grunt exists)
  • still waiting on a task that can be contributed (might write one myself off @mklabs code)
  • yes i think a full app should be created
  • still want plugin (non-biased) reviews in the wiki

from backbone-boilerplate.

paulirish avatar paulirish commented on May 27, 2024

I feel like we should add a lazyweb-request for someone writing a QUnit adapter to use jasmine syntax. I've heard this from multiple people... they prefer jasmine semantics and syntax but the async and testrunner in qunit is better.

Possible to have the cake and eat it too?

  • also on i18n, if its still on the table, messageformat.js is probably a better option, but may be too early regardless, perhaps just in the docs for now

from backbone-boilerplate.

tbranyen avatar tbranyen commented on May 27, 2024

Updates to this:

  • Jasmine has been added as a test harness
  • internationalization is still on the table
  • RequireJS is merged and fully integrated
  • reload task issue moved to grunt-bbb
  • Full app created

from backbone-boilerplate.

addyosmani avatar addyosmani commented on May 27, 2024

@tbranyen \o/ That's awesome. Love how this project has evolved!

from backbone-boilerplate.

tbranyen avatar tbranyen commented on May 27, 2024

Yeah, seems like the last bits of this feedback are writing up documentation on integrating: https://github.com/creynders/grunt-jasmine-task and http://requirejs.org/docs/api.html#i18n

Once that's done, I think this issue is good to be closed. :)

from backbone-boilerplate.

tbranyen avatar tbranyen commented on May 27, 2024

This issue has long since been stagnant, closing now and forever hold its peace.

from backbone-boilerplate.

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.