[gjs/esm/static-imports] Various doc cleanups.
- From: Evan Welsh <ewlsh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/esm/static-imports] Various doc cleanups.
- Date: Wed, 3 Feb 2021 04:12:39 +0000 (UTC)
commit 40545e9670c8e406443aa70c67eddc2f59d08385
Author: Evan Welsh <contact evanwelsh com>
Date: Tue Feb 2 20:12:33 2021 -0800
Various doc cleanups.
doc/ESModules.md | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/doc/ESModules.md b/doc/ESModules.md
index 954890cc..872d5da0 100644
--- a/doc/ESModules.md
+++ b/doc/ESModules.md
@@ -40,7 +40,7 @@ gjs -m module.js
### JavaScript "API"
ES Modules cannot be loaded from strings at this time.
-import('./module.js') can be used to load modules from any GJS script or module. `import` will always
default to loading a file as an ES Module.
+`import('./module.js')` can be used to load modules from any GJS script or module. `import` will always
default to loading a file as an ES Module.
### C API
Using the gjs.h API ES Modules can be loaded from a file or resource using
@@ -68,7 +68,7 @@ There are three types of specifiers:
Bare specifier resolutions import built-in modules.
All other specifier resolutions are always only resolved with
-the standard relative [URL][] resolution semantics.
+the standard relative URL resolution semantics.
### Mandatory file extensions
@@ -163,11 +163,11 @@ _('Hello!');
* [System](modules/System.md)
* [Gettext](modules/Gettext.md)
* [Gi](modules/GObject_Introspection.md)
-* ~~[Mainloop][]~~ <!-- TODO (not in ESM yet) -->
+* ~~Mainloop~~ <!-- TODO (not in ESM yet) -->
## `import()` expressions
-[Dynamic `import()`][] is not currently supported in GJS.
+Dynamic [`import()`][] is not currently supported in GJS.
## `import.meta`
@@ -212,10 +212,7 @@ When importing `imports` modules, all `var` declarations are provided as propert
#### No `imports` and `var` exports
-In most cases, the ES module `import` can be used to load CommonJS modules.
-
-If needed, a `require` function can be constructed within an ES module using
-[`module.createRequire()`][].
+You must use the [`export`][] syntax instead.
#### No `__filename` or `__dirname`
@@ -232,7 +229,6 @@ These `imports` variables are not available in ES modules.
[`import()`]: #esm_import_expressions
[`import.meta.url`]: #esm_import_meta_url
[`import`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
-[`transformSource` hook]: #esm_transformsource_source_context_defaulttransformsource
[`string`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
[special scheme]: https://url.spec.whatwg.org/#special-scheme
[official ECMAScript standard]: https://tc39.github.io/ecma262/#sec-modules
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]