Comments (5)
@timostamm hm, does Buffer.from
actually work in a browser? I get the declare class Buffer
makes the TS compiler happy, but if that line is actually invoked, does it work? Do some of the browsers have Buffer.from
implemented?
I think I mentioned it else where, but I'd love to have an integration/angular
directory with a super-simple version of your setup that shows an angular app using ts-proto output.
Could we start with that? I.e. a PR for the "toy angular app that uses ts-proto"?
from ts-proto.
@stephenh, nodes' Buffer
is built on top of the ECMA Uint8Array
and not available in any browser.
A simple angular setup should not be a problem. A test suite with node and browser coverage on generated code on the other hand is not trivial at all. Let's start simple. I should be able to find some time in the coming week to setup a basic angular example.
from ts-proto.
not available in any browser
Okay, that makes sense. That's why I was thinking that the proposed fix of declare class Buffer
is not really sufficient, because it will make the compile error go away (by making TS think there is a Buffer
class), but if the generated code ever calls that method, it won't actually work...
Like we probably need to change the generated code to realize "Buffer
is not available" and use something else instead.
in the coming week to setup a basic angular example
Sounds great.
from ts-proto.
Can we include buffer when generating for browser.
from ts-proto.
I'm pretty sure this is fixed in v1.48.0. Basically prefixing Buffer
with globalThis.Buffer
. Let me know if not.
from ts-proto.
Related Issues (20)
- I'm using the buf tool to generate a ts file and have set `-ts_proto_opt=esModuleInterop=true`, but the generated code still contains `import Long = require("long");` HOT 1
- Module has already exported a member named 'ServerStreamingMethodResult' HOT 7
- basic_string::_M_construct null not valid HOT 5
- removeEnumPrefix not working HOT 1
- fromJSON should accept both snake_case and camelCase keys HOT 1
- Provide Options type for execution in TS HOT 1
- Add common types to their own file/export w/outputIndex option HOT 2
- Questions about defaults, optionals, arrays, null/undefined HOT 2
- Support `google.api` attributes/conventions HOT 1
- NestJS without Observables HOT 1
- meta generated for messages with oneOf properties is incorret for other properties HOT 1
- Add types for toJSON/fromJSON methods HOT 1
- TypeError on Runtime ChannelCredentials object HOT 1
- Using 'useDate=string' parameter; the response is still anticipating an object for Timestamp Wrapper
- Encode crashes on `null` object values HOT 2
- Rpc doesn't account for metadata HOT 2
- Rpc is not exported by ts-proto as it previously was HOT 6
- Generated affixes HOT 1
- Conflicting protobuf definitions when using ts-proto plugin with Buf HOT 2
- Oneof objects do not follow generated interface. 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 ts-proto.