Giter Site home page Giter Site logo

bone.io's People

Contributors

benjaminadams avatar gitjustin avatar techpines avatar vic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bone.io's Issues

Build system for bone.io.js and bone.io.min.js

We need a build system to generate the javascript files in the top level directory of the project from the index.coffee file.

I'd like to use grunt, http://gruntjs.com/

Basically, in the top-level directory of the project. We want to get two files:

/bone.io.js
/bone.io.min.js

default route

I wanted a default route to run if there was not a match found. My route root can be defined in the module and is set on page render through bone.router.start({root:resp.path,pushState: true}). I was running into issues finding a simple work around.

My first question is am I overlooking something simple here?

If not, this is the solution I am using to add a catchall regex route. Is there a better way?

Add a defaultRoute as the last route:

'*': defaultRoute

and update routeToRegex:

routeToRegex = function(route) {
  var escapeRegExp, namedParam, optionalParam, splatParam;

  if(route === '*') {
    return new RegExp("([^\s]+)");
  } 

  optionalParam = /\((.*?)\)/g;
  namedParam = /(\(\?)?:\w+/g;
  splatParam = /\*\w+/g;
  escapeRegExp = /[\-{}\[\]+?.,\\\^$|#\s]/g;
  route = route.replace(escapeRegExp, "\\$&").replace(optionalParam, "(?:$1)?").replace(namedParam, function(match, optional) {
    if (optional) {
      return match;
    } else {
      return "([^/]+)";
    }
  }).replace(splatParam, "(.*?)");
  return new RegExp("^" + route + "$");

};

Object function has no method 'room' with code based on example

I put together an example to test out bone.io's pub/sub capabilities with the room functionality. I followed the example found on the website 'http://bone.io/#io/pub/sub'

I got the error below, stating that the object function does not have a method 'room'. It could be possible that I'm using it wrong, though I did base my test off the code from the site.

If you wish to see the code that triggers the error, I have it up in a repo and that specific file/line can be found here:

https://github.com/cbebry/quick-hapi-bone.io/blob/e81c720d2d15bc35633889aeb1e3e55c9a80c0d9/index.js#L45

The error:

/home/spectrum/quick-hapi-bone.io/index.js:45
                                this.room(data.room).broadcast({ message: data.message });
                                     ^
TypeError: Object function (socket) {
      return createIO(socket, options);
    } has no method 'room'
    at Function.bone.io.inbound.send (/home/spectrum/quick-hapi-bone.io/index.js:45:10)
    at /home/spectrum/quick-hapi-bone.io/node_modules/bone.io/lib/node/io.coffee:107:24
    at Object.async.eachSeries (/home/spectrum/quick-hapi-bone.io/node_modules/bone.io/node_modules/async/lib/async.js:127:20)
    at Socket.<anonymous> (/home/spectrum/quick-hapi-bone.io/node_modules/bone.io/lib/node/io.coffee:101:22)
    at Socket.EventEmitter.emit [as $emit] (events.js:95:17)
    at SocketNamespace.handlePacket (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/namespace.js:335:22)
    at Manager.onClientMessage (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/manager.js:488:38)
    at WebSocket.Transport.onMessage (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transport.js:387:20)
    at Parser.<anonymous> (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:39:10)
    at Parser.EventEmitter.emit (events.js:95:17)
    at finish (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:288:16)
    at Parser.expectHandler (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:299:15)
    at Parser.add (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
    at Parser.expect (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:499:10)
    at Parser.<anonymous> (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:298:18)
    at Parser.add (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
    at Parser.expect (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:499:10)
    at expectData (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:296:16)
    at Parser.opcodeHandlers.1 (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:313:9)
    at Parser.processPacket (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:533:8)
    at Parser.add (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
    at Parser.expect (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:499:10)
    at Parser.endPacket (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:553:8)
    at finish (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:291:14)
    at Parser.<anonymous> (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:299:15)
    at Parser.add (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
    at Parser.expect (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:499:10)
    at Parser.<anonymous> (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:298:18)
    at Parser.add (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
    at Parser.expect (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:499:10)
    at expectData (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:296:16)
    at Parser.opcodeHandlers.1 (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:313:9)
    at Parser.processPacket (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:533:8)
    at Parser.add (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:466:24)
    at Socket.<anonymous> (/home/spectrum/quick-hapi-bone.io/node_modules/socket.io/lib/transports/websocket/hybi-16.js:141:17)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:720:14)
    at Socket.EventEmitter.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:392:10)
    at emitReadable (_stream_readable.js:388:5)
    at readableAddChunk (_stream_readable.js:150:9)
    at Socket.Readable.push (_stream_readable.js:113:10)
    at TCP.onread (net.js:511:21)

Thank you for your time

Server support

Hi! bone.io looks really interesting. I did some work with NodeJS, but I still need to use other server-side programming languages and technologies for other stuff. Mostly I've been using SockJS and it's various implementations on top of other servers.

For now, bone.io seems to work with socket.io and on top of NodeJS (correct me if I'm wrong). Is there a plan for create a "pluggable" system, where I can map bone.io calls to SockJS (just an example) and then make it work with my own technologies? That would be really interesting.

Best regards,
Richard.

Support for frameworks other than express

I stumbled upon this framework, and it seems to fill a niche my team has been missing.

I've noticed that express seems to be the maine framework for this project, at least based on the available documentation. Does bone.io has support for switching out frameworks, or some sort of framework-agnostic approach of usage?

Thanks for creating bone.io. I look forward to seeing where this project goes, and being a user.

Event Logger

We need an event logger!

Four types of events:

  • Data
  • Interface
  • View
  • Route (worry about this later)

And here would be sample output for each:

Data: [Source:Action]
Interface: [Selector:EventName]
View: [Selector:Action]

Just go in and add console.log statements to lib/index.coffee.

We need tests

I need to setup the test harness, and then we need to start testing.

Project starter template

Great framework. Just curios to see if there is a scaffolded template to start a new project with?

Make Google Search Example More Fun

Create data.json file.

Should look something like this:

module.exports = [...]

Then in app.js, you would require it:

var list = require('./data');

PushState not working

In this example, clicking the link will redirect user to a 404 page.

<a href="/search/ohhyea">search</a>
<script>
    bone.router({
        routes: {
            "/search/:query": "find"
        },
        find: function(query, data) {
            alert(query);
        }
    });
    bone.router.start({pushState: true});
</script>

Route fires 2x

In this example, if you click link route will fire twice:

<a href="#search/ohhyea">search</a>
<script>
    bone.router({
        routes: {
            "search/:query": "find"
        },
        find: function(query) {
            alert(query);
        }
    });
    bone.router.start();
</script>

models and colletions support

I saw bone.io is quite similar to backbone.js for some aspect like router and views. Why has been decided to not provide a built in support for models and collections?
Is there another way to manage data structures? Have I to rely only on bone.io feature for that?

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.