Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- name: Install webrpc-gen
run: |
curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.32.3/webrpc-gen.linux-amd64
curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.37.0/webrpc-gen.linux-amd64
chmod +x ./webrpc-gen
echo $PWD >> $GITHUB_PATH

Expand Down
3 changes: 3 additions & 0 deletions _examples/hello-webrpc/hello-api.ridl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ enum Kind: uint32
- USER = 1
- ADMIN = 2

type Username: string
type Age: uint32

struct Empty

struct User
Expand Down
10 changes: 7 additions & 3 deletions _examples/hello-webrpc/webapp/client.gen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// hello-webrpc v1.0.0 7037367a376940060eaf2739a920c4dca4a6dc2e
// hello-webrpc v1.0.0 949b00a8db9810c69295f9dd9f02587a65d3c497
// --
// Code generated by webrpc-gen@v0.32.3 with ../../ generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.37.0 with ../../ generator. DO NOT EDIT.
//
// webrpc-gen -schema=hello-api.ridl -target=../../ -exports=false -client -out=./webapp/client.gen.js

Expand All @@ -11,12 +11,16 @@ const WebRPCVersion = "v1"
const WebRPCSchemaVersion = "v1.0.0"

// Schema hash generated from your RIDL schema
const WebRPCSchemaHash = "7037367a376940060eaf2739a920c4dca4a6dc2e"
const WebRPCSchemaHash = "949b00a8db9810c69295f9dd9f02587a65d3c497"

//
// Types
//

// type Username = string

// type Age = uint32

var Kind;
(function (Kind) {
Kind["USER"] = "USER"
Expand Down
4 changes: 4 additions & 0 deletions types.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
})({{$enumName}} || ({{$enumName}} = {}))
{{end -}}

{{- if isAliasType $type }}
// type {{$type.Name}} = {{$type.Type}}
{{end -}}

{{- if isStructType $type }}
{{if $opts.exports}}export {{end}}class {{.Name}} {
constructor(_data) {
Expand Down
Loading