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)
- Problem importing packages on meteor 3.0-beta.7 HOT 16
- Google Maps JS API will stop working in Cordova in May for iOS+Android HOT 3
- [ Meteor v3 ] - Error in OAuth Server: findOne
- [v3.0-beta.7] Cannot create project or update meteor to v3 error: Command failed: HOT 2
- [Meteor 3] WebApp.addRuntimeConfigHook is broken HOT 1
- [3.0] error on boot.js TypeError: next.runImage.call is not a function HOT 7
- [3.0-rc.0] error on boot.js TypeError: next.runImage.call is not a function HOT 2
- Unable to create new meteor 3 projects HOT 4
- why am i getting this isses, please someone help. FormData { file name → {} } HOT 2
- Idle Crash in Development Mode
- Meteor 3 Migration Guide Feedback
- [Meteor 3] Tinytest major version increased HOT 2
- [Meteor 3] Environment Variables resets value too early HOT 2
- [Meteor 3] EnvironmentVariable.withValue has different return value on client and server
- [Meteor 3] SyntaxError: Unexpected token 'export' HOT 2
- bundle-visualizer not working with Meteor 3 HOT 1
- Login and CreateUser method send back the added message without fully fields HOT 4
- Meteor3 - MultiFileCachingCompiler does not set up its internal LRU cache correctly HOT 10
- Allow-deny package does not parse MongoServerError
- meteor/reify - changelog is not up to date HOT 1
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.