@@ -9,15 +9,15 @@ prototype chain of an object. Note that `final` is not suitable for accessing
9
9
data descriptor properties of JS objects; to accomplish this, use the ` structural `
10
10
attribute.
11
11
12
- [ host-bindings ] : https://github.com/WebAssembly/host-bindings
12
+ [ component-model ] : https://github.com/WebAssembly/component-model
13
13
[ reference-types ] : https://github.com/WebAssembly/reference-types
14
14
15
15
The ` final ` attribute is intended to be purely related to performance. It
16
16
ideally has no user-visible effect, and ` structural ` imports (the default)
17
17
should be able to transparently switch to ` final ` eventually.
18
18
19
- The eventual performance aspect is that with the [ host bindings
20
- proposal] [ host-bindings ] then ` wasm-bindgen ` will need to generate far fewer JS
19
+ The eventual performance aspect is that with the [ component model
20
+ proposal] [ component-model ] then ` wasm-bindgen ` will need to generate far fewer JS
21
21
function shims to import than it does today. For example, consider this import
22
22
today:
23
23
@@ -74,8 +74,8 @@ function with `getObject(arg0)` as the receiver.
74
74
75
75
But wait, there's still a JS function shim here even with ` final ` ! That's true,
76
76
and this is simply a fact of future WebAssembly proposals not being implemented
77
- yet. The semantics, though, match the future [ host bindings
78
- proposal] [ host-bindings ] because the method being called is determined exactly
77
+ yet. The semantics, though, match the future [ component model
78
+ proposal] [ component-model ] because the method being called is determined exactly
79
79
once, and it's located on the prototype chain rather than being resolved at
80
80
runtime when the function is called.
81
81
@@ -106,14 +106,14 @@ export function __wbg_bar_a81456386e6b526f(arg0, arg1, arg2) {
106
106
}
107
107
```
108
108
109
- Getting better! Next up we need the host bindings proposal. Note that the
109
+ Getting better! Next up we need the component model proposal. Note that the
110
110
proposal is undergoing some changes right now so it's tough to link to reference
111
111
documentation, but it suffices to say that it'll empower us with at least two
112
112
different features.
113
113
114
- First, host bindings promises to provide the concept of "argument conversions".
114
+ First, component model promises to provide the concept of "argument conversions".
115
115
The ` arg1 ` and ` arg2 ` values here are actually a pointer and a length to a utf-8
116
- encoded string, and with host bindings we'll be able to annotate that this
116
+ encoded string, and with component model we'll be able to annotate that this
117
117
import should take those two arguments and convert them to a JS string (that is,
118
118
the * host* should do this, the WebAssembly engine). Using that feature we can
119
119
further trim this down to:
@@ -126,10 +126,10 @@ export function __wbg_bar_a81456386e6b526f(arg0, varg1) {
126
126
}
127
127
```
128
128
129
- And finally, the second promise of the host bindings proposal is that we can
129
+ And finally, the second promise of the component model proposal is that we can
130
130
flag a function call to indicate the first argument is the ` this ` binding of the
131
131
function call. Today the ` this ` value of all called imported functions is
132
- ` undefined ` , and this flag (configured with host bindings ) will indicate the
132
+ ` undefined ` , and this flag (configured with component model ) will indicate the
133
133
first argument here is actually the ` this ` .
134
134
135
135
With that in mind we can further transform this to:
@@ -138,8 +138,8 @@ With that in mind we can further transform this to:
138
138
export const __wbg_bar_a81456386e6b526f = Foo .prototype .bar ;
139
139
```
140
140
141
- and voila! We, with [ reference types] [ reference-types ] and [ host
142
- bindings ] [ host-bindings ] , now have no JS function shim at all necessary to call
141
+ and voila! We, with [ reference types] [ reference-types ] and [ component
142
+ model ] [ component-model ] , now have no JS function shim at all necessary to call
143
143
the imported function. Additionally future wasm proposals to the ES module
144
144
system may also mean that don't even need the ` export const ... ` here too.
145
145
0 commit comments