Closed stolinski closed 7 years ago
These decorators are targeted for client side data retrieval. Indeed, even if it's feasible, performing a Meteor.call
server side seems odd. Server side, as fiber is used, you end up receiving the data once the server has already performed its ReactDOMServer.renderToString
in the fiber that creates the payload.
As ReactDOMServer.renderToString
is atomic, the server can't pause its HTML rendering in order to wait for the data to be received. Server side, data have to be estimated before starting the HTML rendering and filled to the components.
Makes sense, but I guess this goes back to my other issue. There doesn't seem to be any way to add SSR with this package without adjusting how you bring in data like Flow Router SSR did, and that's a bummer because not every project needs complex data loading.
When using decorators, I'm getting
Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment. at Object.Meteor._nodeCodeMustBeInFiber (packages/meteor.js:1075:11) at [object Object]._.extend.get (packages/meteor.js:1087:12) at [object Object]._.extend.applyAsync (packages/ddp-server/livedata_server.js:1646:52) at [object Object]._.extend.apply (packages/ddp-server/livedata_server.js:1611:26) at [object Object]._.extend.call (packages/ddp-server/livedata_server.js:1593:17) at imports/products/Product.js:19:10 at Component.fetchData (packages/orionsoft:react-meteor-data/with-method-data.js:27:9) at Component.componentWillMount (packages/orionsoft:react-meteor-data/with-method-data.js:22:14) at /Users/scotttolinski/Sites/projects/store-levelup/node_modules/react-dom/lib/ReactCompositeComponent.js:347:23 at measureLifeCyclePerf (/Users/scotttolinski/Sites/projects/store-levelup/node_modules/react-dom/lib/ReactCompositeComponent.js:75:12) at [object Object].ReactCompositeComponent.performInitialMount (/Users/scotttolinski/Sites/projects/store-levelup/node_modules/react-dom/lib/ReactCompositeComponent.js:346:9) at [object Object].ReactCompositeComponent.mountComponent (/Users/scotttolinski/Sites/projects/store-levelup/node_modules/react-dom/lib/ReactCompositeComponent.js:257:21) at Object.ReactReconciler.mountComponent (/Users/scotttolinski/Sites/projects/store-levelup/node_modules/react-dom/lib/ReactReconciler.js:45:35) at [object Object].ReactCompositeComponent.performInitialMount (/Users/scotttolinski/Sites/projects/store-levelup/node_modules/react-dom/lib/ReactCompositeComponent.js:370:34) at [object Object].ReactCompositeComponent.mountComponent (/Users/scotttolinski/Sites/projects/store-levelup/node_modules/react-dom/lib/ReactCompositeComponent.js:257:21) at Object.ReactReconciler.mountComponent (/Users/scotttolinski/Sites/projects/store-levelup/node_modules/react-dom/lib/ReactReconciler.js:45:35)
I'm using https://github.com/orionsoft/react-meteor-data to bring in data from a Meteor method.