mini_racer_rs 1.0.6 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34cc61e0568863bc59e52837ee5366a5ee8c560d22ad81454ca29bdb55666c45
4
- data.tar.gz: cc817e64000b31c6baa15daa84103b0eca1022c2ddde7f2ff949f1e8ab808588
3
+ metadata.gz: 1cd380b3e8e2ba2c09a4e389bac31dfe9b6c1557660df3d9cadfd32f48e42648
4
+ data.tar.gz: 1bd9456a98bfce434951619a3e5eaf47dc39fd9b7825f8476e02656f8e5d4a5a
5
5
  SHA512:
6
- metadata.gz: 7ed16776a34d4b948408c4ab73a9024357ed383b3b294a6384a702559765bf4d9e4d4e1a481b86457a833bf498c89e9dc4e5e6ed364fab8de4fa7c71fc428d72
7
- data.tar.gz: 7dc43391ef4ef78d9a133c2646460648b849cf946417c958fdf8538a94c70eee24fc61f2cc00395f5e3e6aaa8b904e6af663e3c16ca2bd783538b0dd29397330
6
+ metadata.gz: 7975cc80b2c3d1be558d518da06144c5f06783ff71fe82fd032964bf97012e844e113c26a4237fb0d3810e91089eab544c91ccc64f4f1400ec30a4d205644877
7
+ data.tar.gz: 36361b28bc1d112ed6074c9a5026e4b1e70926ba8eec19e533f9b052d8ae9f4b8fce1f235df2c8ae04ca220a91a65dbacf9f1351f00714739dcec5286140624a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.1](https://github.com/andymai/mini_racer_rs/compare/v1.1.0...v1.1.1) (2026-10-21)
4
+
5
+
6
+ ### Performance
7
+
8
+ * **ext:** park at once for contexts whose answers outlast the spin budget ([#105](https://github.com/andymai/mini_racer_rs/issues/105)) ([66af89b](https://github.com/andymai/mini_racer_rs/commit/66af89b8d22ebe0c4dd28c877155131e3d7e5738))
9
+ * **wire:** add criterion benches for decoding, writing and transcoding ([#106](https://github.com/andymai/mini_racer_rs/issues/106)) ([42fc2b5](https://github.com/andymai/mini_racer_rs/commit/42fc2b50dba2a4a6437456293fbe61aa5d29aef8))
10
+
11
+ ## [1.1.0](https://github.com/andymai/mini_racer_rs/compare/v1.0.6...v1.1.0) (2026-10-19)
12
+
13
+
14
+ ### Features
15
+
16
+ * **source-maps:** map runtime error frames back to original sources ([#97](https://github.com/andymai/mini_racer_rs/issues/97)) ([d92bb05](https://github.com/andymai/mini_racer_rs/commit/d92bb0505ecd02deb1a0b62aa952268a5bdfb689))
17
+
3
18
  ## [1.0.6](https://github.com/andymai/mini_racer_rs/compare/v1.0.5...v1.0.6) (2026-10-19)
4
19
 
5
20
 
data/COMPATIBILITY.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  | Engine | Done | Planned | Deviation |
6
6
  |---|---|---|---|
7
- | CRuby | 54 | 0 | 27 |
7
+ | CRuby | 54 | 0 | 28 |
8
8
  | TruffleRuby | 58 | 0 | 0 |
9
9
 
10
10
  ## Surface
@@ -192,6 +192,12 @@ mini_racer_rs returns the same filtered results from a snapshot-based context as
192
192
 
193
193
  Approved 2026-10-16.
194
194
 
195
+ ### `behavior:source-maps@ruby`
196
+
197
+ After a source map is registered with `MiniRacerRs.register_source_map(bundle, map)`, `MiniRacer::RuntimeError` backtraces for contexts that evaluate a UTF-8 source containing the bundle show the mapped original file, line, and column for covered frames inside that bundle, while preserving V8's function name. mini_racer 0.22.1 has no source map support, so its runtime backtraces always show V8 positions. mini_racer_rs keeps V8 positions for async frames, frames after the tenth, `eval` and `new Function` code, frames outside the bundle, uncovered positions, and every frame when the reported frames do not align with V8's stack trace. `MiniRacer::ParseError` and `MiniRacer::ScriptError` messages are unchanged, as are JavaScript-visible values such as `Error.prototype.stack`. Latin-1 and UTF-16 sources and bundles in startup snapshots do not match. With no registered map, behavior is exactly that of mini_racer 0.22.1. Maps are process wide and limited to eight bundles. Affected contexts collect detailed stacks, increasing the measured cost of a 20-frame `new Error` from about 0.8 to 1.5 microseconds and a caught `throw {}` 20 frames deep from about 0.2 to 1.2 microseconds; measured React and MUI server renders were unchanged.
198
+
199
+ Approved 2026-10-18.
200
+
195
201
  ### `behavior:stack-exhaustion@ruby`
196
202
 
197
203
  mini_racer_rs raises `SystemStackError` with `stack level too deep` when converting a JavaScript result on a Ruby fiber or thread with too little machine stack remaining for Ruby to call a C function. When converting arguments for an attached Ruby callable, mini_racer_rs does not call the callable and gives JavaScript an Error with `stack level too deep`; if uncaught, `eval` raises that `SystemStackError` in Ruby. In both cases, the context remains usable and can evaluate `1 + 1` to `2` and dispose. Across 736 runs on 128 KiB fiber and thread stacks, using release and debug builds with and without `GC.stress` and compaction, mini_racer_rs never hung or crashed. On the same stack sizes without `GC.stress`, across 120 runs per conversion kind, mini_racer 0.22.1 results returned 59 times, raised `SystemStackError` 49 times, and hung 12 times, all for values containing Latin-1 or two-byte strings. mini_racer 0.22.1 callbacks delivered `stack level too deep` to JavaScript 87 times, returned 7 times, crashed with a segmentation fault 10 times, hung 8 times, and left 8 contexts unable to dispose with `context dispose: Device or resource busy`; with `GC.stress` and compaction, many result and callback runs aborted with `[BUG] system stack overflow during GC`. The tradeoff is stack cost: in a release build, a 95-level object result needed about 30 KiB beyond Ruby's method-call limit with mini_racer_rs, versus about 10 KiB with mini_racer 0.22.1, so near the end of a stack mini_racer_rs refuses some results that mini_racer 0.22.1 returns. At Ruby 3.4's default machine stacks, 512 KiB for a fiber and 1 MiB for a thread, mini_racer_rs converts every kind of value nested 95 levels deep.
data/Cargo.lock CHANGED
@@ -17,6 +17,27 @@ dependencies = [
17
17
  "memchr",
18
18
  ]
19
19
 
20
+ [[package]]
21
+ name = "alloca"
22
+ version = "0.4.0"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4"
25
+ dependencies = [
26
+ "cc",
27
+ ]
28
+
29
+ [[package]]
30
+ name = "anes"
31
+ version = "0.1.6"
32
+ source = "registry+https://github.com/rust-lang/crates.io-index"
33
+ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
34
+
35
+ [[package]]
36
+ name = "anstyle"
37
+ version = "1.0.14"
38
+ source = "registry+https://github.com/rust-lang/crates.io-index"
39
+ checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
40
+
20
41
  [[package]]
21
42
  name = "autocfg"
22
43
  version = "1.5.1"
@@ -59,6 +80,12 @@ dependencies = [
59
80
  "displaydoc",
60
81
  ]
61
82
 
83
+ [[package]]
84
+ name = "cast"
85
+ version = "0.3.0"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
88
+
62
89
  [[package]]
63
90
  name = "cc"
64
91
  version = "1.8.0"
@@ -95,6 +122,33 @@ dependencies = [
95
122
  "rand_core",
96
123
  ]
97
124
 
125
+ [[package]]
126
+ name = "ciborium"
127
+ version = "0.2.2"
128
+ source = "registry+https://github.com/rust-lang/crates.io-index"
129
+ checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e"
130
+ dependencies = [
131
+ "ciborium-io",
132
+ "ciborium-ll",
133
+ "serde",
134
+ ]
135
+
136
+ [[package]]
137
+ name = "ciborium-io"
138
+ version = "0.2.2"
139
+ source = "registry+https://github.com/rust-lang/crates.io-index"
140
+ checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757"
141
+
142
+ [[package]]
143
+ name = "ciborium-ll"
144
+ version = "0.2.2"
145
+ source = "registry+https://github.com/rust-lang/crates.io-index"
146
+ checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9"
147
+ dependencies = [
148
+ "ciborium-io",
149
+ "half",
150
+ ]
151
+
98
152
  [[package]]
99
153
  name = "clang-sys"
100
154
  version = "1.9.1"
@@ -106,6 +160,31 @@ dependencies = [
106
160
  "libloading",
107
161
  ]
108
162
 
163
+ [[package]]
164
+ name = "clap"
165
+ version = "4.6.7"
166
+ source = "registry+https://github.com/rust-lang/crates.io-index"
167
+ checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"
168
+ dependencies = [
169
+ "clap_builder",
170
+ ]
171
+
172
+ [[package]]
173
+ name = "clap_builder"
174
+ version = "4.6.7"
175
+ source = "registry+https://github.com/rust-lang/crates.io-index"
176
+ checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d"
177
+ dependencies = [
178
+ "anstyle",
179
+ "clap_lex",
180
+ ]
181
+
182
+ [[package]]
183
+ name = "clap_lex"
184
+ version = "1.1.1"
185
+ source = "registry+https://github.com/rust-lang/crates.io-index"
186
+ checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486"
187
+
109
188
  [[package]]
110
189
  name = "core_detect"
111
190
  version = "1.0.0"
@@ -139,6 +218,45 @@ dependencies = [
139
218
  "cfg-if",
140
219
  ]
141
220
 
221
+ [[package]]
222
+ name = "criterion"
223
+ version = "0.8.2"
224
+ source = "registry+https://github.com/rust-lang/crates.io-index"
225
+ checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3"
226
+ dependencies = [
227
+ "alloca",
228
+ "anes",
229
+ "cast",
230
+ "ciborium",
231
+ "clap",
232
+ "criterion-plot",
233
+ "itertools",
234
+ "num-traits",
235
+ "oorandom",
236
+ "page_size",
237
+ "regex",
238
+ "serde",
239
+ "serde_json",
240
+ "tinytemplate",
241
+ "walkdir",
242
+ ]
243
+
244
+ [[package]]
245
+ name = "criterion-plot"
246
+ version = "0.8.2"
247
+ source = "registry+https://github.com/rust-lang/crates.io-index"
248
+ checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea"
249
+ dependencies = [
250
+ "cast",
251
+ "itertools",
252
+ ]
253
+
254
+ [[package]]
255
+ name = "crunchy"
256
+ version = "0.2.4"
257
+ source = "registry+https://github.com/rust-lang/crates.io-index"
258
+ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
259
+
142
260
  [[package]]
143
261
  name = "deno_core_icudata"
144
262
  version = "0.78.0"
@@ -262,6 +380,17 @@ dependencies = [
262
380
  "crc32fast",
263
381
  ]
264
382
 
383
+ [[package]]
384
+ name = "half"
385
+ version = "2.7.1"
386
+ source = "registry+https://github.com/rust-lang/crates.io-index"
387
+ checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b"
388
+ dependencies = [
389
+ "cfg-if",
390
+ "crunchy",
391
+ "zerocopy",
392
+ ]
393
+
265
394
  [[package]]
266
395
  name = "home"
267
396
  version = "0.5.12"
@@ -353,6 +482,12 @@ dependencies = [
353
482
  "either",
354
483
  ]
355
484
 
485
+ [[package]]
486
+ name = "itoa"
487
+ version = "1.0.18"
488
+ source = "registry+https://github.com/rust-lang/crates.io-index"
489
+ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
490
+
356
491
  [[package]]
357
492
  name = "ixdtf"
358
493
  version = "0.6.6"
@@ -458,10 +593,11 @@ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
458
593
 
459
594
  [[package]]
460
595
  name = "mini_racer_engine"
461
- version = "1.0.6"
596
+ version = "1.1.1"
462
597
  dependencies = [
463
598
  "deno_core_icudata",
464
599
  "libc",
600
+ "mini_racer_sourcemap",
465
601
  "mini_racer_sync",
466
602
  "mini_racer_wire",
467
603
  "thiserror",
@@ -470,7 +606,7 @@ dependencies = [
470
606
 
471
607
  [[package]]
472
608
  name = "mini_racer_rs"
473
- version = "1.0.6"
609
+ version = "1.1.1"
474
610
  dependencies = [
475
611
  "magnus",
476
612
  "mini_racer_engine",
@@ -479,9 +615,19 @@ dependencies = [
479
615
  "thiserror",
480
616
  ]
481
617
 
618
+ [[package]]
619
+ name = "mini_racer_sourcemap"
620
+ version = "1.1.1"
621
+ dependencies = [
622
+ "memchr",
623
+ "serde",
624
+ "serde_json",
625
+ "thiserror",
626
+ ]
627
+
482
628
  [[package]]
483
629
  name = "mini_racer_sync"
484
- version = "1.0.6"
630
+ version = "1.1.1"
485
631
  dependencies = [
486
632
  "loom",
487
633
  "thiserror",
@@ -489,8 +635,9 @@ dependencies = [
489
635
 
490
636
  [[package]]
491
637
  name = "mini_racer_wire"
492
- version = "1.0.6"
638
+ version = "1.1.1"
493
639
  dependencies = [
640
+ "criterion",
494
641
  "proptest",
495
642
  "thiserror",
496
643
  ]
@@ -544,6 +691,22 @@ version = "1.21.4"
544
691
  source = "registry+https://github.com/rust-lang/crates.io-index"
545
692
  checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
546
693
 
694
+ [[package]]
695
+ name = "oorandom"
696
+ version = "11.1.5"
697
+ source = "registry+https://github.com/rust-lang/crates.io-index"
698
+ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e"
699
+
700
+ [[package]]
701
+ name = "page_size"
702
+ version = "0.6.0"
703
+ source = "registry+https://github.com/rust-lang/crates.io-index"
704
+ checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da"
705
+ dependencies = [
706
+ "libc",
707
+ "winapi",
708
+ ]
709
+
547
710
  [[package]]
548
711
  name = "paste"
549
712
  version = "1.0.15"
@@ -736,6 +899,15 @@ version = "1.0.23"
736
899
  source = "registry+https://github.com/rust-lang/crates.io-index"
737
900
  checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
738
901
 
902
+ [[package]]
903
+ name = "same-file"
904
+ version = "1.0.6"
905
+ source = "registry+https://github.com/rust-lang/crates.io-index"
906
+ checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
907
+ dependencies = [
908
+ "winapi-util",
909
+ ]
910
+
739
911
  [[package]]
740
912
  name = "scoped-tls"
741
913
  version = "1.0.1"
@@ -778,6 +950,19 @@ dependencies = [
778
950
  "syn 3.0.9",
779
951
  ]
780
952
 
953
+ [[package]]
954
+ name = "serde_json"
955
+ version = "1.0.154"
956
+ source = "registry+https://github.com/rust-lang/crates.io-index"
957
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
958
+ dependencies = [
959
+ "itoa",
960
+ "memchr",
961
+ "serde",
962
+ "serde_core",
963
+ "zmij",
964
+ ]
965
+
781
966
  [[package]]
782
967
  name = "sharded-slab"
783
968
  version = "0.1.7"
@@ -945,6 +1130,16 @@ dependencies = [
945
1130
  "zerovec",
946
1131
  ]
947
1132
 
1133
+ [[package]]
1134
+ name = "tinytemplate"
1135
+ version = "1.2.1"
1136
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1137
+ checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc"
1138
+ dependencies = [
1139
+ "serde",
1140
+ "serde_json",
1141
+ ]
1142
+
948
1143
  [[package]]
949
1144
  name = "tracing"
950
1145
  version = "0.1.44"
@@ -1029,6 +1224,16 @@ version = "0.1.1"
1029
1224
  source = "registry+https://github.com/rust-lang/crates.io-index"
1030
1225
  checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
1031
1226
 
1227
+ [[package]]
1228
+ name = "walkdir"
1229
+ version = "2.5.0"
1230
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1231
+ checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
1232
+ dependencies = [
1233
+ "same-file",
1234
+ "winapi-util",
1235
+ ]
1236
+
1032
1237
  [[package]]
1033
1238
  name = "which"
1034
1239
  version = "6.0.3"
@@ -1057,6 +1262,15 @@ version = "0.4.0"
1057
1262
  source = "registry+https://github.com/rust-lang/crates.io-index"
1058
1263
  checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1059
1264
 
1265
+ [[package]]
1266
+ name = "winapi-util"
1267
+ version = "0.1.11"
1268
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1269
+ checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
1270
+ dependencies = [
1271
+ "windows-sys 0.61.2",
1272
+ ]
1273
+
1060
1274
  [[package]]
1061
1275
  name = "winapi-x86_64-pc-windows-gnu"
1062
1276
  version = "0.4.0"
@@ -1195,6 +1409,26 @@ dependencies = [
1195
1409
  "synstructure",
1196
1410
  ]
1197
1411
 
1412
+ [[package]]
1413
+ name = "zerocopy"
1414
+ version = "0.8.63"
1415
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1416
+ checksum = "e5fe1f8f1b06191a00962174c61aa5005e0bb391a6d80d07e24d115c01a92ed8"
1417
+ dependencies = [
1418
+ "zerocopy-derive",
1419
+ ]
1420
+
1421
+ [[package]]
1422
+ name = "zerocopy-derive"
1423
+ version = "0.8.63"
1424
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1425
+ checksum = "863ad3ac83293fb4d740aedbfdc9240dd8d1a50c1099acd76ce80ce7c7230c7f"
1426
+ dependencies = [
1427
+ "proc-macro2",
1428
+ "quote",
1429
+ "syn 2.0.119",
1430
+ ]
1431
+
1198
1432
  [[package]]
1199
1433
  name = "zerofrom"
1200
1434
  version = "0.1.8"
@@ -1249,6 +1483,12 @@ dependencies = [
1249
1483
  "syn 3.0.9",
1250
1484
  ]
1251
1485
 
1486
+ [[package]]
1487
+ name = "zmij"
1488
+ version = "1.0.23"
1489
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1490
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
1491
+
1252
1492
  [[package]]
1253
1493
  name = "zoneinfo64"
1254
1494
  version = "0.3.0"
data/Cargo.toml CHANGED
@@ -2,6 +2,7 @@
2
2
  exclude = ["crates/mini_racer_wire/fuzz"]
3
3
  members = [
4
4
  "crates/mini_racer_engine",
5
+ "crates/mini_racer_sourcemap",
5
6
  "crates/mini_racer_sync",
6
7
  "crates/mini_racer_wire",
7
8
  "ext/mini_racer_rs",
@@ -14,18 +15,23 @@ license = "MIT"
14
15
  publish = false
15
16
  repository = "https://github.com/andymai/mini_racer_rs"
16
17
  rust-version = "1.91"
17
- version = "1.0.6"
18
+ version = "1.1.1"
18
19
 
19
20
  [workspace.dependencies]
21
+ criterion = {version = "0.8", default-features = false, features = ["cargo_bench_support"]}
20
22
  deno_core_icudata = "=0.78.0"
21
23
  libc = "0.2"
22
24
  loom = "0.7.2"
23
25
  magnus = {version = "=0.9.2", features = ["rb-sys"]}
26
+ memchr = "2"
24
27
  mini_racer_engine = {path = "crates/mini_racer_engine"}
28
+ mini_racer_sourcemap = {path = "crates/mini_racer_sourcemap"}
25
29
  mini_racer_sync = {path = "crates/mini_racer_sync"}
26
30
  mini_racer_wire = {path = "crates/mini_racer_wire"}
27
31
  proptest = {version = "1", default-features = false, features = ["std"]}
28
32
  rb-sys = "=0.9.130"
33
+ serde = {version = "1", default-features = false, features = ["alloc", "derive"]}
34
+ serde_json = {version = "1", default-features = false, features = ["alloc"]}
29
35
  thiserror = "2"
30
36
  v8 = "=152.2.0"
31
37