如何修改正在运行的流星(陨石)? [英] How can I modify the Meteor (meteorite) that is running?

查看:104
本文介绍了如何修改正在运行的流星(陨石)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开放源代码项目的好处之一是,您可以打开代码,查看代码的作用,甚至修改代码以帮助您深入了解.

One of the benefits of open source projects is that you can open up the code, see what it does and even modify it to help you understand under the hood.

如何修改流星的基本代码,以便可以插入自己的控制台日志语句以查看代码的工作方式?我将我的应用程序作为陨石应用程序(mrt)

How can I modify the base code of meteor(ite) so that I can insert my own console log statements to view how the code is working? I run my application as a meteorite app ( mrt )

我尝试过但没有成功的事情: *编辑我的.meteor源代码树 *编辑我的.meteorite源代码树 *编辑/myApp/.meteor/local/build

Things I have tried but have not got working: * editing my .meteor source tree * editing my .meteorite source tree * editing the /myApp/.meteor/local/build

其他详细信息: 我的特定用例(尽管答案应该比回答这个问题更笼统)是我收到一个错误排队任务中的​​异常:错误:流星当前不支持ObjectID以外的对象作为id",并且想要console.log id是什么(即,如果它不是ObjectID,那么它是什么?)

Additional details: My specific use case (though the answer should be more general than answering just this) is that I am getting an error "Exception in queued task: Error: Meteor does not currently support objects other than ObjectID as ids" and want to console.log what the id is (ie, if its not a ObjectID, then what is it?)

这是完整的错误:

I20130826-10:36:36.038(-6)? Exception in queued task: Error: Meteor does not currently support objects other than ObjectID as ids
I20130826-10:36:36.039(-6)?     at Function.LocalCollection._idStringify (packages/minimongo/minimongo.js:845)  
I20130826-10:36:36.039(-6)?     at _.extend._nextObject (packages/mongo-livedata/mongo_driver.js:549) 
I20130826-10:36:36.039(-6)?     at _.extend.forEach (packages/mongo-livedata/mongo_driver.js:570)  
I20130826-10:36:36.039(-6)?     at _.extend.getRawObjects (packages/mongo-livedata/mongo_driver.js:621) 
I20130826-10:36:36.039(-6)?     at _.extend._pollMongo (packages/mongo-livedata/mongo_driver.js:897)  
I20130826-10:36:36.040(-6)?     at Object._.extend._unthrottledEnsurePollIsScheduled [as task] (packages/mongo-livedata/mongo_driver.js:841)  
I20130826-10:36:36.040(-6)?     at _.extend._run (packages/meteor/fiber_helpers.js:144)  
I20130826-10:36:36.040(-6)?    at _.extend._scheduleRun (packages/meteor/fiber_helpers.js:122)

在myApp/目录的以下文件中找到错误消息:

The error message is found in the following files in myApp/ directory:

  • .//.meteor/local/build/programs/client/packages/minimongo.js
  • .//.meteor/local/build/programs/client/packages/minimongo.js.map
  • .//.meteor/local/build/programs/ctl/packages/minimongo.js
  • .//.meteor/local/build/programs/ctl/packages/minimongo.js.map
  • .//.meteor/local/build/programs/server/packages/minimongo.js
  • .//.meteor/local/build/programs/server/packages/minimongo.js.map

和〜/.meteor

and in ~/.meteor

  • .//packages/minimongo/2c0b2ba53f/browser/packages/minimongo.js
  • .//packages/minimongo/2c0b2ba53f/browser/packages/minimongo.js.map
  • .//packages/minimongo/2c0b2ba53f/os/packages/minimongo.js
  • .//packages/minimongo/2c0b2ba53f/os/packages/minimongo.js.map
  • .//packages/minimongo/80c0a81364a8a504110b56f3e9a2cba2d4e731ee/minimongo.js

推荐答案

看来您在这里要问几件事,所以让我将其分解为不同的答案:

It looks like you're asking a couple of things here so let me break it down into different answers:

修饰流星

这取决于您要如何做.如果您在 https://github.com/meteor/meteor/上接受其中一个软件包树/开发/包,并将它们放在您的/packages文件夹中并运行

It depends how you want to do it. If you take one of the packages over at https://github.com/meteor/meteor/tree/devel/packages and place them in your /packages folder and run

meteor add packagename

其中 packagename 是软件包的名称.该程序包将覆盖流星,并让您通过对其代码进行修改来使用它.

Where packagename is the name of the package. This package will override meteor and let you use it with its code modifications instead.

如果要更改流星本身,使其也影响所有其他项目,则需要在~/.meteor下查找最新版本.

If you want to alter meteor itself so that it affects all your other projects too, you need to look for the latest build under ~/.meteor.

如果您修改项目.meteor目录中的文件,则~/.meteor中的文件将覆盖它们,而您将看不到更改.

If you modify the files in the .meteor directory of your project, the ones from ~/.meteor are going to overwrite them and you won't see your changes.

我建议使用第一种样式可能会更好,因为它不会干扰您的其他流星项目.

I would suggest it might be better to use the first style as it won't interfere with your other meteor projects.

修饰陨石

对于Meteorite,您可以使用 npm链接来使用git克隆github上的 meteorite项目.这样一来,您就可以将其用作npm模块,但可以修改代码以查看其幕后工作方式.

When it comes to Meteorite, you could use npm link to let you use a git clone of the meteorite project on github. This will let you use it as an npm module and yet let you modify the code to see how its working under the hood.

错误

Meteor允许您使用两种类型的_id:通过 Meteor.Collection.ObjectID 的ObjectID >或字符串(只要它是唯一的,并且通常看起来类似于Random.id()给出的内容.

Meteor allows you to use two types of _id, an ObjectID via Meteor.Collection.ObjectID or a string (so long as its unique, and typically looks something like what Random.id() gives out.

如果遵循跟踪,则看起来您正在尝试使用_id既不是ObjectID也不是字符串的集合.如果您以某种方式在流星之外进行收集,则可能会发生这种情况.要通过此错误,请在流星之外修改您的集合,并使用_id字符串或ObjectID

If you follow the trace it looks like you're trying to use a collection where the _id is neither an ObjectID or a string. This might happen if you made your collection outside of meteor somehow. To get passed the error modify your collection outside of meteor and use _ids that are either strings or an ObjectIDs

这篇关于如何修改正在运行的流星(陨石)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆