Skip to content

Commit

Permalink
docs(README): update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Jul 29, 2024
1 parent 108c398 commit a84c8a7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ Once an `ImportableVolume` has been created, any specifier in the virtual filesy

**Note:** `impvol` _only_ works with `import()`. It does not work with `require()`.

> [!CAUTION] Terrible things, in descending order of terribleness:
> [!CAUTION]
>
> - This lib overrides `memfs` internals. This lib is evil and I am bad.
> - `impvol` leaks memory. It is intended for use in _tests_, not production systems. Though, if you _do_ use it in production, please drop me a line so I can have a good laugh.
> - TS will not love importing from these magical imaginary files. Can probably be mitigated with ambient module declarations.
> This lib is horrible. In descending order of horror:
>
> - This lib overrides `memfs` internals. This is a bad idea. I am bad.
> - `impvol` **leaks memory**. It is intended for use in _tests_, not production systems. However, if you _do_ use it in production, please drop me a line so I can have a good laugh.
> - TS will not love importing from these magical imaginary files. This can probably be mitigated with ambient module declarations.
## Requirements

Expand All @@ -59,6 +61,10 @@ When the worker thread's resolve hook is hit, the dirty bit is checked. If it's

If there's a match, the resolve hook short-circuits with a URL using a custom protocol -- which is subsequently handled by the loader hook. The loader hook reads the file from the worker thread's filesystem if the custom protocol is detected.

### Memory Leaks

Repeatedly creating `ImportableVolume` instances will result in memory leaks because the worker threads running customization hooks are never terminated. As far as I can tell, such "module loader" worker threads are unable to be terminated by the parent process.

## Future

- JSON support
Expand Down

0 comments on commit a84c8a7

Please sign in to comment.