-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to not include $__path key in the response payload #708
Comments
That key exists there to support the new deref function. It allows you to create a Model bound to an object anywhere in the message: model.get("titlesList[0].name").then(v => { There's no way to hide it at the moment. I'm curious why you want to hide it. We considered adding in mode that would set enumerate to false, but I found it impacted performance. |
@jhusain Is there an option to opt out of it. I just dont like all the filtering happenning in components, |
@YesaDyuss I am curious, why is this a problem? I would imagine this is only a problem if you are doing the following type of init'ing var model = falcor.Model(...);
... later in code at a render function ...
var json = this.props.json;
return json.map(list => {
return (
<ListComponent json={list}></ListComponent>
);
}); Then yes I could see this being a problem. Is that what is happening? if not, please elaborate why this is an issue. Second, this should have nothing to do with falcor-http-datasource. This has everything to do with the falcor.Model. The http data source simply will take a list of args and call an end-point via http with the remotable falcor operation. Either the endpoint being called is returning a model payload (a no no, use a falcor-router or this is the data from the Model's output. Let me know! But know that it will be a minimum 30% performance cost to use |
Problem is roughly the same as you described: I pass It is not a huge problem, but it is just annoying to change that in every place where I iterate over them and it loses some declarativeness, because web designers and new developers will be asking a question why are they using this dummy filter: To conclude I think $__path is related to falcor internals and it should not polute the output, that the user of the lib receives Thanks for your extended response. The new update is great and I just want it to have as little friction as possible to the current workflow people already have |
@jhusain @michaelbpaulson would be nice if we could have an optional |
I'll update this ticket with our full resolution to this problem. |
We are releasing master when we finish some documentation and one more small update to the migration guide. Then this ticket will be officially resolved in NPM. For now, we have fully decided on |
Hi @michaelbpaulson. Is there a better solution on the way for this issue? I've got a really large codebase with lots of |
Also, the version on NPM seems to be 0.1.16 but still v0.1.15 in github. Is that correct? We're locked to 0.1.15 ATM to avoid this bug. |
Hey @robwithhair - it's the solution we've settled on for now, driven by the trade-offs below. The options on the table were:
As implied above, I don't think we've ruled out pursuing the more ideal solutions if we can squeeze out the performance, but pursuing them may take a bit. Regarding the 0.1.16 question - that seems to be a mistake. We intended to publish backwards-compat breaking changes on a 1.x release (even though there are looser definitions for 0.x, and we'd still be in developer preview even with the 1.x) so that folks could use semver in builds reliably, and not continuously hit back-compat issues while evaluating the developer preview. On cursory glance, it looks like we may have published 0.1.16 from the master branch by mistake, instead of the 0.x branch. I'll be publishing 0.1.17 from the 0.x branch to "fix" 0.1.16, and publish a 1.0.0-rc from master [ I promised to do that last week, but got caught up with some other work. I'll try and get it out in a day or two ] |
Thank you for the info. We should be able to return to tracking minor version updates after 0.1.17 is released. |
When I am using falcor-htttp-datasource, the response payload contains
$__path
key everywhere. And I always have to filter it out. Is there a way to exclude it?The text was updated successfully, but these errors were encountered: