Skip to content

Commit

Permalink
Remove jsxref
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Sep 13, 2022
1 parent ca27abc commit 16a6d42
Show file tree
Hide file tree
Showing 39 changed files with 143 additions and 154 deletions.
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/58/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ _No changes._
### Other

- "Add to home screen" is now supported in Firefox for Android, part of the [Progressive Web Apps](/en-US/docs/Web/Progressive_web_apps) effort ({{bug(1212648)}}).
- [WebAssembly](/en-US/docs/WebAssembly) now has a tiered compiler providing load time optimizations ({{bug(1277562)}}), and new streaming APIs — {{jsxref("WebAssembly.compileStreaming()")}} and {{jsxref("WebAssembly.installStreaming()")}} {{bug(1347644)}}.
- [WebAssembly](/en-US/docs/WebAssembly) now has a tiered compiler providing load time optimizations ({{bug(1277562)}}), and new streaming APIs — [`WebAssembly.compileStreaming()`](/en-US/docs/WebAssembly/JavaScript_interface/compileStreaming) and [`WebAssembly.installStreaming()`](/en-US/docs/WebAssembly/JavaScript_interface/installStreaming) {{bug(1347644)}}.

## Removals from the web platform

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/62/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ _No changes._

### JavaScript

- The {{jsxref("WebAssembly.Global()")}} constructor is now supported, along with global variables in WebAssembly ({{bug(1464656)}}).
- The [`WebAssembly.Global()`](/en-US/docs/WebAssembly/JavaScript_interface/Global) constructor is now supported, along with global variables in WebAssembly ({{bug(1464656)}}).
- The {{jsxref("Array.prototype.flat()")}} and {{jsxref("Array.prototype.flatMap()")}} methods are now enabled by default ({{bug(1435813)}}).
- The [`import.meta`](/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) property has been implemented to expose context-specific metadata to a JavaScript module ({{bug(1427610)}}).
- JavaScript [string literals](/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#string_literals) may now directly contain the U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR characters. As a consequence, {{jsxref("JSON")}} syntax is now a subset of JavaScript literal syntax (see {{bug(1435828)}} and the TC39 proposal [json-superset](https://github.com/tc39/proposal-json-superset)).
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/mozilla/firefox/releases/64/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ _No changes._

- The TC39 [Well-formed JSON.stringify](https://github.com/tc39/proposal-well-formed-stringify) proposal has been implemented, to prevent {{jsxref("JSON.stringify")}} from returning ill-formed Unicode strings ({{bug(1469021)}}).
- Proxied functions can now be passed to {{jsxref("Function.prototype.toString")}}`.call()` ({{bug(1440468)}}).
- In the {{jsxref("WebAssembly.Global")}} constructor, if no value is specified a typed 0 value is used. This is specified by the [`DefaultValue` algorithm](https://webassembly.github.io/spec/js-api/#defaultvalue) ({{bug(1490286)}}).
- In the [`WebAssembly.Global()`](/en-US/docs/WebAssembly/JavaScript_interface/Global) constructor, if no value is specified a typed 0 value is used. This is specified by the [`DefaultValue` algorithm](https://webassembly.github.io/spec/js-api/#defaultvalue) ({{bug(1490286)}}).

### APIs

Expand Down
11 changes: 0 additions & 11 deletions files/en-us/web/javascript/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,6 @@ This part of the JavaScript section on MDN serves as a repository of facts about
- {{JSxRef("Global_Objects/Intl/RelativeTimeFormat", "Intl.RelativeTimeFormat")}}
- {{JSxRef("Global_Objects/Intl/Segmenter", "Intl.Segmenter")}}

### WebAssembly

- {{JSxRef("WebAssembly")}}
- {{JSxRef("WebAssembly.Module")}}
- {{JSxRef("WebAssembly.Instance")}}
- {{JSxRef("WebAssembly.Memory")}}
- {{JSxRef("WebAssembly.Table")}}
- {{JSxRef("WebAssembly.CompileError")}}
- {{JSxRef("WebAssembly.LinkError")}}
- {{JSxRef("WebAssembly.RuntimeError")}}

## Statements

[JavaScript statements and declarations](/en-US/docs/Web/JavaScript/Reference/Statements)
Expand Down
6 changes: 3 additions & 3 deletions files/en-us/webassembly/caching_modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ tags:

{{WebAssemblySidebar}}

> **Warning:** Experimental {{jsxref("WebAssembly.Module")}} IndexedDB serialization support is being removed from browsers; see {{bug("1469395")}} and [this spec issue](https://github.com/WebAssembly/spec/issues/821).
> **Warning:** Experimental [`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) IndexedDB serialization support is being removed from browsers; see {{bug("1469395")}} and [this spec issue](https://github.com/WebAssembly/spec/issues/821).
Caching is useful for improving the performance of an app — we can store compiled WebAssembly modules on the client, so they don't have to be downloaded and compiled every time. This article explains the best practices around this.

## Caching via IndexedDB

[IndexedDB](/en-US/docs/Web/API/IndexedDB_API) is a transactional database system that allows you to store and retrieve structured data on the client-side. It is ideal for persisting assets locally for the saved state of an application, including text, blobs, and any other type of cloneable object.

This includes compiled wasm modules ({{jsxref("WebAssembly.Module")}} JavaScript objects).
This includes compiled wasm modules ([`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) JavaScript objects).

## Setting up a caching library

Expand Down Expand Up @@ -132,7 +132,7 @@ If not, we compile it from scratch and then store the compiled Module in the dat
},
```
> **Note:** It is for this kind of usage that {{jsxref("WebAssembly.instantiate()")}} returns both a {{jsxref("WebAssembly.Module()", "Module")}} and an {{jsxref("WebAssembly.Instance()", "Instance")}}: the Module represents the compiled code and can be stored/retrieved in IDB or shared between Workers via [`postMessage()`](/en-US/docs/Web/API/MessagePort/postMessage); the Instance is stateful and contains the callable JavaScript functions, therefore it cannot be stored/shared.
> **Note:** It is for this kind of usage that [`WebAssembly.instantiate()`](/en-US/docs/WebAssembly/JavaScript_interface/instantiate) returns both a [`Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) and an [`Instance`](/en-US/docs/WebAssembly/JavaScript_interface/Instance): the Module represents the compiled code and can be stored/retrieved in IDB or shared between Workers via [`postMessage()`](/en-US/docs/Web/API/MessagePort/postMessage); the Instance is stateful and contains the callable JavaScript functions, therefore it cannot be stored/shared.
If opening the database failed (for example due to permissions or quota), we fall back to fetching and compiling the module and don't try to store the results (since there is no database to store them into).
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/webassembly/exported_functions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ WebAssembly.instantiateStreaming(fetch("table.wasm")).then((obj) => {
});
```

Here we create a table (`otherTable`) from JavaScript using the {{jsxref("WebAssembly.Table")}} constructor, then we load `table.wasm` into our page using the {{jsxref("WebAssembly.instantiateStreaming()")}} method.
Here we create a table (`otherTable`) from JavaScript using the [`WebAssembly.Table`](/en-US/docs/WebAssembly/JavaScript_interface/Table) constructor, then we load `table.wasm` into our page using the [`WebAssembly.instantiateStreaming()`](/en-US/docs/WebAssembly/JavaScript_interface/instantiateStreaming) method.

We then get the function exported from the module, retrieve the functions it references via [`tbl.get()`](/en-US/docs/WebAssembly/JavaScript_interface/Table/get) and log the result of invoking each one to the console. Next, we use `set()` to make the `otherTable` table contain references to the same functions as the `tbl` table.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/webassembly/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ And what's even better is that it is being developed as a web standard via the [
- [WebAssembly JavaScript interface](/en-US/docs/WebAssembly/JavaScript_interface)
- : This object acts as the namespace for all WebAssembly related functionality.
- [`WebAssembly.Global()`](/en-US/docs/WebAssembly/JavaScript_interface/Global)
- : A `WebAssembly.Global` object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more {{jsxref("WebAssembly.Module")}} instances. This allows dynamic linking of multiple modules.
- : A `WebAssembly.Global` object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more [`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) instances. This allows dynamic linking of multiple modules.
- [`WebAssembly.Module()`](/en-US/docs/WebAssembly/JavaScript_interface/Module)
- : A `WebAssembly.Module` object contains stateless WebAssembly code that has already been compiled by the browser and can be efficiently [shared with Workers](/en-US/docs/Web/API/Worker/postMessage), and instantiated multiple times.
- [`WebAssembly.Instance()`](/en-US/docs/WebAssembly/JavaScript_interface/Instance)
Expand Down
10 changes: 5 additions & 5 deletions files/en-us/webassembly/javascript_interface/compile/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ browser-compat: javascript.builtins.WebAssembly.compile
{{WebAssemblySidebar}}

The **`WebAssembly.compile()`** function compiles WebAssembly
binary code into a {{jsxref("WebAssembly.Module")}} object. This function is useful if
binary code into a [`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) object. This function is useful if
it is necessary to a compile a module before it can be instantiated (otherwise, the
{{jsxref("WebAssembly.instantiate()")}} function should be used).
[`WebAssembly.instantiate()`](/en-US/docs/WebAssembly/JavaScript_interface/instantiate) function should be used).

## Syntax

Expand All @@ -33,15 +33,15 @@ WebAssembly.compile(bufferSource)

### Return value

A `Promise` that resolves to a {{jsxref("WebAssembly.Module")}} object
A `Promise` that resolves to a [`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) object
representing the compiled module.

### Exceptions

- If `bufferSource` is not a [typed array](/en-US/docs/Web/JavaScript/Typed_arrays) or {{jsxref("ArrayBuffer")}},
the promise rejects with a {{jsxref("TypeError")}}.
- If compilation fails, the promise rejects with a
{{jsxref("WebAssembly.CompileError")}}.
[`WebAssembly.CompileError`](/en-US/docs/WebAssembly/JavaScript_interface/CompileError).

## Examples

Expand All @@ -60,7 +60,7 @@ fetch('simple.wasm')
```

> **Note:** You'll probably want to use
> {{jsxref("WebAssembly.compileStreaming()")}} in most cases, as it is more efficient
> [`WebAssembly.compileStreaming()`](/en-US/docs/WebAssembly/JavaScript_interface/compileStreaming) in most cases, as it is more efficient
> than `compile()`.
## Specifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ browser-compat: javascript.builtins.WebAssembly.compileStreaming
{{WebAssemblySidebar}}

The **`WebAssembly.compileStreaming()`** function compiles a
{{jsxref("WebAssembly.Module")}} directly from a streamed underlying source. This
[`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) directly from a streamed underlying source. This
function is useful if it is necessary to a compile a module before it can be
instantiated (otherwise, the {{jsxref("WebAssembly.instantiateStreaming()")}} function
instantiated (otherwise, the [`WebAssembly.instantiateStreaming()`](/en-US/docs/WebAssembly/JavaScript_interface/instantiateStreaming) function
should be used).

## Syntax
Expand All @@ -37,15 +37,15 @@ WebAssembly.compileStreaming(source)

### Return value

A `Promise` that resolves to a {{jsxref("WebAssembly.Module")}} object
A `Promise` that resolves to a [`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) object
representing the compiled module.

### Exceptions

- If `source` is not a [`Response`](/en-US/docs/Web/API/Response) or `Promise` resolving to a `Response`,
the promise rejects with a {{jsxref("TypeError")}}.
- If compilation fails, the promise rejects with a
{{jsxref("WebAssembly.CompileError")}}.
[`WebAssembly.CompileError`](/en-US/docs/WebAssembly/JavaScript_interface/CompileError).
- If the `source` is a `Promise` that rejects, the promise rejects with the error.
- If the `source` `Result` has an error (e.g. bad MIME type), the promise rejects an error.

Expand All @@ -55,7 +55,7 @@ representing the compiled module.

The following example (see our [compile-streaming.html](https://github.com/mdn/webassembly-examples/blob/master/js-api-examples/compile-streaming.html)
demo on GitHub, and [view it live](https://mdn.github.io/webassembly-examples/js-api-examples/compile-streaming.html) also) directly streams a .wasm module from an underlying source then
compiles it to a {{jsxref("WebAssembly.Module")}} object. Because the
compiles it to a [`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) object. Because the
`compileStreaming()` function accepts a promise for a [`Response`](/en-US/docs/Web/API/Response)
object, you can directly pass it a [`fetch()`](/en-US/docs/Web/API/fetch)
call, and it will pass the response into the function when it fulfills.
Expand All @@ -69,7 +69,7 @@ WebAssembly.compileStreaming(fetch('simple.wasm'))
```

The resulting module instance is then instantiated using
{{jsxref("WebAssembly.instantiate()")}}, and the exported function invoked.
[`WebAssembly.instantiate()`](/en-US/docs/WebAssembly/JavaScript_interface/instantiate), and the exported function invoked.

## Specifications

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ new Exception(tag, payload, options)
### Parameters

- `tag`
- : An {{jsxref("WebAssembly.Tag")}} defining the data types expected for each of the values in the `payload`.
- : An [`WebAssembly.Tag`](/en-US/docs/WebAssembly/JavaScript_interface/Tag) defining the data types expected for each of the values in the `payload`.
- `payload`
- : An array of one or more data fields comprising the payload of the exception.
The elements must match the data types of the corresponding elements in the `tag`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ browser-compat: javascript.builtins.WebAssembly.Exception.getArg

{{WebAssemblySidebar}}

The **`getArg()`** prototype method of the {{jsxref("WebAssembly.Exception", "Exception")}} object can be used to get the value of a specified item in the exception's data arguments.
The **`getArg()`** prototype method of the [`Exception`](/en-US/docs/WebAssembly/JavaScript_interface/Exception) object can be used to get the value of a specified item in the exception's data arguments.

The method passes a {{jsxref("WebAssembly.Tag")}} and will only succeed if the thrown `Exception` was created using the same tag, otherwise it will throw a `TypeError`.
The method passes a [`WebAssembly.Tag`](/en-US/docs/WebAssembly/JavaScript_interface/Tag) and will only succeed if the thrown `Exception` was created using the same tag, otherwise it will throw a `TypeError`.
This ensures that the exception can only be read if the calling code has access to the tag.
Tags that are neither imported into or exported from the WebAssembly code are internal, and their associated [`WebAssembly.Exception`](/en-US/docs/WebAssembly/JavaScript_interface/Exception) cannot be queried using this method!

Expand All @@ -31,7 +31,7 @@ getArg(exceptionTag, index)
### Parameters

- `exceptionTag`
- : A {{jsxref("WebAssembly.Tag")}} that must match the tag associated with this exception.
- : A [`WebAssembly.Tag`](/en-US/docs/WebAssembly/JavaScript_interface/Tag) that must match the tag associated with this exception.
- `index`
- : The index of the value in the data arguments to return, 0-indexed.

Expand Down Expand Up @@ -75,7 +75,7 @@ This imports a tag, which it refers to internally as `$tagname`, and exports a m
)
```

The code below calls [`WebAssembly.instantiateStreaming`](/en-US/docs/WebAssembly/JavaScript_interface/instantiateStreaming) to import the "example.wasm" file, passing in an "import object" (`importObject`) that includes a new {{jsxref("WebAssembly.Tag")}} named `tagToImport`.
The code below calls [`WebAssembly.instantiateStreaming`](/en-US/docs/WebAssembly/JavaScript_interface/instantiateStreaming) to import the "example.wasm" file, passing in an "import object" (`importObject`) that includes a new [`WebAssembly.Tag`](/en-US/docs/WebAssembly/JavaScript_interface/Tag) named `tagToImport`.
The import object defines an object with properties that match the `import` statement in the WebAssembly code.

Once the file is instantiated, the code calls the exported WebAssembly `run()` method, which will immediately throw an exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ browser-compat: javascript.builtins.WebAssembly.Exception

The **`WebAssembly.Exception`** object represents a runtime exception thrown from WebAssembly to JavaScript, or thrown from JavaScript to a WebAssembly exception handler.

The [constructor](/en-US/docs/WebAssembly/JavaScript_interface/Exception/Exception) accepts a {{jsxref("WebAssembly.Tag")}}, an array of values, and an `options` object as arguments.
The [constructor](/en-US/docs/WebAssembly/JavaScript_interface/Exception/Exception) accepts a [`WebAssembly.Tag`](/en-US/docs/WebAssembly/JavaScript_interface/Tag), an array of values, and an `options` object as arguments.
The tag uniquely defines the _type_ of an exception, including the order of its arguments and their data types.
The same tag that was used to create the `Exception` is required to access the arguments of a thrown exception.
Methods are provided to test whether an exception matches a particular tag, and also to get a particular value by index (if the exception matches specified tag).
Expand Down Expand Up @@ -78,7 +78,7 @@ Consider the following WebAssembly code, which is assumed to be compiled to a fi
)
```

The code below calls [`WebAssembly.instantiateStreaming`](/en-US/docs/WebAssembly/JavaScript_interface/instantiateStreaming) to import the **example.wasm** file, passing in an "import object" (`importObject`) that includes a new {{jsxref("WebAssembly.Tag")}} named `tagToImport`.
The code below calls [`WebAssembly.instantiateStreaming`](/en-US/docs/WebAssembly/JavaScript_interface/instantiateStreaming) to import the **example.wasm** file, passing in an "import object" (`importObject`) that includes a new [`WebAssembly.Tag`](/en-US/docs/WebAssembly/JavaScript_interface/Tag) named `tagToImport`.
The import object defines an object with properties that match the `import` statement in the WebAssembly code.

Once the file is instantiated, the code calls the exported WebAssembly `run()` method, which will immediately throw an exception.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ is(tag)
### Parameters

- `tag`
- : An {{jsxref("WebAssembly.Tag")}} that can be checked to verify the type of the exception.
- : An [`WebAssembly.Tag`](/en-US/docs/WebAssembly/JavaScript_interface/Tag) that can be checked to verify the type of the exception.

### Return value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ browser-compat: javascript.builtins.WebAssembly.Global.Global

{{WebAssemblySidebar}}

A **`WebAssembly.Global()`** constructor creates a new `Global` object representing a global variable instance, accessible from both JavaScript and importable/exportable across one or more {{jsxref("WebAssembly.Module")}} instances.
A **`WebAssembly.Global()`** constructor creates a new `Global` object representing a global variable instance, accessible from both JavaScript and importable/exportable across one or more [`WebAssembly.Module`](/en-US/docs/WebAssembly/JavaScript_interface/Module) instances.
This allows dynamic linking of multiple modules.

## Syntax
Expand Down
Loading

0 comments on commit 16a6d42

Please sign in to comment.