Comments (3)
CoffeeScript :(
You realize that developers would prefer to read and debug JavaScript right?
from meteor.
No, sorry, I didn't.
Additionally, although I did think about people who wanted to read JS, I forgot that the deployed thing had the minified (and hence useless) JS.
Would you like me to push the code somewhere so you can run it in development where you could see the changes live?
I have since changed the code to work around this using a helper function, but the basic idea should still be pretty obvious. Basically humaneDate
raises TypeError
because of a missing method, because it expects either a string representation of a date or a Date
object, not {}
. humanTime
just catches that and returns "just now" (because it only happens when the messages are shiny new)
Both the coffeescript and the compiled JS are available in a gist.
Just to be clear: it works fine for older messages, it only fails when I insert a new Message
and that causes an update of conversation.messages
.
from meteor.
This is not supposed to work.
Here's what's probably happening.
new Date() on the client returns an Object. Minimongo only stores JSON values. So the insert is dropping that (should be an error) and you get an empty timestamp
field.
The insert RPC to the server stringifies its arguments, so you're actually sending the string representation of the date to the server. (This is also probably wrong.) The server inserts a document into the MongoDB collection, then publishes it back to the client, which replaces its copy with a new version that includes the timestamp field. Hence the flicker.
Closing this bug. We should throw errors on minimongo insert and update where the doc isn't JSON. And we should clarify the behavior of the wire protocol.
from meteor.
Related Issues (20)
- Meteor app crashes when require().enable runs.
- [Meteor 3] Mongo.Cursor.observeChanges returns a Promise instead of a query handle HOT 2
- [Meteor 3] Improve migration path for non-mongo packages
- [Meteor 3] TypeScript declarations are out of date
- [Meteor 3] Rename or remove asyncLocalStorage global
- [Meteor 3] Unable to run bundle from "meteor build"
- Adding a package with `meteor add` does not pull the latest version HOT 3
- [BUG BOUNTY] $500 Reward to improve the performance of Meteor on Windows HOT 13
- Creating Vue App fails with Alpha 20 HOT 1
- Guide (v. 2.14) - create new vue3 app does not use vue skeleton
- [Meteor 3] Calling WebApp.addRuntimeConfigHook breaks __meteor_runtime_config__
- POSIX dependency crashes meteor tool on Windows
- Unable to run meteor mongo in [email protected] HOT 1
- Footer on Mobile screen could be better HOT 1
- [METEOR 3] error on boot.js TypeError: Meteor.methods is not a function HOT 2
- `GCDWebServer` missing in `cordova-plugin-meteor-webapp` HOT 4
- [Meteor 3.0] Promise rejection stops process
- Unable to login via Facebook on mobile app Meteor version 2.13.3 HOT 2
- [Meteor 3] Uncaught Promise Rejection when throwing stub error
- Unable to build project, isobuild has error: `EACCES: permission denied, open ...` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor.