Skip to content

feat: rework typescript generator & add suite #46

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

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ac5e801
feat: rework typescript generator & add suite
MrFoxPro Sep 13, 2024
8a172cd
fix tests
MrFoxPro Sep 13, 2024
fbc01ec
fix scripts
MrFoxPro Sep 13, 2024
3ed4de9
numerous improvements
MrFoxPro Sep 13, 2024
6cf4b05
use bigint prefix instead of constructor
MrFoxPro Sep 13, 2024
b2ae174
remove useless constructor
MrFoxPro Sep 13, 2024
61483f1
remove excessive bigint transforms & update benchmarks
MrFoxPro Sep 13, 2024
bf4dcb8
simplify reader
MrFoxPro Sep 13, 2024
6c51c7d
simplify syntax
MrFoxPro Sep 13, 2024
9b58eba
remvoe extra BigInt constructor
MrFoxPro Sep 13, 2024
37d5ac1
fix formatting
MrFoxPro Sep 13, 2024
dd809f4
micro-optimisations
MrFoxPro Sep 13, 2024
759143f
cache DataView to improve performance
MrFoxPro Sep 13, 2024
faff968
microoptimisations
MrFoxPro Sep 13, 2024
9852173
improve performance by using subarray and global buffer for encoding
MrFoxPro Sep 13, 2024
5966e64
remove unnescessary copying in BinaryReader
MrFoxPro Sep 13, 2024
5015839
make unit values optional
MrFoxPro Sep 13, 2024
83f238c
make Option values optional
MrFoxPro Sep 13, 2024
ed1fbf1
remove .js extension
MrFoxPro Sep 28, 2024
84bc2db
inline variants, represent tuples as objects, convert to snake_case
MrFoxPro Oct 1, 2024
ee0401d
respect config.serialization
MrFoxPro Oct 2, 2024
c330453
replace WrapperOfCase with TypeScript bult-in `Extract`
MrFoxPro Oct 4, 2024
38316d7
simplify decoding initialization
MrFoxPro Oct 4, 2024
5e9bc72
fix string encoding
MrFoxPro Oct 4, 2024
06f8975
fix string encoding again & use native `setBigUint64`
MrFoxPro Oct 5, 2024
b7996e6
update benchmarks table
MrFoxPro Oct 5, 2024
c9a70cc
use `getBigUint64`, `getBigInt64`
MrFoxPro Oct 8, 2024
02e746c
switch to bincode 2
MrFoxPro Mar 9, 2025
145392e
minor fixes
MrFoxPro Mar 9, 2025
0844a9e
remove unused rule
MrFoxPro Mar 9, 2025
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
59 changes: 55 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ members = [
"serde-reflection",
"serde-generate",
"serde-generate-bin",
"suite/*"
]
resolver = "2"

Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
edition = "2018"
use_field_init_shorthand = true
disable_all_formatting = true
1 change: 1 addition & 0 deletions serde-generate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ serde = { version = "1.0.126", features = ["derive"] }
textwrap = "0.13.4"
phf = { version = "0.10", features = ["macros"], optional = true }
serde-reflection = { path = "../serde-reflection", version = "0.5.0" }
indoc = { version = "2" }

[dev-dependencies]
alloy-sol-types = "0.8.18"
Expand Down
25 changes: 25 additions & 0 deletions serde-generate/runtime/typescript/bincode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { BinaryReader, BinaryWriter } from "./serde.ts";

export class BincodeReader extends BinaryReader {
read_length() {
return Number(this.read_u64())
}
public read_variant_index() {
return this.read_u32()
}
check_that_key_slices_are_increasing(key1: [number, number], key2: [number, number]) {
return
}
}

export class BincodeWriter extends BinaryWriter {
write_length(value: number) {
this.write_u64(value)
}
public write_variant_index(value: number) {
this.write_u32(value)
}
public sort_map_entries(offsets: number[]) {
return
}
}

This file was deleted.

20 changes: 0 additions & 20 deletions serde-generate/runtime/typescript/bincode/bincodeSerializer.ts

This file was deleted.

7 changes: 0 additions & 7 deletions serde-generate/runtime/typescript/bincode/mod.ts

This file was deleted.

Loading
Loading