Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 12 Jun 05:48
· 5 commits to main since this release
Immutable release. Only release title and notes can be modified.
7f2c0e7

Minor Changes

  • #6 a19d7d9 Thanks @sapphi-red! - Replace createFreshImporter with a freshImport(specifier) function and remove the queryName option.

    • 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 neither Module.registerHooks nor Module.register (e.g. non-Node), it returns undefined, mirroring createFreshImporter's old undefined return.
    • The tracking query name is now derived internally as fresh-import-<hash> (a build-time hash of the output), so the queryName option and the FreshImporterOptions type 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)