Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tcodes0/esm-repl-reload-repro
https://github.com/tcodes0/esm-repl-reload-repro
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tcodes0/esm-repl-reload-repro
- Owner: tcodes0
- Created: 2020-06-27T23:59:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-01T21:11:39.000Z (almost 2 years ago)
- Last Synced: 2024-10-03T07:54:06.357Z (about 2 months ago)
- Language: TypeScript
- Size: 1.19 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Decache esm node code reload repro
1. clone this repo
- ensure you have yarn installed
2. run `yarn`
3. run `yarn repl`expect to see repl:
``` shell
~> yarn repl
yarn run v1.22.4
$ yarn workspace @zet/repl start
$ node --loader ts-node/esm --experimental-specifier-resolution=node --experimental-top-level-await --no-warnings index.ts --transpile-only -r tsconfig-paths/register index.ts
> { 'decache reloading module': '@zet/stuff' }INFO: Welcome to the REPL
.help see commands
global.watchers auto-reload watchers, if you need them
global.s saves results, also unwraps promises. Aliases: save
global.__ last saved result
global.__h history of all saved results. Aliases: __history
.lastReload last reload status
.r reload manually
.e or .exit leave :(
.c See available code on context
global.stuff stuff package>
```4. type `stuff` hit enter, expect to see this
```
> stuff
[Module] {
description: 'bar'
}
```5. modify `packages/stuff/index.ts` in some way, like changing `description` export to another string, like `foo`.
- `{ 'decache reloading module': '@zet/stuff' }` will print, meaning the file change was picked up.
6. type `stuff` hit enter, expect to see this (same as before)
```
> stuff
[Module] {
description: 'bar'
}
```## Wanted description to have value `foo` after reload event, but it had same value.
Check branch `working` and retry these steps to see it working.