Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Sep 13, 2023
1 parent 20819ab commit e58682a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# import-meta-registry
A registry for import.meta properties
# `import.meta` Registry

This repository serves as a registry for properties JavaScript runtimes or frameworks may add to the [`import.meta`](https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#prod-ImportMeta) mechanism defined by TC-39/EcmaScript.

Because `import.meta` is a kind of global namespace, and because implementations are permitted to put whatever they like there, there are potential interoperability and code portability challenges introduced for developers if runtimes and frameworks fail to coordinate their use of the namespace. Therefore, the WinterCG has established this registry to serve as a coordination point.

WinterCG compliant runtimes should never use an `import.meta` property that conflicts in definition with any of the properties included in this registry.

Likewise, implementations should try their best to avoid adding new `import.meta` properties in their implementations, or to this registry, that conflict or overlap with other properties in this registry. Given that such conflict/overlap may not be always avoidable, registrations here should take care to describe when/where/how such properties differ from others they conflict/overlap with.

The process for adding new items to this registry is to open a pull request. Registrations must include all three fields: Name, Description, and a link to a specifying document. The specifying document does not need to be a formal standard -- links to project documentation or even source code is sufficient so long as the semantics of the property are appropriately described. After one week, if there are no objections from WinterCG participants to the registration and at least one sign off on the PR, it can be added.

| Property | Description | Link |
| --------------------- | ----------- | ---- |
| `import.meta.url` | A module scripts base URL | https://html.spec.whatwg.org/multipage/webappapis.html#hostgetimportmetaproperties |
| `import.meta.resolve` | Resolves a module specifier to a URL using the current module's URL as base. | https://html.spec.whatwg.org/multipage/webappapis.html#hostgetimportmetaproperties |
| `import.meta.main` | Returns whether the current module is the entry point to your program. | https://deno.land/[email protected]/runtime/import_meta_api#importmeta--api |

0 comments on commit e58682a

Please sign in to comment.