Skip to content
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

feat: rework typescript generator & add suite #46

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b759b54
feat: rework typescript generator & add suite
MrFoxPro Sep 13, 2024
900fa83
fix tests
MrFoxPro Sep 13, 2024
b42b097
fix scripts
MrFoxPro Sep 13, 2024
ab6fba7
numerous improvements
MrFoxPro Sep 13, 2024
ecc928c
use bigint prefix instead of constructor
MrFoxPro Sep 13, 2024
865061e
remove useless constructor
MrFoxPro Sep 13, 2024
3284b1e
remove excessive bigint transforms & update benchmarks
MrFoxPro Sep 13, 2024
0c5025b
simplify reader
MrFoxPro Sep 13, 2024
d9322af
simplify syntax
MrFoxPro Sep 13, 2024
6c9539d
remvoe extra BigInt constructor
MrFoxPro Sep 13, 2024
dc56567
fix formatting
MrFoxPro Sep 13, 2024
dd05a75
micro-optimisations
MrFoxPro Sep 13, 2024
6c2f861
cache DataView to improve performance
MrFoxPro Sep 13, 2024
b83c33a
microoptimisations
MrFoxPro Sep 13, 2024
2baa6f9
improve performance by using subarray and global buffer for encoding
MrFoxPro Sep 13, 2024
1ac5bed
remove unnescessary copying in BinaryReader
MrFoxPro Sep 13, 2024
baf136a
make unit values optional
MrFoxPro Sep 13, 2024
4c9f0c3
make Option values optional
MrFoxPro Sep 13, 2024
d8ddf70
remove .js extension
MrFoxPro Sep 28, 2024
89dbcaf
inline variants, represent tuples as objects, convert to snake_case
MrFoxPro Oct 1, 2024
15057c4
respect config.serialization
MrFoxPro Oct 2, 2024
b9ae2d5
replace WrapperOfCase with TypeScript bult-in `Extract`
MrFoxPro Oct 4, 2024
6979c76
simplify decoding initialization
MrFoxPro Oct 4, 2024
1e2458a
fix string encoding
MrFoxPro Oct 4, 2024
8caaf4f
fix string encoding again & use native `setBigUint64`
MrFoxPro Oct 5, 2024
4c21a54
update benchmarks table
MrFoxPro Oct 5, 2024
d24a9f4
use `getBigUint64`, `getBigInt64`
MrFoxPro Oct 8, 2024
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
17 changes: 17 additions & 0 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
3 changes: 0 additions & 3 deletions rust-toolchain.toml

This file was deleted.

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 @@ -24,6 +24,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.4.0" }
indoc = "2.0.5"

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

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