Giter Site home page Giter Site logo

Comments (7)

kengu avatar kengu commented on September 25, 2024

Hi! Did it work earlier for web-targets? I would not think so based on the errors above. I haven't tested it myself on web-targets, but it seems like the MAX literal is not possible to represent as an integer i js. I'll investigate and come back to you.

from eventstore-client-dart.

kengu avatar kengu commented on September 25, 2024

Bug confirmed with flutter run -d chrome, investigating further

from eventstore-client-dart.

kengu avatar kengu commented on September 25, 2024

The X509Certificate errors are there because eventstore_client does not as of now support web, as shown here in the scoring section
Screenshot 2022-11-02 at 20 07 00
I'm not sure how I will introduce support for web, probably following the pattern in the grpc package.

from eventstore-client-dart.

kengu avatar kengu commented on September 25, 2024

@robin-dojo I can't promise when web support is available, but I am working on it.

from eventstore-client-dart.

kengu avatar kengu commented on September 25, 2024

@robin-dojo gRPC-web is now supported in master. I'll release a new version to pub.dev soon.

NOTE
EventStoreDB does not support the gRPC-web protocol directly (in-process proxy). The EventStore team could add in-process proxy support using Grpc.AspNetCore.Web, but I doubt they will prioritize this because gRCP-web have limited streaming support (details below). If you plan to connect directly to EventStoreDB from a browser, you need to configure a gRCP-web proxy in front of EventStoreDB, that translates between native gRPC and gRPC-web protocols automatically (see official Google implementation of grpc-web).

IMPORTANT! gRPC-web have limited streaming support. Especially bidirectional streams (both RPC requests and responses are sent and received using streams) which EventStoreDB use for Append-operations, are not supported by the gRPC-web protocol. When browser-support for Streams is high enough (see global coverage), the gRCP-web protocol will become optional and web clients will also be able to use the native gRPC protocol.

Choices
You have three technical different options to choose from when connecting to EventStoreDB from a browser.

If you only need to read events, then one of these options is sufficient

If you also need to support appending events from the browser, then you need to make a custom gRPC server between the gRCP-web proxy (Envoy or in-process) and EventStoreDB. This custom gRPC server must translate the bi-directional Append command exposed by EventStoreDB to a command exposed by the custom gRCP server that is supported by the gRPC-web protocol. You could do this by implementing an Append command with an unary request (all events in one request) that returns a stream of responses (same as the Append command exposed by EventStoreDB does). This command is supported by gRCP-web and should work (in theory, I have not tested it myself). You would need to repeat this for all EventStore gRPC service commands that are bidirectional, which is a big undertaking.

My advice
If you need Append-support from the browser, I think the better solution is to wait for the official support of native gRPC that use Streams. I don't know when this will happen, but the (global coverage) is ~94% now. See the roadmap for full streaming support for official information.

from eventstore-client-dart.

robin-dojo avatar robin-dojo commented on September 25, 2024

Thanks, @kengu - will try out 0.7.0 when it is released.

For my needs, the web interface will not need to append streams directly as we have an API service for this, but other platforms will require it as they will not always interact with the API :)

from eventstore-client-dart.

kengu avatar kengu commented on September 25, 2024

Fixed in master. See flutter_echo_app for example of grpc-web protocol usage, and tool/grpc/bridge for example of how the infrastructure is set up locally for testing.

from eventstore-client-dart.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.