EzDevInfo.com

meteor

Meteor, the JavaScript App Platform Meteor

Can Meteor be used with PhoneGap?

Can a Meteor template be packaged up and deployed as a PhoneGap application?


Source: (StackOverflow)

How does Meteor's reactivity work behind the scenes?

I have read the docs and looked at the source behind reactivity, but I don't understand it.

Can someone explain how this works behind the scenes, as it looks like magic to me :).


Source: (StackOverflow)

Advertisements

How would one handle a file upload with Meteor?

What would be the canonical way to handle a file upload with Meteor?


Source: (StackOverflow)

How to use the existing mongodb in a meteor project?

Let's say there is a running mongodb server for a GUI client (by wxPython) for a while. If we are gonna play with meteor with this mongodb server, how to do that?


Source: (StackOverflow)

How can Meteor apps be tested? [closed]

What are the recommended ways to test web applications developed with the framework?

The meteor unofficial FAQ entry on TDD best practices is quite short.


Source: (StackOverflow)

How to expose a RESTful Web Service using Meteor

How would you go about creating a restful web service using Meteor. I would like to create apps in Appcelerator that hook into the same backend.

Can Meteor solve this problem?


Source: (StackOverflow)

Can Meteor live changes have animations?

How does Meteor handle live changes? For instance I don't want changes to be instantaneous, but with some kind of animation of sorts. If we place the items being changed using css animations/transitions does this work? What about jQuery animations for older browsers?


Source: (StackOverflow)

Implementing MongoDB 2.4's full text search in a Meteor app

I'm looking into adding full text search to a Meteor app. I know MongoDB now supports this feature, but I have a few questions about the implementation:

  • What's the best way to enable the text search feature (textSearchEnabled=true) in a Meteor app?
  • Is there a way to add an index (db.collection.ensureIndex()) from within your app?
  • How can you run a Mongo command (i.e. db.quotes.runCommand( "text", { search: "TOMORROW" } )) from within a Meteor app?

Since my goal is to add search to Telescope, I'm searching for a "plug-and-play" implementation that requires minimal command line magic and could even work on Heroku or *.meteor.com.


Source: (StackOverflow)

How does the messages-count example in Meteor docs work?

Having trouble full understanding this example from the docs... I tried running it a bunch of different ways so I could observe how it works, etc.

How do you subscribe to this? Can we include the client side code needed to make this work?

Is there a collection called messages-count? Is a Room a collection of messages? Can we include the collection definitions in the example?

Any tips on this would be great!

NOTE: this is the code as it appeared when this question was initially posted (May 2012). It's simpler now.

// server: publish the current size of a collection
Meteor.publish("messages-count", function (roomId) {
  var self = this;
  var uuid = Meteor.uuid();
  var count = 0;

  handle = Room.find({room_id: roomId}).observe({
    added: function (doc, idx) {
      count++;
      self.set("messages-count", uuid, "count", count);
      self.flush();
    },
    removed: function (doc, idx) {
      count--;
      self.set("messages-count", uuid, "count", count);
      self.flush();
    }
    // don't care about moved or changed
  });

  // remove data and turn off observe when client unsubs
  self.onStop(function () {
    handle.stop();
    self.unset("messages-count", uuid, "count");
    self.flush();
  });
});

Source: (StackOverflow)

Why would I need Angular if I use Meteor?

Angular is really useful for building single page applications. It is basically built on the current paradigm where we make requests to different endpoints to help us create better single page applications.

On the other hand, we have Meteor which seems even more capable, especially since they have a feature called DDP which basically allows bi-directional data streaming. It seems like Meteor is a superset of Angular and is the obvious better choice.

While Angular does offer some neat things like testing and localization, I just don't see why would I use Angular with Meteor as opposed to just using Meteor. Could someone explain why I would want to Angular with Meteor or even use any MV* front-end framework if I were to use Meteor?


Source: (StackOverflow)

Understanding Meteor Publish / Subscribe

I've got a simple app set up that shows a list of Projects. I've removed the autopublish package so that I'm not sending everything to the client.

 <template name="projectsIndex">    
   {{#each projects}}      
     {{name}}
   {{/each}}
 </template>

When autopublsh was turned on, this would display all the projects:

if Meteor.isClient
  Template.projectsIndex.projects = Projects.find()

With it removed, I have to additionally do:

 if Meteor.isServer
   Meteor.publish "projects", ->
     Projects.find()
 if Meteor.isClient
   Meteor.subscribe "projects"
   Template.projectsIndex.projects = Projects.find()

So, is it accurate to say that the Client-side find() method only searches records which have been published from the server-side? It's been tripping me up because I felt like I should only be calling find() once.


Source: (StackOverflow)

Meteor: Debug on server side

Does anyone know a good method to debug server side code? I tried enable Node.js debug then use node-inspector but it does not show any of my code.

I end up using console.log but this is very inefficient.

Update: I found the following procedure works on my Linux machine:

  1. When you run Meteor, it will spawn two processes

    process1: /usr/lib/meteor/bin/node /usr/lib/meteor/app/meteor/meteor.js

    process2: /usr/lib/meteor/bin/node /home/paul/codes/bbtest_code/bbtest02/.meteor/local/build/main.js --keepalive

  2. You need to send kill -s USR1 on process2

  3. Run node-inspector and you can see your server code

On my first try, I modify the last line on meteor startup script in /usr/lib/meteor/bin/meteor to

exec "$DEV_BUNDLE/bin/node" $NODE_DEBUG "$METEOR" "$@"

and run NODE_DEBUG=--debug meteor on command prompt. This only put --debug flag on process1 so I only see meteor files on node-inspector and could not find my code.

Can someone check this on Windows and Mac machine?


Source: (StackOverflow)

How efficient can Meteor be while sharing a huge collection among many clients?

Imagine the following case:

  • 1,000 clients are connected to a Meteor page displaying the content of the "Somestuff" collection.

  • "Somestuff" is a collection holding 1,000 items.

  • Someone inserts a new item into the "Somestuff" collection

What will happen:

  • All Meteor.Collections on clients will be updated i.e. the insertion forwarded to all of them (which means one insertion message sent to 1,000 clients)

What is the cost in term of CPU for the server to determine which client needs to be updated?

Is it accurate that only the inserted value will be forwarded to the clients, and not the whole list?

How does this work in real life? Are there any benchmarks or experiments of such scale available?


Source: (StackOverflow)

Meteor app — resetting a deployed app's DB

Is there a simple way to reset the data from a meteor deployed app?

So, for example, if I had deployed an app named test.meteor.com — how could I easily reset the data that has been collected by that app?

Locally I run meteor reset, but I am unsure of what to do in production.


Source: (StackOverflow)

How do I create multi-page applications with Meteor?

I am new to Javascript and just started fiddling around with Meteor out of curiosity. What really surprises me, is that it seems that all HTML content gets combined into a single page.

I suspect there is a way to introduce some handling of URLs directing to special pages. It seems that the "todo" example is capable of doing this via some kind of Router class. Is that the "canonical" way of URL handling?

Assuming I can handle URLs, how would I structure my HTML code to display separate pages? In my case they could each have completely separate sets of data, so no HTML code needs to be shared at all.


Source: (StackOverflow)