Skip to content

core 0.0.5

Install from the command line:
Learn more about npm packages
$ npm install @edgefirst-dev/core@0.0.5
Install via package.json:
"@edgefirst-dev/core": "0.0.5"

About this version

@edgefirst-dev/core

The core of the Edge-first Stack.

Installation

bun add @edgefirst-dev/core

Usage

In your vite.config.ts import getLoadContext from @edgefirst-dev/core/vite and pass it to Remix's Cloudflare plugin.

import {
  vitePlugin as remix,
  cloudflareDevProxyVitePlugin as cloudflare,
} from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

import { getLoadContext } from "@edgefirst-dev/core/vite";

export default defineConfig({
  plugins: [
    cloudflare({ getLoadContext }),

    remix({
      future: {
        v3_fetcherPersist: true,
        v3_relativeSplatPath: true,
        v3_throwAbortReason: true,
      },
    }),

    tsconfigPaths(),
  ],
});

Now you can import Edge namespace from @edgefirst-dev/core and use it in any part of your Remix app.

import { Edge } from "@edgefirst-dev/core";

let { items, meta } = await Edge.kv().keys();
let { data, meta } = await Edge.kv().get("prefix:key");
await Edge.kv().set(
  "prefix:key",
  { date: new Date() },
  { ttl: 3600, metadata: { key: "value" } }
);

Details


Assets

  • core-0.0.5.tgz

Download activity

  • Total downloads 1
  • Last 30 days 0
  • Last week 0
  • Today 0