Invalidate cache when using import
オープン
まだ誰も着手していません。
esm
feature request
- 主要言語
- JavaScript
- スター
- 122k
- フォーク
- 37.3k
- 平均マージ
- 4日 2時間
- マージ済み PR(30日)
- 283
説明
How do I invalidate the cache of import?
I have a function that installs missing modules when an import fails, but the import statement seems to preserve the failure while the script is still running.
import('some-module').catch(
// this catch will only be reached the first time the script is run because resolveMissingModule will successfully install the module
() => resolveMissingModule('some-module').then(
// again, this will only be reached once, but it will fail, because the import seems to have cached the previous failure
() => import('some-module')
)
)
The only information I found in regards to import caching was this documentation, which does not tell me where the “separate cache” used by import can be found.
No require.cache
require.cacheis not used byimport. It has a separate cache.
— https://nodejs.org/api/esm.html#esm_no_require_cache
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
IssueでリンクされているESMキャッシュのセクションから始め、151件のコメントがあるスレッドと併せて動的インポートの例を確認してください。コントリビューションには、メンテナーが承認したスコープ(ドキュメント、APIまたは動作の変更、あるいはその両方)と、キャッシュ無効化を検証する方法の明記が必要ですが、現在のIssueにはそれがありません。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, node.js
- 領域
- backend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100