kadirahq / fast-render Goto Github PK
View Code? Open in Web Editor NEWRender you app even before the DDP connection is live. - magic?
License: MIT License
Render you app even before the DDP connection is live. - magic?
License: MIT License
Hi Arunoda,
When server sends an object that is already present on client via fast-render, the client throws this error. The issue doesn't manifest on localhost, only on production servers (both Modulus and Galaxy). You can see it in https://pintask.me/: just log in and reload the page.
Also, it's evident that the number of errors (236 on screenshot) is correlated to number of fastrendered objects. Here's a simple test:
Cards.find({boardId: Router.current().params.boardId, isArchived: false}).count() + Lists.find({boardId: Router.current().params.boardId}).count()
It's clear that difference between error counts is equal to difference between fastrendered cards+lists sums.
This error is present on both projects I'm involved in, and both projects use latest Meteor 0.8.1.3 + latest fast-render 0.2.5
Hi @arunoda ,
On my sites with fast-render installed, they appear to be uncrawlable. It seems like fast-render is conflicting with spiderable.
INFO spiderable: phantomjs failed: { [Error: Command failed: ] killed: true, code: null, signal: 'SIGTERM' }
The moment I remove fast-render, my page appears nicely when I do a curl with escaped fragment.
curl https://bidder.meteor.com/?_escaped_fragment_=
I brought up this issue in meteor-talk just earlier, hope you can take a look please. https://groups.google.com/forum/?pli=1#!topic/meteor-talk/7ZbidddRGo4
Hello.
I have added the package correctly and see it on my packages folder, I can explore the files and read the source code.
However, when using the FastRender.onAllRoutes(function(urlPath) {}) for exemple, I always get a Reference Error, where FastRender is not defined.
I tried fast-render on the 'shark' branch and it broke finding the user by token. Token is no longer stored but is instead hashed and hashedLoginToken is stored instead. The change is also in 'devel'.
Quick fix by changing the query in context.js to:
{$or: [{'services.resume.loginTokens.token': loginToken}, {'services.resume.loginTokens.hashedToken': Accounts._hashLoginToken(loginToken)}]};
and adding the package accounts-base on the server in package.js.
After installing fastrender 1.1.0, I began to notice that some of my Meteor subscriptions would no longer work. It would typically occur when my Meteor app was up while the computer went to sleep - when it awoke after some time later I'd realize that my local collections would be empty. Meteor.call() methods would also not work. However, Meteor.status() would say that it was connected.
Unfortunately I don't have an isolated test case for you. I'm pretty sure it was fastrender because I exhaustively tested the app after removing each package, and after removing those it suddenly worked.
Not sure how helpful this is. Something to keep an eye on though.
Sometime,
There will be waitOn's used inside the route and use the Controller at the same time. We need take into that situation as well.
Related to: #15
I am using fast-render with the iron-router integration and it seems that routes with a query string don't work as I would expect. Maybe I am doing something wrong.
For example I would have a route:
this.route('viewPost', {
fastRender: true,
path: '/post/:_id',
waitOn: function () {
if(Meteor.userId()){
return Meteor.subscribe("postDetails", this.params._id));
}
}
});
which would normally be only on the client, but for use with fast render I move it to both the client and the server.
Now if I go to localhost:3000/post/123456 it works fine and this.params._id is set to '123456'
However if I go to localhost:3000/post/123456?addComment=true now this.params._id is set to '123456?addComment=true' on the server which does not match the way iron router handles query strings in the waitOn() on the client. In iron router on the client this.params._id would be set to 123456 and then you can access the query string with this,params.addComment.
I am not sure this is a problem with fast-render, but according to iron router's documentation it doesn't define a waitOn() function on the server side so I am thinking that fast-render has added a custom waitOn() function. Maybe this is an issue with iron router and not fast-render.
Hi, I am running fast-render but I keep getting this error on random templates. What do you think it could be?
error on fast-rendering path: /availability ; error: TypeError: Cannot read property 'collectionName' of undefined
at packages/fast-render/lib/server/context.js:73
at Array.forEach (native)
at Context.subscribe (packages/fast-render/lib/server/context.js:71)
at packages/fast-render/lib/server/iron_router_support.js:69
at Array.forEach (native)
at Context.onRoute (packages/fast-render/lib/server/iron_router_support.js:68)
at packages/fast-render/lib/server/fast_render.js:43
Hi, thanks for this package, it looks really nice!
Started using it today and works well in most cases, but I see errors when saving project files and auto reloading.
When meteor tries to auto reload the page after I modify a file, I see this error in the console. Reloading the page from the browser works, but not auto reload.
Uncaught Error: Expected to find a document to change collection.js:135
Meteor.Collection.self._connection.registerStore.update collection.js:135
_.extend.registerStore._.each.store.(anonymous function) livedata_connection.js:393
(anonymous function) livedata_connection.js:1015
_.each._.forEach underscore.js:79
(anonymous function) livedata_connection.js:1014
_.each._.forEach underscore.js:87
_.extend._livedata_data livedata_connection.js:1011
Meteor.default_connection._livedata_data ddp_update.js:66
onMessage livedata_connection.js:208
(anonymous function) stream_client_sockjs.js:165
_.each._.forEach underscore.js:79
_.extend._launchConnection.self.socket.onmessage stream_client_sockjs.js:164
REventTarget.dispatchEvent sockjs-0.3.4.js:87
SockJS._dispatchMessage sockjs-0.3.4.js:1050
SockJS._didMessage sockjs-0.3.4.js:1108
SockJS.websocket.that.ws.onmessage sockjs-0.3.4.js:1253
Although this error doesn't have FastRender explicitly in its stack trace, it started happening after I added it so I assume it's related... If it still doesn't make sense I'll try to isolate the problem more.
http://q42.com/robots.txt broke when I deployed the site with fast-render enabled. It should return a 404 since the file does not exist. (I discovered the breakage because Google emailed me that robots.txt was returning an error)
The source code is available at http://github.com/q42/q42.nl.
When removing the fast-render package, /robots.txt works. With fast-render added, /robots.txt times out and doesn't return anything. It doesn't even hit a server-side route defined with iron-router that matches "*".
When I am doing mrt update, I got this error:
ERROR: 1 Command failed: error: pathspec 'v0.1.24' did not match any file(s) known to git.
/home/action/.nvm/v0.10.11/lib/node_modules/meteorite/lib/sources/git.js:181 self.checkoutType + ": " + (self.commit || self.head);
^
There was a problem checking out tag: v0.1.24
Got this error immediately upon updating fast-render.
W20140416-21:01:37.593(8)? (STDERR) error on fast-rendering path: / ; error: TypeError: Cannot read property 'userId' of undefined W20140416-21:01:37.595(8)? (STDERR) at PublishContext.Meteor.methods.user-status-idle (packages/user-status/status.coffee:148:21) W20140416-21:01:37.596(8)? (STDERR) at Context.processPublication (packages/fast-render/lib/server/context.js:88) W20140416-21:01:37.596(8)? (STDERR) at packages/fast-render/lib/server/fast_render.js:64 W20140416-21:01:37.596(8)? (STDERR) at Array.forEach (native) W20140416-21:01:37.596(8)? (STDERR) at Context.PublishContext.userId (packages/fast-render/lib/server/fast_render.js:61) W20140416-21:01:37.596(8)? (STDERR) at packages/fast-render/lib/server/fast_render.js:40 W20140416-21:01:37.596(8)? (STDERR) at Array.forEach (native) W20140416-21:01:37.596(8)? (STDERR) at packages/fast-render/lib/server/fast_render.js:39
Hi Arunoda,
After adding the fast-render package, the following error was shown in the server console:
error on fast-rendering path: /publicList/2 ; error: TypeError: Object #<Object> has no method 'limit'
at Object.FastRender.RouteController.extend.waitOn (app/lib/router.js:34:52)
at Context.onRoute (packages/meteor-fast-render/lib/server/iron_router_support.js:49)
at packages/meteor-fast-render/lib/server/fast_render.js:43
This is the block of code that raised the error:
PublicURLsController = FastRender.RouteController.extend({
increment: 10,
/* here is the missing method */
limit: function() { return parseInt(Router.current().params.limit) || this.increment; },
loadMore: function() {
return Router.routes.publicList.path({limit: this.limit() + this.increment});
},
data: function() {
return {
publicURLs: URLs.find( {}, {sort:{timeCreated: -1}} ) ,
loadMore: this.loadMore()
};
},
/* this method raised the error */
waitOn: function() {
return Meteor.subscribe('publicURLs', this.limit());
}
});
From what I've seen, the package seemed to have altered the 'this' object inside my waitOn method. I tried to change the code into:
waitOn: function() {
return Meteor.subscribe('publicURLs', Object.getPrototypeOf(this).limit());
}
but the error was still shown.
However, this behavior only leads to an error shown in the server console, nothing else are affected: my app still run normally and there's no error raised on the client-side. Do you think this behavior will cause any serious consequence? And if possible, how can I get rid of the error message?
I'm using the latest version of Meteor and Iron Router.
Thank you for the awesome package.
Hi Arunoda,
Thanks for making this package!
I took a quick look at the package.js file and in the spirit of constructive criticism I wanted to discuss a couple things with you.
The first is that I don't think this call is needed:
https://github.com/arunoda/meteor-fast-render/blob/master/package.js#L13
The weak dependency should be ok to include regardless of whether the actual package exists. I think that's the point of weak dependencies.
The second is that I think the isIronRouterExists
function is missing a return on line 49 so it will always return false even if the iron-router package exists.
https://github.com/arunoda/meteor-fast-render/blob/master/package.js#L49
But again, if its not needed at all then it can just be removed.
Best regards,
Adrian
I had fast-render in my meteor project, now when I run mrt I get this error
Could not locate package.js within path /Users/myusername/.meteorite/packages/fast-render/arunoda/meteor-fast-render/149984b1aff3a5642a270aff9bd9006872c8302e
Ricks-MacBook-Air:dietwz7 myusername$ meteor add fast-render
fast-render: no such package
I need collection data to be available for the routes setup as I've asked here. The problem is that in order to do something like this:
path: Settings.findOne().basePath + '/....'
the collections need to be initialized before the routes. I noticed that it is the other way around because the fast-render code is added at the end of the head section. Is there anyway this can be fixed ?
If waitOn options passed with Route.configure
, current FR does not detect it in the server side.
Detect it and add subscriptions automatically.
Is there a way of accessing HTTP headers and processing them as input to subscriptions?
i.e
FastRender.route('/r/:slug', function(params) {
var language = this.headers['Accept-Language'];
this.subscribe('article', params.slug, language);
});
This can be particularly useful to get the first page load to display the correct language without having a loading
placeholder. Especially since javascript would need to run first to determine the language without Fast-render
While building the application:
error: package not available: iron-router
Looks like the check for iron-router might be broken!
Hi, I have problem with Fast Render with Iron Router In source code I have something like this:
<script type="text/javascript">
__fast_render_config = {"subscriptions":{},"serverRoutePath":"/my_route/my_route_id","subscriptionIdMap":{},"loadedSubscriptions":{}}
</script>
on every route subscriptions object is empty ..but browser DDP logs looks good
My main controller is something like this example:
(Meteor.isClient ? window : global).MyController = FastRender.RouteController.extend({
yieldTemplates: {
header_one: {to: 'header'},
buttons_big: {to: 'buttons'}
},
waitOn: function () {
var waitOn = [
Meteor.subscribe('something1'),
Meteor.subscribe('something2')
];
if(this.extendWaitOn){
_.extend(waitOn, this.extendWaitOn());
}
return waitOn;
},
data: function () {
var data1 = Data.find(....)
data2 = Data2.find(...);
var data = {
data1: data1,
data2: data2
};
if(this.extendData){
_.extend(data, this.extendData());
}
return data;
},
action: function () {
if (this.ready()) {
Session.set('something2', false);
Session.set('something3', false);
this.render();
}
else {
this.render('LoadingPage');
}
}
});
and my other controllers extend that main one:
(Meteor.isClient ? window : global).MySubItemViewController = MyController.extend({
template: 'MySubItemView',
yieldTemplates: {
sidebar: {to: 'rightPanel'},
mySubHeader: {to: 'header'},
buttons_sub: {to: 'buttons'}
},
extendData: function () {
var subdata1 = Subdata1.findOne(....),
subdata2 = Subdata2.find();
Session.set('someSessionVar', false);
return {
subdata1: subdata1,
subdata2: subdata2
};
}
});
Everything seems to work well, but I can't see any difference :/
When trying to run meteor add meteorhacks:fast-render
on meteor 0.9.2-rc8 I get Error: conflict: [email protected] vs 1.0.0-cordova1
We're getting livedata exceptions thrown when using fast-render that do not occur if fast-render isn't being used.
The error which is being thrown is the following on line 1094:
if (serverDoc) {
// Some outstanding stub wrote here.
if (serverDoc.document === undefined) {
throw new Error("It doesn't make sense to be deleting something we don't know exists: "
+ msg.id);
}
serverDoc.document = undefined;
}
mrt add fast-render
needs to be updated on page https://meteorhacks.com/fast-render/usage/
Hi Arunoda!
I was testing the fast-render and got this Uncaught Error:
"It doesn't make sense to be changing something we don't think exists"
This is the reproduction of the error:
https://github.com/guilhermedecampo/fast-render-possible-error-livedata
Thanks man.
Just trying out the package real quickly. It seems that notFound is triggered on page refresh with fast render installed. A route like this
this.route('vendorEdit', {
path: '/vendors/:_id/edit',
notFoundTemplate: 'notFound',
fastRender:true,
data: function() {
Session.set('currentVendorId', this.params._id);
return Vendors.findOne({_id:Session.get('currentVendorId')},{fields: {weddingId:0, submitted:0}});
},
waitOn: function(){
return Meteor.subscribe('vendors', Session.get("weddingId"));
}
});
With or without fastRender: true will display the notFoundTemplate. This only happens with fast render installed. Removing fast render and the issue goes away. Using Meteor 0.7.0.1
Hi,
Here's the scenario i'm encountering. An evil user typed alert script tags into my input box and thus inserted these script tags into my database documents.
When i render the templates using these corrupted documents, the double stache {{text}} safely escapes the contents. However, when used together with fast-render, the corrupted contents were ran and prepended at the head of the body. So if an evil user inserted script alerts, they will be run.
I realized it was this piece of code that triggered the problem:
FastRender.route('/', function(){ this.subscribe('texts'); });
I made a repo here that demonstrates this problem.
https://github.com/geekyme/injecting-script-fast-render
the demo is here > http://bad.meteor.com/
help me test this?
Hi Arunoda,
I added FR to my project and it works but in this case.
I have a route for a blog post like this:
@route 'blogPost',
path: '/blog/:slug'
waitOn: -> Meteor.subscribe('postFull', @params.slug)
fastRender: true
data: ->
return null unless @ready()
post = Posts.findOne({slug: @params.slug})
author = Authors.findOne({_id: post.author})
return {post: post, author: author}
after: ->
return unless Meteor.isClient
post = @data().post
SEO.set({
title: post.title
description: post.description
og:
title: post.title
description: post.description
})
The publication of 'postFull' looks like this:
Meteor.publish('postFull', (slug) ->
post = Posts.find({slug: slug})
postArr = post.fetch()
return [] unless postArr.length > 0
author = Authors.find({_id: postArr[0].author})
return [post, author]
)
This works without FR. The problem is, that in the data function post is undefined. It seems the subscriptions are not ready or not available through the collection in the data function even though I ask if the subscriptions are ready with 'this.ready()'.
JSON parse error on utils.js#L8.
Throws error when retrieving string, that contains double quotes ("), from database. How should we save double quotes in database?
After running FastRender.Log.enable()
and then FastRender.Log.disable()
, this has started happening on every page load of routes where FastRender is used:
SyntaxError: JSON.parse: bad control character in string literal
...JSONValue(JSON.parse(decodedEjsonString));
File: fast-render.js:44
That line is return EJSON.fromJSONValue(JSON.parse(decodedEjsonString));
If I do a breakpoint and look at the decodedEjsonString
, I notice that all the records seem to be in double square brackets, e.g. { profiles: [[ { someKey: someValue } ]] }
Secuirty Measures โ Security Measures :)
P.S. Thanks for great work!
So accounts-password
, for example, will not fully render until it can do a password exchange with the server: https://github.com/meteor/meteor/blob/devel/packages/accounts-password/password_client.js#L27
Maybe this is the kind of thing that we don't want to render fast, but was interested in your thoughts.
I see data in the HTML, and the log looks good, but Fast Render doesn't seem to be working anyway.
Presenting it again today in (Stavanger)[http://www.meetup.com/Meteor-Stavanger/events/161918142/], so if by some luck you manage to look before then that would be amazing.
Log:
DDP_SEND: Object { msg="sub", id="ySt7vZg4cBeLT3gsR", name="userData", mehr...}
fast-r...52e94a6 (Zeile 344)
DDP_SEND: Object { msg="sub", id="i4JDJfnuYW4AQRNnj", name="spendflowProfiles", mehr...}
fast-r...52e94a6 (Zeile 344)
FAKE_SUB_READY: spendflowProfiles
fast-r...52e94a6 (Zeile 344)
DDP_RECIEVE: Object { msg="ready", subs=[1], frGen=true}
fast-r...52e94a6 (Zeile 344)
DDP_SEND: Object { msg="sub", id="owZXnLvCanZzpKhoh", name="spendflowAccounts", mehr...}
fast-r...52e94a6 (Zeile 344)
FAKE_SUB_READY: spendflowAccounts
fast-r...52e94a6 (Zeile 344)
DDP_RECIEVE: Object { msg="ready", subs=[1], frGen=true}
fast-r...52e94a6 (Zeile 344)
DDP_SEND: Object { msg="sub", id="24CHQE8ros8YaE54q", name="spendflowEnvelopes", mehr...}
fast-r...52e94a6 (Zeile 344)
DDP_SEND: Object { msg="sub", id="Fb7CedLjP5PwwHe6Q", name="spendflowIncomes", mehr...}
fast-r...52e94a6 (Zeile 344)
DDP_SEND: Object { msg="sub", id="5hNvAxuvoGXdQAMc2", name="spendflowExpenses", mehr...}
fast-r...52e94a6 (Zeile 344)
DDP_SEND: Object { msg="sub", id="hCJxuxoSdMY2BsFua", name="spendflowPayments", mehr...}
fast-r...52e94a6 (Zeile 344)
DDP_SEND: Object { msg="sub", id="4ehswQchq8QNSh3H5", name="spendflowSessions", mehr...}
fast-r...52e94a6 (Zeile 344)
GET http://localhost:1337/sockjs/info?cb=x1landghrp
1ms
liveda...5e78de2 (Zeile 917)
false
HTML:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
__fast_render_config = {"subscriptions":{"spendflowProfiles":true,"spendflowAccounts":true},"serverRoutePath":"/bMtwkSdur7whWHC7G/accounts","subscriptionIdMap":{},"loadedSubscriptions":{}}
</script>
<link rel="stylesheet" href="/3010ba4ba5b2975c536a21b9f4cd86b31c254a78.css">
<script type='text/javascript'>__meteor_runtime_config__ = {"meteorRelease":"0.8.0","PUBLIC_SETTINGS":{"analytics_api_key":"s4yuhvodhp"},"ROOT_URL":"http://app-dev.spendflow.co:3010","ROOT_URL_PATH_PREFIX":"","DDP_DEFAULT_CONNECTION_URL":"http://localhost:1337","accountsConfigCalled":true,"autoupdateVersion":"e2d52c244c814b1e90b5c7dedd4babb088a62215"};</script>
<script type="text/javascript" src="/packages/underscore.js?0a80a8623e1b40b5df5a05582f288ddd586eaa18"></script>
<script type="text/javascript" src="/packages/meteor.js?148e9381d225ecad703f4b858769b636ff7a2537"></script>
<script type="text/javascript" src="/packages/random.js?66f32d9674bbf319a47b2638439a6bf41565ebb9"></script>
<script type="text/javascript" src="/packages/localstorage.js?5e0935b5400fc4b2fe50a44086afc939e63063dc"></script>
<script type="text/javascript" src="/packages/deps.js?7afb832ce6e6c89421fa70dc066201f16f9b9105"></script>
<script type="text/javascript" src="/packages/json.js?e22856eae714c681199eabc5c0710b904b125554"></script>
<script type="text/javascript" src="/packages/ejson.js?8659e45802513ffad53befd6dbee7e6e80df9da4"></script>
<script type="text/javascript" src="/packages/check.js?a54cf3c7b3abe9208d064621eb80a3ecaf2f4add"></script>
<script type="text/javascript" src="/packages/logging.js?0de00019cf57ae305903f15baf5dc8e10f973ded"></script>
<script type="text/javascript" src="/packages/retry.js?1f1dd2c35d300110fdaba51ce4473583bc3bf031"></script>
<script type="text/javascript" src="/packages/reload.js?ad0e94b5b63bbe79ab30e9dad4e6eb91694f5875"></script>
<script type="text/javascript" src="/packages/id-map.js?9ea6eaae8d74693ce2505a858d9a5e60cf191298"></script>
<script type="text/javascript" src="/packages/ordered-dict.js?bf8af2f26c8d96bf8b2e6b407d3ed69f23c2cd37"></script>
<script type="text/javascript" src="/packages/geojson-utils.js?81b79d5cf96d00b4b7a28987debcffb665c17526"></script>
<script type="text/javascript" src="/packages/minimongo.js?4ee0ab879b747ffce53b84d2eb80d456d2dcca6d"></script>
<script type="text/javascript" src="/packages/livedata.js?7f11e3eaafcbe13d80ab0fb510d25d9595e78de2"></script>
<script type="text/javascript" src="/packages/follower-livedata.js?39b05f02878030ae806a16a173661b7df1e92eb6"></script>
<script type="text/javascript" src="/packages/application-configuration.js?fa92020e10c808f1287070d009f69a4054676e5a"></script>
<script type="text/javascript" src="/packages/mongo-livedata.js?cf17a2975aa7445f0db2377c2af07e5efc240958"></script>
<script type="text/javascript" src="/packages/jquery.js?265926494aaa3929cd2e30da265211c5929f37a4"></script>
<script type="text/javascript" src="/packages/observe-sequence.js?935ca00b8c9fc8b3868a14a62fd05b42b7b871bc"></script>
<script type="text/javascript" src="/packages/htmljs.js?697b0dd0fbdd1f8984dffa3225121a9b7d0b8609"></script>
<script type="text/javascript" src="/packages/ui.js?b523ef986d3d39671bcb40319d0df8982acacfe8"></script>
<script type="text/javascript" src="/packages/accounts-base.js?d26a434cc8a43bee70694939d167a79e67694f71"></script>
<script type="text/javascript" src="/packages/srp.js?b67965acbe0e0f66edcf4df1e5d061dadedd4216"></script>
<script type="text/javascript" src="/packages/accounts-password.js?7f6e34b4d1163d4f00553d0c81660aa79dcf9b89"></script>
<script type="text/javascript" src="/packages/bootstrap.js?86f8f0d5d5a274fd05c4a35c7a7dddb771ce2a0e"></script>
<script type="text/javascript" src="/packages/accounting.js?4341d9eb6e73660151250b68d3f8cdc1df82452a"></script>
<script type="text/javascript" src="/packages/reactive-dict.js?22667928acc72f619ce81e7ac1e35def1ba9e0ae"></script>
<script type="text/javascript" src="/packages/session.js?5bcd2d86431dc10d5f4be0910cb6567342e1aaf6"></script>
<script type="text/javascript" src="/packages/i18n.js?9e0df6eb7950a302ed12f5393ac3d84ef43e6e9e"></script>
<script type="text/javascript" src="/packages/collection-hooks.js?c15b9c0d65950cae1c5a568d272f65cad7474c04"></script>
<script type="text/javascript" src="/packages/jquery-ui-bootstrap.js?4e145cd2568a87e8ecda87d6d5c52ab9c8e29fea"></script>
<script type="text/javascript" src="/packages/jquery-ui.js?ae09c593a9cd40d2c49c102f6ca4062b8b80007c"></script>
<script type="text/javascript" src="/packages/scss.js?7c6949ba6b2f7296b0ab930061dea1659bffc00d"></script>
<script type="text/javascript" src="/packages/email.js?911578310472ff10dca16a5306b7f455801d0f35"></script>
<script type="text/javascript" src="/packages/autoupdate.js?85a69577c7e94226061fb2c886f23080a9163712"></script>
<script type="text/javascript" src="/packages/standard-app-packages.js?601dc02c741b437bbe8be03773a37f7d896a88e7"></script>
<script type="text/javascript" src="/packages/jquery-scrollintoview.js?7fa670fb5b5d7d419f9b5fdbb2224a58e61d5a5f"></script>
<script type="text/javascript" src="/packages/templating.js?b36d51fd34724d5d501d8557cd9f846874d95aef"></script>
<script type="text/javascript" src="/packages/service-configuration.js?9119f761a784b606d3c768ff5f04718ebaf055be"></script>
<script type="text/javascript" src="/packages/accounts-ui-unstyled.js?ad471c128f10d77553dbed2a2fd5b788e77b60e8"></script>
<script type="text/javascript" src="/packages/less.js?7d1bf981a25a449d6270558bcfc983313c40cd26"></script>
<script type="text/javascript" src="/packages/accounts-ui.js?1ff79db616cce9b320fe8aed6103eded31248467"></script>
<script type="text/javascript" src="/packages/handlebars.js?038145b6256cd6a69c11650ed6bf12b093920095"></script>
<script type="text/javascript" src="/packages/managedUsers.js?28cba313d7d4adc9e813fe4a3ea1a6b949fd43f9"></script>
<script type="text/javascript" src="/packages/moment.js?daee0e0647771a16cfa6afa14787450e9c9c8ccb"></script>
<script type="text/javascript" src="/packages/analyticsjs.js?95f116bcc9f8ba970290be3b30e3245a9ff18218"></script>
<script type="text/javascript" src="/packages/webapp.js?e1be090051b82f046484dccc2de7d747e50c7328"></script>
<script type="text/javascript" src="/packages/canonical.js?c1f4345145609dd6dfda010fc5652f881d614c5f"></script>
<script type="text/javascript" src="/packages/jquery-autosize.js?16b2b942e47d57e80bec5d7c5798dfbf2066b43e"></script>
<script type="text/javascript" src="/packages/iron-router.js?a4167ac4d12a73891d8a9b8c57419a347da0ee12"></script>
<script type="text/javascript" src="/packages/coffeescript.js?969f68786bbc68e6cad299e74922a53af3d1404b"></script>
<script type="text/javascript" src="/packages/font-awesome.js?a2cd630b246df2a141799348680a194f33710d5e"></script>
<script type="text/javascript" src="/packages/fast-render.js?8de2dd5d402312016e94bc792867378d252e94a6"></script>
<script type="text/javascript" src="/packages/spacebars.js?5d478ab1c940b6f5a88f78b8adc81a47f022da77"></script>
<script type="text/javascript" src="/packages/global-imports.js?e57248bb158054930ba594d723100a9e65302983"></script>
<script type="text/javascript" src="/client/templates/template.dashboard.js?bbc5149f1b90633792c88a22c0f2eed6d6a13e05"></script>
<script type="text/javascript" src="/client/templates/template.envelopes.js?bc6240ca7f5639338dd8e7815ae14cf71a824d0c"></script>
<script type="text/javascript" src="/client/templates/template.expectations.js?99aabfafdc4c823fa13d746841458e790735bf9e"></script>
<script type="text/javascript" src="/client/templates/template.expenses.js?817bf73aae93ac64599651f826baaad155bc77eb"></script>
<script type="text/javascript" src="/client/templates/template.finance_sessions.js?9a511a451f98fd0da98bc44ea25a99f7f459d009"></script>
<script type="text/javascript" src="/client/templates/template.income.js?b7c1d6445ab539120500b7299f1e5acec678945c"></script>
<script type="text/javascript" src="/client/templates/template.nav.js?4ed862293c14aa51286f75eb96393f89e87b67eb"></script>
<script type="text/javascript" src="/client/templates/template.payments.js?2fa170e79c0718d0ee81648173a021591d08ac93"></script>
<script type="text/javascript" src="/client/templates/template.profiles.js?9844954ad0bdd1e459571cede90dbd1c215e9d33"></script>
<script type="text/javascript" src="/client/templates/template.spendflow.js?bb23764cef615068eeebec8fb7567912ad1cfcdc"></script>
<script type="text/javascript" src="/client/templates/template.virtual_accounts.js?3ed756e270b08edf77f8386085a8b9f0ba32746a"></script>
<script type="text/javascript" src="/client/lib/js/alertify.js-0.3.9/lib/alertify.min.js?240d8992a2be9ac6d26854cee824bad8375c1104"></script>
<script type="text/javascript" src="/client/lib/js/bootbox.min.js?4c57bb87c80fa618ee517e0efb7c17d3344e4df6"></script>
<script type="text/javascript" src="/lib/client/lib/profiles.coffee.js?4f6c9f72419e7791695169703fcd51c0cbdfca8d"></script>
<script type="text/javascript" src="/lib/shared/lib/collections.coffee.js?c09165bf851421ed11e9c1a9e2ce5d0aeadd313e"></script>
<script type="text/javascript" src="/lib/shared/lib/spendflow.coffee.js?957a93b8b290abf91f87bcdaabe97d4300a05838"></script>
<script type="text/javascript" src="/lib/shared/lib/stats.coffee.js?5205b2a587e56a186c3fb56c40f2d431a8098cfb"></script>
<script type="text/javascript" src="/client/lib/forms.coffee.js?1eb1d16ff5e7778a70b390dda457cdf291a6c4b2"></script>
<script type="text/javascript" src="/client/lib/helpers.coffee.js?b33a4a501e370c3c6a0de5559f924aaee06bfc82"></script>
<script type="text/javascript" src="/client/lib/helpers.js?38af62cb1e8ecfda813c7d0955d07f5ee7675b46"></script>
<script type="text/javascript" src="/client/lib/selectors.coffee.js?05e197ba23f61bf1edfd10f5fbf85617fc9e6c24"></script>
<script type="text/javascript" src="/client/lib/ui.coffee.js?1005c7dcc29ad75c12b21f5c2285438a8aa9d8c4"></script>
<script type="text/javascript" src="/lib/collections/envelopes.coffee.js?fefdf6af29fb981fc0d162c13307a63b6608e1bc"></script>
<script type="text/javascript" src="/lib/collections/expenses.coffee.js?74bdd7913eb01d016a3e75414fece3eab91f84fe"></script>
<script type="text/javascript" src="/lib/collections/finance_sessions.coffee.js?5495953bc4d61c4b09a7d366ad47ec4283ad5cf1"></script>
<script type="text/javascript" src="/lib/collections/income.coffee.js?3fa700858ec62b407246980df994788f3c2c7d4e"></script>
<script type="text/javascript" src="/lib/collections/meteor-users.coffee.js?b7795ccdd9d5812eccd9a13bef291ce9a1ad2249"></script>
<script type="text/javascript" src="/lib/collections/payments.coffee.js?c9a01e9284da73df6aa7769c242dbecf37413f52"></script>
<script type="text/javascript" src="/lib/collections/profiles.coffee.js?dfe18c3f11d230d917365d2a61b350925dd4d578"></script>
<script type="text/javascript" src="/lib/collections/virtual_accounts.coffee.js?004dc52289a1de7f04713da3f76054e844956ccd"></script>
<script type="text/javascript" src="/lib/shared/calculations.coffee.js?58f71dfdcb4db3c133f875abf4fd82e68632e8d9"></script>
<script type="text/javascript" src="/lib/shared/dates.coffee.js?2e88af8c8aad4936442283c28f88b58a1ea0327e"></script>
<script type="text/javascript" src="/lib/shared/envelopes.coffee.js?dde6a3bb4cc41bc682ca7d0a52d2fad51111e670"></script>
<script type="text/javascript" src="/lib/shared/expenses.coffee.js?3ea8a81f68fd4f612ba5ce0e9e119067d5ef36dd"></script>
<script type="text/javascript" src="/lib/shared/income.coffee.js?0f54524291045d151b57565be43b20c2cc5c6c26"></script>
<script type="text/javascript" src="/lib/shared/payments.coffee.js?67069d4fa5d6acc4ba3867a667917cbdd1e03f84"></script>
<script type="text/javascript" src="/lib/shared/users.coffee.js?3fb1c6241aeda7aa2fd4f6aede0fa620e53787c9"></script>
<script type="text/javascript" src="/lib/shared/virtual_accounts.coffee.js?967e69f0883fedf851d3995c65ec24993a85001c"></script>
<script type="text/javascript" src="/client/helpers/dashboard.coffee.js?52afd61cedb3e25609bbe24cfff04f018c242e57"></script>
<script type="text/javascript" src="/client/helpers/envelopes.coffee.js?d1a65ef7c0e40cd4721d456696318b2aa6e21016"></script>
<script type="text/javascript" src="/client/helpers/expectations.coffee.js?a1800af19fc7e91176b383892c76b79ab7271e91"></script>
<script type="text/javascript" src="/client/helpers/expenses.coffee.js?5821dc682bb69006db761772e62ab2322f3dc1db"></script>
<script type="text/javascript" src="/client/helpers/finance_sessions.coffee.js?1b31edd29f4d8b765bc83b817e69a4300b93cdae"></script>
<script type="text/javascript" src="/client/helpers/income.coffee.js?eab6f30cce6d9f9ca606d63cfcff93e259c3e7c7"></script>
<script type="text/javascript" src="/client/helpers/nav.coffee.js?795872283f12b670e024a2880a479a38faeec235"></script>
<script type="text/javascript" src="/client/helpers/payments.coffee.js?1afc2a9e43248e4e8695cbccb51338bfa31cab73"></script>
<script type="text/javascript" src="/client/helpers/profiles.coffee.js?b0bd585a0851d7244ed99f94867e3e78f8d42231"></script>
<script type="text/javascript" src="/client/helpers/spendflow.coffee.js?56f03201059734afaacc66468de9ee45dbd3509f"></script>
<script type="text/javascript" src="/client/helpers/virtual_accounts.coffee.js?6ec6864a0c0a274ea579c7b4aad38dc30eddb8d2"></script>
<script type="text/javascript" src="/spendflow.coffee.js?28dafd11bd6e269fc038b4b836f00effef9b4758"></script>
<script type="text/javascript" src="/packages/blaze-layout.js?3dc9f80fff25f73dbaaad071907ff24046419cb4"></script>
<script type='text/javascript'>
if (typeof Package === 'undefined' ||
! Package.webapp ||
! Package.webapp.WebApp ||
! Package.webapp.WebApp._isCssLoaded())
document.location.reload();
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spendflow</title>
<script type="text/javascript">
if(typeof __init_fast_render == 'function') {
__init_fast_render("%7B%22collectionData%22:%7B%22profiles%22:%5B%5B%5D%5D,%22accounts%22:%5B%5B%5D%5D%7D%7D")
}
</script>
</head>
<body>
</body>
</html>
That false
underneath the log is the output of console.log()
ing the subscription handle's ready()
result. IR sees it as false
and it does not react when Fast Render fakes it to true, it would seem. I have fastRender: true
set on the route, and I don't have any pause()s
currently.
I added meteor add arunoda:fast-render
to a 0.9.0-RC14 project and get this in the Chrome console:
Uncaught TypeError: Cannot read property '__init_fast_render' of undefined
Hi
I've been playing around with FastRender today, and all of my subscriptions are in the onBeforeAction
function. I ended up doing away with waitOn
entirely because I can do things like:
var topicMap = this.data().articles.map(function(p){ return p.topic });
this.subscribe("TopicsById", topicIds);
And then send the specific id's to my publish function so that I'm not publishing anything that's not required.
However because I'm not using waitOn
, I started using the method in option 3 at: https://meteorhacks.com/fast-render/iron-router-support/. This had me writing a whole bunch of:
FastRender.route('/', function(params){
this.find('articles', {}, {limit: 20, sort: {receivedAt: -1}});
this.completeSubscriptions(['ArticleList']);
});
functions which felt like I was repeating myself in areas I'd abstracted by sharing a controller across several routes.
Is there any way to utilize fast render in my onBeforeAction
functions? eg/ I can call FastRender.completeSubscriptions
from there. Is there a way to use the this.find
that I'm using in FastRender.route(...)
there as well? Or is there just something about iron-router and fast-render that I'm not understanding?
Thanks
It seems using Meteor.loggingIn()
to show the loading template until login is complete can cause an infinite loading screen with FastRender (because of how accounts-password
manages Meteor.loggingIn()
.
I wonder if there could be a workaround, or if there is some reactive way to easily check that FastRender has loaded a particular collection that I could use to get past that in cases where FastRender is active.
My loggingIn code in an Iron Router before
hook:
if Meteor.loggingIn()
console.log 'Logging in...'
@render(@loadingTemplate)
@stop()
DDP_SEND:
Object {msg: "sub", id: "8aCajk2aKNidpBvhR", name: "polls", params: Array[0]}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "Ysm98tt3gkC7KshNq", name: "polstirs", params: Array[0]}
log.js:7
DDP_SEND:
Object {msg: "connect", version: "pre1", support: Array[1]}
log.js:7
DDP_SEND:
Object {msg: "method", method: "login", params: Array[1], id: "1"}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "cxBHWbzZzLzX7DrKs", name: "meteor_autoupdate_clientVersions", params: Array[0]}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "Fh4vh624QyiTToifc", name: "meteor.loginServiceConfiguration", params: Array[0]}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "kkk99F2biFAynaggm", name: "_aurora", params: Array[1]}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "8aCajk2aKNidpBvhR", name: "polls", params: Array[0]}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "Ysm98tt3gkC7KshNq", name: "polstirs", params: Array[0]}
log.js:7
event.returnValue is deprecated. Please use the standard event.preventDefault() instead. jquery.js:3259
DDP_RECIEVE:
Object {msg: "added", collection: "users", id: "89qcZNgZwogBx4og5", fields: Object}
log.js:7
REVERTING_BACK_TO_ORIGINAL_DDP_HANDLING: log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "roles", id: "RzWFe7zNbJ4wt4rzq", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "roles", id: "Kg3jRXzXMqCRgHXBa", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "roles", id: "MM73x53FidGdaEqJv", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "roles", id: "mNJWj4H2b4awzrutZ", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "roles", id: "jd8WpRgnWfGTBdTMv", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "roles", id: "A6zpGTHRpYezQGh4n", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "updated", methods: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "meteor_autoupdate_clientVersions", id: "603536eead142444bac961533bb66ec1787018b9", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "ready", subs: Array[1]}
log.js:7
DDP_SEND:
Object {msg: "method", method: "eventsOnHooksInit", params: Array[0], id: "2"}
log.js:7
DDP_SEND:
Object {msg: "method", method: "eventsOnLoggedIn", params: Array[0], id: "3"}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "meteor_accounts_loginServiceConfiguration", id: "bXdM7MuSJizMAt6jR", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "ready", subs: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "ready", subs: Array[1]}
log.js:7
DDP_SEND:
Object {msg: "method", method: "_Tevent", params: Array[1], id: "4"}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "polls", id: "7NS2xyo8joHFd72ST", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "polls", id: "gv8irhPQbc44ZcXqX", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "polls", id: "WprcRTTygnQtSdvFP", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "polls", id: "9t6kNPZx3WMJGefcz", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "ready", subs: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "added", collection: "users", id: "MZYF32yJeirntZ8E8", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "changed", collection: "users", id: "89qcZNgZwogBx4og5", fields: Object}
log.js:7
DDP_RECIEVE:
Object {msg: "ready", subs: Array[1]}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "kLGHPkaFwdXBWHGzP", name: "polstirs", params: Array[1]}
log.js:7
DDP_SEND:
Object {msg: "method", method: "_Tevent", params: Array[1], id: "5"}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "JbYxi67PH3Hths3bY", name: "votes", params: Array[1]}
log.js:7
DDP_SEND:
Object {msg: "sub", id: "KiT4EJth9sAdjK7Gx", name: "comments", params: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "updated", methods: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "updated", methods: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "updated", methods: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "ready", subs: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "updated", methods: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "ready", subs: Array[1]}
log.js:7
DDP_RECIEVE:
Object {msg: "ready", subs: Array[1]}
log.js:7
DDP_SEND:
Object {msg: "method", method: "_Tevent", params: Array[1], id: "6"}
log.js:7
DDP_RECIEVE:
Object {msg: "updated", methods: Array[1]}
log.js:7
I add this package to my project and disable ddp by setting DDP_DEFAULT_CONNECTION_URL to an unopened port(3030).
But the fast render do not send to me any data, Here is the script found in my page
<script type="text/javascript"> if(typeof __init_fast_render == 'function') { __init_fast_render({"collectionData":{"testConfig":[[]],"scenario":[[]],"loadTest":[[],[],[]]}}) } </script>
It seems that no data is transferred by fast render.
I used your newest version 0.1.13, because I used collection2.
Any suggestion? I need your help.
Hi,
I'm using AzimuthCMS, and I'd like to use fast-render more smoothly. In Azimuth usually all route definition files are in his /packages directory. I've tried using Fast-render with that, and found out that to enable Fast-render I have copy paste all these route definition files from Azimuth files into mine app shared directory. Otherwise there was error with FastRender is not defined.
I think It would be nice to give support for integration with other (CMS) packages, to give them chance, to natively support Fast-render.
Hi,
I'm using the 0.8 rc 0. Fast render fails to build when i do an mrt add. Has support for 0.8rc0 been added yet?
I'm just trying to use fast render to speed up the initial page load time of my app. I can't seem to make it work with my app. I read the documents multiple times and couldn't figure out what goes wrong.
It seems to me that fast render doesn't work for an empty app with just the login button. Basically I have the following set up:
router.js:
Router.map(function() {
this.route('home', {
path: '/',
template: 'myTemplate',
fastRender : true,
});
});
template.html:
<template name="myTemplate">
{{> loginButtons}}
</template>
On a normal page load, I see a pull down link to login the app. If I set DDP_DEFAULT_CONNECTION_URL to a non-existant port. If fast render works, I should still see the pull down link I suppose. However, I don't see anything. I tried this both as an anonymous user or a logged in user.
Did I do something stupid here?
btw, I stripped down my app to this login button issue to illustrate the problem. My real app has subscriptions. I do see the data being sent in the html file, but the page load time doesn't get any faster. I think this is due to this login button issue. Do I correctly simplify the problem? Or this is entirely different?
I use the most recent version of meteor, iron-router, and fast render.
Thanks.
Hi,
I am using clean install with iron-router (no configuration, waitOn and so on). Basically, in iron-router method before
, I have call checking Meteor.user()
and changing layout depending on the result of the check.
I am using custom schema for my users to extend their profile with additional data.
Everything works like a charm (really thank you for delivering this module! It's exactly what I needed), no flickering - really happy with that. The only issue is that in my body, when I click "show the source", I get:
if(typeof Package['fast-render'].__init_fast_render == 'function') {
Package['fast-render'].__init_fast_render("%7B%22collectionData%22:%7B%22users%22:..........")
}
I of course deleted content of snippet above for security reasons, but under users key I have complete list of all the users registered (without password).
Is there any possibility to get rid of that? AFAIK it should print only one user (currently logged) as that's what application needs to run.
Hi!
So I implemented fast-render into Questful but I am running into problems!
First I thought it is caused by the new version of iron-router but at least a part of it is definitely caused by fast-render!
Please see the whole description of the problem here: iron-meteor/iron-router#379
You can still find the version which is using fast-render and is experiencing these issues at http://questfultest.meteor.com/ .
Any ideas what could cause this?
Thanks! Cheers, P
Hi,
I have a problem when I do bundle, I have this error with all collections, but only in bundled version.
fast-route data found, but no collection exists for: [collection-name]
I have tried all and nothing. Too, iron-router doesn't find any route. Any idea?
Hey there!
I tried to test a standalone package that requires fast-render using Tinytest and it fails to run the mrt test-packages
command because of the isIronRouterExists()
function within package.js
.
My package is not contained within a meteor application and I don't think it should be a requirement to test it ;-)
I could resolve the issue by adding .meteor/packages
and putting iron-router
into it. But then there is another error when starting the tests:
ReferenceError: Router is not defined W20140610-17:59:05.670(2)? (STDERR) at waitOnFunction (packages/fast-render/lib/server/iron_router_support.js:13)
What should I do?
FastRender.RouteController is undefined after updating to meteor add meteorhacks:fast-render from mrt
It seems the 0.1.13 version of fast-render is crashing using
TasksController = FastRender.RouteController.extend
with error
TypeError: Cannot call method 'extend' of undefined
Changing FastRender.RouteController.extend
to RouteController.extend
stops the app from crashing. Reverting back to 0.1.12 version and things work as expected.
Not sure what info you'll need. I work on Windows 8 using Vagrant.
In order to work correctly, FR expects cursors to be returned from the publications. But we need to support this.xxxx
apis until, we receive this.ready
.
Make to to stop the publication by calling the onStop
callback, after we receive the .ready()
I am getting an error when using fast-renderer the error seems to happen after server restart. I traced the error to the following Exception from Meteor:
Error
Expected not to find a document already present for an add
packeges/mongo-livedata/collection.js - line 127
} else if (msg.msg === 'added') {
if (doc) {
console.log()
throw new Error("Expected not to find a document already present for an add");
}
self._collection.insert(_.extend({_id: mongoId}, msg.fields));
After removing fast renderer it worked as it should. It seems that this error was caused on login. And maybe because of logintokens that where saved locally or something similar.
I was using meteor 0.7.0.1 - please advice me with more information to support you finding the bug.
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.