Comments (3)
One issue I ran into when trying to implement this were recursive oneof types such as this one:
message LayerOne {
repeated LayerTwo layerTwo = 1;
}
message LayerTwo {
oneof msg {
LayerOne layerOne = 1;
}
}
Previously, there was no recursion issue here since we generated
type Msg = LayerOne LayerOne
which stops the recursion since it is not a type alias.
Now we want to generate
// Package.Msg.elm
type Msg a = LayerOne a
// Package.elm
type alias Msg = Msg LayerOne
// this expands into type alias Msg = Msg { msg: List LayerTwo }
// expands into type alias Msg = Msg { msg: List (Msg LayerOne ) }
// etc.
So similarily to directly recursive declarations like this one
message Rec {
oneof msg {
Rec rec = 1;
string other = 2;
}
}
we need to generate wrapper types and wrap
/unwrap
functions.
from protoc-gen-elm.
This feature is released in a 4.0.0-beta.0 version :)
from protoc-gen-elm.
Alright, I released 4.0 which generates this kind of code :)
from protoc-gen-elm.
Related Issues (11)
- All integer types encode/decode as int32 HOT 5
- Support for Int64 Datatypes HOT 2
- Name clashes HOT 21
- Odd generation of optional fields HOT 8
- proto comments are not transferred in the generated files HOT 1
- Indistinguishable messages HOT 7
- explicitly specifying plugin path HOT 1
- Dev tools support HOT 8
- Code repetition while encoding nested messages HOT 1
- Importing Enums generates Code that fails to compile 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 protoc-gen-elm.