Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README with modules info #9

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,23 @@ Features
* Capable of running Babel, Typescript compiler and pretty much anything written in ES5.
* Sourcemaps.
* Most of ES6 functionality, still work in progress, see https://github.com/grafana/sobek/milestone/1?closed=1
* Experimental ESM support.

Known incompatibilities and caveats
-----------------------------------

### ESM support

ECMAScript Modules or ESM for short was implemented and merged in this fork to facilitate the needs of [k6](https://github.com/grafana/k6/) as such some compromises were taken in favor of time.

In general the API is very close to the specification, which unfortunately does *not* translate greatly to actual usage.

For this reason it is very likely that it will be updated in breaking manner in the future and there is currently no concrete documentation around it.

For any usage info or bare documentation it is recommended to look at the tests in [modules_test.go](https://github.com/grafana/sobek/blob/main/modules_test.go) and [modules_integration_test.go](https://github.com/grafana/sobek/blob/main/modules_integration_test.go).

Also of note is that due to the nature of ESM you need to have an event loop implementation to use it. That is still not provided by Sobek and likely never will be.

### WeakMap
WeakMap is implemented by embedding references to the values into the keys. This means that as long
as the key is reachable all values associated with it in any weak maps also remain reachable and therefore
Expand Down Expand Up @@ -132,7 +145,6 @@ do not just base it on a couple of examples that work fine.
Current Status
--------------

* There should be no breaking changes in the API, however it may be extended.
* Some of the AnnexB functionality is missing.

Basic Example
Expand Down
Loading