@shopify/mini-oxygen@3.0.0
版本发布时间: 2024-04-12 02:47:49
Shopify/hydrogen最新发布版本:skeleton@1.0.8(2024-04-24 03:37:09)
Major Changes
-
The default runtime exported from
@shopify/mini-oxygen
is now based on workerd. (#1891) by @frandioxThe previous Node.js sandbox runtime has been moved to the
@shopify/mini-oxygen/node
export.Example usage:
import {createMiniOxygen} from '@shopify/mini-oxygen'; const miniOxygen = createMiniOxygen({ workers: [ { name: 'main', modules: true, script: `export default { async fetch() { const response = await fetch("https://hydrogen.shopify.dev"); return response; } }`, }, ], }); const response = await miniOxygen.dispatchFetch('http://placeholder'); console.log(await response.text()); await miniOxygen.dispose();