Skip to content

Remove use of deprecated grpc.load() method #1669

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

Merged
merged 10 commits into from
May 1, 2019
Merged

Conversation

rsgowman
Copy link
Member

@rsgowman rsgowman commented Apr 8, 2019

This also requires a workaround to keep our tests passing.

@rsgowman rsgowman force-pushed the rsgowman/grpc_load branch from f9feb6d to c5e87f0 Compare April 24, 2019 15:05
@rsgowman
Copy link
Member Author

Ready for re-review. This is a meld of this plus #1699.

Note that the upgrade to protobufjs 6.x required a minor change to packages/firestore/src/remote/serializer.ts... it seems as though protobufjs now always returns this as a unit8array? But my knowledge of our typescript port in general is a little thin, so definitely take a close look to make sure that makes sense during your review.

I've been a little paranoid on the types (i.e. const value: fieldValue.FieldValue = fieldValue.FieldValue.fromWhatever(x)). I found that useful while developing (since the type system caught some of my silly errors early) but we can pare that down somewhat if you'd prefer.

@rsgowman rsgowman assigned mikelehen and unassigned rsgowman Apr 24, 2019
@mikelehen
Copy link
Contributor

Sorry for the slow review on this, but there are a couple things I'm trying to figure out and I think I need to spend a bit of time debugging through this. I'm not sure why serializer.ts needed to be changed. And I think our hasTag() code is not being used like it was before and can perhaps be removed. I'll poke at this more Monday and get back to you.

1. The switch to protobufjs 6.x seems to have removed the need for hasTag() (and actually it had broken our usage of it since the tags ended up changing from snake_case to camelCase). So I've removed hasTag() and set `oneofs: false` in protoLoaderOptions so the virtual "fooType" fields are no longer added.
2. 'seconds' in timestamps should always be serialized as a string, since it's an int64 but we weren't doing that. I fixed it, which removed some of the special casing from rsgowman/grpc_load.
3. I reworked the expect...RoundTrip methods into a single unified one which saves some repetition and I think is easier to make sense of.
4. I re-added the disabled useProto3Json assert and instead tweaked the offending test not to try to round-trip through protobufjs.
Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged my changes, merged with master, and updated grpc/proto-loader to the latest version (0.5.0). I believe this should be good-to-go.

@mikelehen mikelehen assigned rsgowman and unassigned mikelehen May 1, 2019
@@ -1364,35 +1354,3 @@ export class JsonProtoSerializer {
return FieldMask.fromArray(fields);
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mikelehen mikelehen deleted the rsgowman/grpc_load branch August 9, 2019 20:11
@firebase firebase locked and limited conversation to collaborators Oct 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants