morriz / backbone-everywhere Goto Github PK
View Code? Open in Web Editor NEWWorking demo that utilizes backbone on the server and client in a seamless fashion
Working demo that utilizes backbone on the server and client in a seamless fashion
Just wondering how these globals will work when multiple requests come in at the same time. Won't they cause race conditions? Is the global window object created once per session or the very first time anyone hits the server?
Hey Morriz, thanks a lot for your backbone-everywhere code, I have been trying to get it working on an app this weekend but using the default Backbone.sync, so eventually using $.ajax when requesting data.
There seems to be an incompatibility with using jsdom and node-jquery together, as im getting the following error when fetching a collection:
500 ReferenceError: status is not defined
at Function.ajax (/.../node_modules/jquery/dist/node-jquery.js:7365:17)
If you want to recreate the same error in your app, just make a call to $.ajax somewhere in one of your routers.
I suspect that somewhere 'this' is being rescoped on the ajax success/error callback but I'm not totally sure. Please if you have time could you help me out as im sure a lot of other people would benefit from having the default Backbone.sync method working with your method.
Thanks
Chris
Package.json is broken?
backbone-everywhere git:(master) npm install npm ERR! Couldn't read dependencies. npm ERR! Failed to parse json npm ERR! Unexpected string npm ERR! File: /Users/cjroebuck/Dev/backbone-everywhere/package.json npm ERR! JSON.parse Failed to parse package.json data. npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript. npm ERR! JSON.parse npm ERR! JSON.parse This is not a bug in npm. npm ERR! JSON.parse Tell the package author to fix their package.json file. npm ERR! npm ERR! System Darwin 11.1.0 npm ERR! command "node" "/usr/local/bin/npm" "install" npm ERR! cwd /Users/cjroebuck/Dev/backbone-everywhere npm ERR! node -v v0.4.10 npm ERR! npm -v 1.0.24 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/cjroebuck/Dev/backbone-everywhere/npm-debug.log npm not ok
Hi Morriz, me again ;)
Is there anyway to get rid of the getViewFunc() from the Backbone code. I know this is needed to send back the modified DOM to the client when its run on the server but wouldn't it be cool if we could listen to some DOM mutation event and be called back once the DOM has finished being modified or perhaps automatically wrap each router handler function with the res.send code, possibly using _.wrap?
I'm looking for a project that brings Backbone.js to Node.js.
This way, nodejs can use backbone to render any URL and package up the rest of backbone code to the browser for subsequence rendering.
I don't want any fancy feature like socket.io, database ORM. Just use plain backbone as is. Even though backbone might run on node, but it should make external rest api when dealing with data.
If you know of such project, then please let me know.
Thanks.
I run the demo app, enter a few songs and tracks, then click the songs/tracks links at the top, the songs/tracks are not rendering in the collection view, but they are being persisted as I can see the json being passed back with my song titles etc, also if I type in songs/1 in the url, then I get shown the song with id=1
Perhaps the 'reset' event of the collection is not being reacted to on the server, so that the html sent back is 'pre' the reset event is reacted to?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.