quickjs 0.19.0.pre2 → 0.19.0.rc1
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 +4 -4
- data/README.md +9 -0
- data/lib/quickjs/version.rb +1 -1
- data/polyfills/package-lock.json +2 -2
- data/polyfills/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d29c7b3de6c3f220531b61bb737fb054d1d34e2fada9c6e1b2ee1ddd60917b7
|
|
4
|
+
data.tar.gz: 251c892990e661de83b96a89a0d559351b36e81df083e5da387c00b9d89d214b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fcadcd548374b0f27221692de04ea18d9674d736d6661ded745b97fc2a44cd18aab62fa8f092e0663a749f04c60d9d6cc97161aab3b22d65bb4ad61a2a2af892
|
|
7
|
+
data.tar.gz: 8150273c6bc6b8bb2b52b6cb0930d0ced0e27603a51ded5beff67b805edeed0636bf7d59e477998da878881c5e40bfc4c3ea2d85d863e2f524fd403fd97bf5a3
|
data/README.md
CHANGED
|
@@ -406,6 +406,15 @@ vm = Quickjs::VM.new(features: [:polyfill_my_thing])
|
|
|
406
406
|
vm.eval_code('MyThing.greet("hi")')
|
|
407
407
|
```
|
|
408
408
|
|
|
409
|
+
`source:` also accepts a `Proc` returning a `String` — useful in companion gems that call `register_polyfill` at `require` time without paying the file-read cost unless a VM actually opts into the feature:
|
|
410
|
+
|
|
411
|
+
```rb
|
|
412
|
+
Quickjs.register_polyfill(
|
|
413
|
+
:polyfill_my_thing,
|
|
414
|
+
source: -> { File.read('vendor/my-polyfill.min.js') }
|
|
415
|
+
)
|
|
416
|
+
```
|
|
417
|
+
|
|
409
418
|
The first VM with a given polyfill pays the parse cost (the source is compiled to QuickJS bytecode on a disposable VM with a generous timeout); subsequent VMs reuse the cached bytecode. The polyfill body runs without consuming the user VM's `timeout_msec` budget — that's reserved for user code.
|
|
410
419
|
|
|
411
420
|
Intl APIs (Collator, DateTimeFormat, NumberFormat, PluralRules, Locale, etc.) live in a separate companion gem: [`quickjs-polyfill-intl`](https://github.com/hmsk/quickjs-polyfill-intl). Granular, dependency-aware, opt-in per API.
|
data/lib/quickjs/version.rb
CHANGED
data/polyfills/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quickjs-rb-polyfills",
|
|
3
|
-
"version": "0.19.0.
|
|
3
|
+
"version": "0.19.0.rc1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "quickjs-rb-polyfills",
|
|
9
|
-
"version": "0.19.0.
|
|
9
|
+
"version": "0.19.0.rc1",
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"rolldown": "^1.0.0-rc.14"
|
|
12
12
|
}
|
data/polyfills/package.json
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: quickjs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.19.0.
|
|
4
|
+
version: 0.19.0.rc1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- hmsk
|
|
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
115
115
|
requirements:
|
|
116
116
|
- - ">="
|
|
117
117
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: 3.
|
|
118
|
+
version: 3.2.0
|
|
119
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
requirements:
|
|
121
121
|
- - ">="
|