Skip to content

Releases: esm-dev/esm.sh

v115

12 Apr 09:48
@ije ije
Compare
Choose a tag to compare

in v115, we added ?module query to allow you import .wasm as a WebAssembly.Module Object:

import wasm from "https://esm.sh/@dqbd/[email protected]/tiktoken_bg.wasm?module"

const { exports } = WebAssembly.instantiate(wasm, imports)

Changelog:

  • Return JavaScript module for ?module query with .wasm files
  • Fix types transformer (close #581)
  • Fix incorrect named import of cjs modules (close #583)
  • Fix submodule path resolving (close #584)
  • Upgrade @types/node to 18

v114

06 Apr 11:05
@ije ije
Compare
Choose a tag to compare

In v114, we switched to pnpm instead of yarn which can save the server disk space and improve the build performance significantly, and now the server can handle package files of private registry (thanks @Justinidlerz for contributing to this).

We upgraded esbuild to 0.17.14, and a new query ?conditions added as conditions option of esbuild:

import foo from "https://esm.sh/foo?conditions=custom1,custom2"

For Deno users, we fixed some incorrect/missed types. Thanks for @marvinhagemeister making him first great PR to this project.

Changelog:

  • Add ?conditions query as esbuild option
  • Use pnpm to install packages instead of yarn (save the server disk space & improve the build performance)
  • Serve static files on local (#564 @Justinidlerz)
  • Support .d.mts extension (close #580)
  • Fix CJS transpiling (close #577)
  • Fix types building (close #572, #576)
  • Fix invalid type URL if submodule is main entry (#579 @marvinhagemeister)
  • Upgrade esbuild to 0.17.14

v113

25 Mar 18:59
@ije ije
Compare
Choose a tag to compare
  • express is working in Deno
  • Fix lost non-mjs-extension module caused by v112 (close #559)
  • Fix exports of netmask and xml2js (#561 @jcc10)
  • Fix default import of deps for cjs (close #565, #566)

v112

22 Mar 20:20
@ije ije
Compare
Choose a tag to compare

The CDN serves over 5M requests each day currently, which is powered by Cloudflare's edge worker, it's globally fast! (you can check the benchmark by @azu: https://github.com/azu/npmcdn-upptime).

Changes:

  • Use .mjs extension for the package main module to resolve sub-path conflicts
  • Ignore ?exports query when importing stable modules
  • Fix npm naming regexp (close #541)
  • Fix tree shaking (close #521)
  • Fix package nested conditions export (#546 by @Justinidlerz)
  • Fix esm imports in cjs (close #557)
  • Improve server performance (#543 by @Justinidlerz)
  • Update the requireModeAllowList (close #540, #548)

For Deno:

  • Inject XHR polyfill for axios, cross-fetch, whatwg-fetch automatically
  • Fix node:buffer import for denonext target (closed #556)
  • CLI: Use user-specified indent size (#551 by @npg418)

Credits

Huge thanks to @Justinidlerz @npg418

v111

06 Mar 04:43
@ije ije
Compare
Choose a tag to compare
  • Print package deprecated message
    Screenshot 2023-03-06 at 12 29 31
  • Remove source map URL of worker
  • Fix package CSS redirects with target option
  • Fix build dead-loop for some edge cases
  • Fix CLI update command (close #536)

CDN Update

Before when you import a module without specifying the package version like "https://esm.sh/react", it will redirect to latest version like "https://esm.sh/[email protected]", that means it needs to ask the NPM registry what the latest version of the package every time, in v111 we added a cache layer for the NPM registry to improve the redirect response time. Since we set the cache TTL to 10 minutes, so you may get the delay of the package latest update, but for a CDN the response time is the most important care-thing, the best practice is always point out the full version of packages like "https://esm.sh/[email protected]".

v110

01 Mar 23:35
@ije ije
Compare
Choose a tag to compare
  • Fix invalid Content-Type header for dts files (close #534)

v109

01 Mar 04:43
@ije ije
Compare
Choose a tag to compare
  • Ignore ?external option for stable builds
  • Fix react/jsx-runtime bundles react module
  • Remove alias export resolving (close #530)

v108

26 Feb 02:25
@ije ije
Compare
Choose a tag to compare
  • Add denonext target to use deno 1.31 node compatibility layer, we will switch to the denonext target as default for deno once deno deploy supports node: specifier.
    import "https://esm.sh/your-package?target=denonext"
  • Redirect to CSS file for CSS packages
    https://esm.sh/normalize.css -> https://esm.sh/normalize.css/normalize.css
    
  • Fix wasm packages can't resolve the default wasm file.
    import init, { transform } from "https://esm.sh/lightningcss-wasm";
    // v107: you need to specify the wasm URL
    await init("https://esm.sh/lightningcss-wasm/lightningcss_node.wasm")
    // v108: you don't need to specify it
    await init()
  • Disable bundle mode for stable builds
  • Fix alias export (close #527)
  • Update references to reqOrigin to use cdnOrigin (#529 by @jaredcwhite)

Credits

Huge thanks to @jaredcwhite

v107

21 Feb 18:27
@ije ije
Compare
Choose a tag to compare
  • Add ?cjs-export query (close #512)

    If you get an error like ...not provide an export named..., that means esm.sh can not resolve CJS exports of the module correctly. You can add ?cjs-exports=foo,bar query to specify the export names:
    import { NinetyRing, NinetyRingWithBg } from "https://esm.sh/[email protected]?cjs-exports=NinetyRing,NinetyRingWithBg"
  • Update requireModeAllowList (close #520)
  • Remove ?sourcemap query, always generate source map as inline url.
  • Default export all members from original module to prevent missing named exports members (#522)
  • Only apply patch if types are missing in preact (#523)
  • Upgrade esbuild to 0.17.10.
  • Upgrade deno/std to 0.177.0

Credits

Huge thanks to @Justinidlerz @zookatron

v106

28 Jan 17:53
@ije ije
Compare
Choose a tag to compare
  • Just fix fake module export names resolving broken in v105 (close #510)