Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEVLIB-1233: Rename Compute@Edge to Compute #14

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[![Deploy to Fastly](https://deploy.edgecompute.app/button)](https://deploy.edgecompute.app/deploy)

Get to know the Fastly Compute@Edge environment with a basic starter that demonstrates routing, simple synthetic responses and code comments that cover common patterns.
Get to know the Fastly Compute environment with a basic starter that demonstrates routing, simple synthetic responses and code comments that cover common patterns.

**For more details about other starter kits for Compute@Edge, see the [Fastly developer hub](https://developer.fastly.com/solutions/starters)**
**For more details about other starter kits for Compute, see the [Fastly developer hub](https://developer.fastly.com/solutions/starters)**

## Features
* Allow only requests with particular HTTP methods
Expand All @@ -13,11 +13,11 @@ Get to know the Fastly Compute@Edge environment with a basic starter that demons

## Understanding the code

This starter is intentionally lightweight, and requires no dependencies aside from the [`@fastly/js-compute`](https://www.npmjs.com/package/@fastly/js-compute) npm package. It will help you understand the basics of processing requests at the edge using Fastly. This starter includes implementations of common patterns explained in our [using Compute@Edge](https://developer.fastly.com/learning/compute/javascript/) and [VCL migration](https://developer.fastly.com/learning/compute/migrate/) guides.
This starter is intentionally lightweight, and requires no dependencies aside from the [`@fastly/js-compute`](https://www.npmjs.com/package/@fastly/js-compute) npm package. It will help you understand the basics of processing requests at the edge using Fastly. This starter includes implementations of common patterns explained in our [using Compute](https://developer.fastly.com/learning/compute/javascript/) and [VCL migration](https://developer.fastly.com/learning/compute/migrate/) guides.

The starter doesn't require the use of any backends. Once deployed, you will have a Fastly service running on Compute@Edge that can generate synthetic responses at the edge.
The starter doesn't require the use of any backends. Once deployed, you will have a Fastly service running on Compute that can generate synthetic responses at the edge.

The template uses TypeScript to compile source files in `./src` into JS files in `./build`, which are then wrapped into `./bin/index.wasm` using the `js-compute-runtime` CLI tool bundled with the `@fastly/js-compute` npm package, and bundled into a `.tar.gz` file ready for deployment to Compute@Edge.
The template uses TypeScript to compile source files in `./src` into JS files in `./build`, which are then wrapped into `./bin/index.wasm` using the `js-compute-runtime` CLI tool bundled with the `@fastly/js-compute` npm package, and bundled into a `.tar.gz` file ready for deployment to Compute.

## Security issues

Expand Down
2 changes: 1 addition & 1 deletion fastly.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file describes a Fastly Compute@Edge package. To learn more visit:
# This file describes a Fastly Compute package. To learn more visit:
# https://developer.fastly.com/reference/fastly-toml/

authors = ["<[email protected]>"]
Expand Down
33 changes: 15 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"node": "^16 || >=18"
},
"devDependencies": {
"typescript": "^5.0.2"
"typescript": "^5.2.2"
},
"dependencies": {
"@fastly/js-compute": "^3.4.0"
"@fastly/js-compute": "^3.7.0"
},
"scripts": {
"prebuild": "tsc",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Default Compute@Edge template program.
//! Default Compute template program.

/// <reference types="@fastly/js-compute" />
// import { CacheOverride } from "fastly:cache-override";
Expand All @@ -8,7 +8,7 @@ import { includeBytes } from "fastly:experimental";

// Load a static file as a Uint8Array at compile time.
// File path is relative to root of project, not to this file
const welcomePage = includeBytes("./src/welcome-to-compute@edge.html");
const welcomePage = includeBytes("./src/welcome-to-compute.html");

// The entry point for your application.
//
Expand Down Expand Up @@ -37,14 +37,14 @@ async function handleRequest(event: FetchEvent) {

// If request is to the `/` path...
if (url.pathname == "/") {
// Below are some common patterns for Compute@Edge services using JavaScript.
// Below are some common patterns for Fastly Compute services using JavaScript.
// Head to https://developer.fastly.com/learning/compute/javascript/ to discover more.

// Create a new request.
// let bereq = new Request("http://example.com");

// Add request headers.
// req.headers.set("X-Custom-Header", "Welcome to Compute@Edge!");
// req.headers.set("X-Custom-Header", "Welcome to Fastly Compute!");
// req.headers.set(
// "X-Another-Custom-Header",
// "Recommended reading: https://developer.fastly.com/learning/compute"
Expand Down
2 changes: 1 addition & 1 deletion src/[email protected] → src/welcome-to-compute.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<title>Welcome to Compute@Edge</title>
<title>Welcome to Fastly Compute</title>
<link
rel="icon"
href="https://developer.fastly.com/favicon-32x32.png"
Expand Down