Releases: sapphi-red/fresh-import
Releases · sapphi-red/fresh-import
v0.2.1
Immutable
release. Only release title and notes can be modified.
Patch Changes
- #8
113bdb8Thanks @sapphi-red! - Derive the tracking query name from a per-instance random value (fresh-import-<instance>). Previously two copies of the same build loaded into one process (e.g. Vite bundlesfresh-importwhile another package uses a separately bundled copy) registered the same query name, so only the first-registered hook captured the imports. A random value unique to each loaded module instance keeps their hooks distinct. This replaces the build-time hash, which could not disambiguate two instances of the same build.
v0.2.0
Immutable
release. Only release title and notes can be modified.
Minor Changes
-
#6
a19d7d9Thanks @sapphi-red! - ReplacecreateFreshImporterwith afreshImport(specifier)function and remove thequeryNameoption.freshImport(specifier)imports an entry in a fresh module graph and resolves to{ result, dependencies }. It lazily creates and reuses a single underlying importer (registering the resolution hook once) instead of one per call. On runtimes that provide neitherModule.registerHooksnorModule.register(e.g. non-Node), it returnsundefined, mirroringcreateFreshImporter's oldundefinedreturn.- The tracking query name is now derived internally as
fresh-import-<hash>(a build-time hash of the output), so thequeryNameoption and theFreshImporterOptionstype are gone.
-import { createFreshImporter } from 'fresh-import' -const importer = createFreshImporter() -const { result, dependencies } = await importer.collect(url) +import { freshImport } from 'fresh-import' +const { result, dependencies } = await freshImport(url)
v0.1.0
Immutable
release. Only release title and notes can be modified.
Minor Changes
- #4
db48f43Thanks @sapphi-red! - Simplify interface by running the dynamic import internally.
Patch Changes
e21d32bThanks @sapphi-red! - usetas the default value ofqueryNameoption