Skip to content

Commit 032277b

Browse files
Jake ChampionJakeChampion
authored andcommitted
chore: use fastly as the identifier
1 parent a252bb7 commit 032277b

32 files changed

+674
-684
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ jobs:
342342
name: engine-release
343343
- name: Locate component resources
344344
run: |
345-
cp c-dependencies/js-compute-runtime/c-at-e.wit .
345+
cp c-dependencies/js-compute-runtime/fastly.wit .
346346
- run: yarn
347347
shell: bash
348348
- run: npm test

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ node_modules/
1515
/js-compute-runtime-component.wasm
1616
/c-dependencies/js-compute-runtime/obj
1717
tests/wpt-harness/wpt-test-runner.js
18-
/c-at-e.wit
18+
/fastly.wit
1919
wpt-runtime.wasm
2020
docs-app/bin/main.wasm
2121
docs-app/pkg/*.tar.gz
22-
c-dependencies/js-compute-runtime/c-at-e-world/c_at_e_world_component_type.o
22+
c-dependencies/js-compute-runtime/fastly-world/fastly_world_component_type.o
2323

2424
*.a

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cstddef": "c",
55
"limits": "c",
66
"type_traits": "c",
7-
"c-at-e.h": "c",
7+
"fastly.h": "c",
88
"algorithm": "cpp",
99
"memory": "cpp",
1010
"__functional_base": "cpp",
@@ -89,7 +89,7 @@
8989
"__functional_base_03": "cpp",
9090
"memory_resource": "cpp",
9191
"numeric": "cpp",
92-
"c_at_e_world.h": "c"
92+
"fastly_world.h": "c"
9393
},
9494
"git.ignoreLimitWarning": true
9595
}

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ npm run build
6565

6666
The JS Compute Runtime has automated tests which run on all pull-requests. The test applications are located within <./integration-tests/js-compute>.
6767

68-
To run an end-to-end test which builds and deploys an application to c-at-e:
68+
To run an end-to-end test which builds and deploys an application to fastly:
6969
- Build the runtime and cli: `npm run build` in the root of the project
7070
- Change to the test directory for the runtime: `cd integration-tests/js-compute/`
7171
- Install the test dependencies: `npm install`

c-dependencies/js-compute-runtime/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ $(BUILD):
151151
$(OBJ_DIR):
152152
$(call cmd,mkdir,$@)
153153

154-
$(OBJ_DIR)/c-at-e-world:
154+
$(OBJ_DIR)/fastly-world:
155155
$(call cmd,mkdir,$@)
156156

157157
$(OBJ_DIR)/impl:
@@ -256,7 +256,7 @@ regenerate-world:
256256
@exit 1
257257
else
258258
regenerate-world:
259-
$(WIT_BINDGEN) c c-at-e.wit --no-helpers --out-dir c-at-e-world
259+
$(WIT_BINDGEN) c fastly.wit --no-helpers --out-dir fastly-world
260260
endif
261261

262262

@@ -274,7 +274,7 @@ $(foreach source,$(FSM_CPP),$(eval $(call compile_cxx,$(source))))
274274

275275
# Compute runtime build ########################################################
276276

277-
$(eval $(call compile_cxx,$(FSM_SRC)/c-at-e-world/c_at_e_world_adapter.cpp))
277+
$(eval $(call compile_cxx,$(FSM_SRC)/fastly-world/fastly_world_adapter.cpp))
278278

279279
# This version of the runtime uses the world adapter in place of the world
280280
# generated by wit-bindgen, adapting to the currently available host calls on
@@ -285,7 +285,7 @@ $(eval $(call compile_cxx,$(FSM_SRC)/c-at-e-world/c_at_e_world_adapter.cpp))
285285
# that script for more information about why we do this.
286286
$(OBJ_DIR)/js-compute-runtime.wasm: $(FSM_OBJ) $(SM_OBJ) $(RUST_URL_LIB)
287287
$(OBJ_DIR)/js-compute-runtime.wasm: $(OBJ_DIR)/impl/main.o
288-
$(OBJ_DIR)/js-compute-runtime.wasm: $(OBJ_DIR)/c-at-e-world/c_at_e_world_adapter.o
288+
$(OBJ_DIR)/js-compute-runtime.wasm: $(OBJ_DIR)/fastly-world/fastly_world_adapter.o
289289
$(call cmd_format,WASI_LD,$@) PATH="$(FSM_SRC)/scripts:$$PATH" \
290290
$(WASI_CXX) $(LD_FLAGS) $(OPENSSL_LIBS) -o $@ $^
291291
$(call cmd_format,WASM_STRIP,$@) $(call WASM_STRIP,$@)
@@ -295,7 +295,7 @@ $(eval $(call compile_cxx,$(FSM_SRC)/impl/main.cpp))
295295

296296
# Compute runtime component build ##############################################
297297

298-
$(eval $(call compile_c,$(FSM_SRC)/c-at-e-world/c_at_e_world.c))
298+
$(eval $(call compile_c,$(FSM_SRC)/fastly-world/fastly_world.c))
299299

300300
# This version of the runtime uses the code generated by wit-bindgen, to
301301
# ultimately be run as a component on c@e.
@@ -305,7 +305,7 @@ $(eval $(call compile_c,$(FSM_SRC)/c-at-e-world/c_at_e_world.c))
305305
# that script for more information about why we do this.
306306
$(OBJ_DIR)/js-compute-runtime-component.wasm: $(FSM_OBJ) $(SM_OBJ) $(RUST_URL_LIB)
307307
$(OBJ_DIR)/js-compute-runtime-component.wasm: $(OBJ_DIR)/impl/main_component.o
308-
$(OBJ_DIR)/js-compute-runtime-component.wasm: $(OBJ_DIR)/c-at-e-world/c_at_e_world.o
308+
$(OBJ_DIR)/js-compute-runtime-component.wasm: $(OBJ_DIR)/fastly-world/fastly_world.o
309309
$(call cmd_format,WASI_LD,$@) PATH="$(FSM_SRC)/scripts:$$PATH" \
310310
$(WASI_CXX) $(LD_FLAGS) $(OPENSSL_LIBS) -o $@ $^
311311
$(call cmd_format,WASM_STRIP,$@) $(call WASM_STRIP,$@)

c-dependencies/js-compute-runtime/builtins/backend.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -712,12 +712,12 @@ bool Backend::isCipherSuiteSupportedByFastly(std::string_view cipherSpec) {
712712
JS::Result<mozilla::Ok> Backend::register_dynamic_backend(JSContext *cx, JS::HandleObject backend) {
713713
MOZ_ASSERT(is_instance(backend));
714714

715-
c_at_e_world_string_t name_str;
715+
fastly_world_string_t name_str;
716716
JS::RootedString name(cx, JS::GetReservedSlot(backend, Backend::Slots::Name).toString());
717717
JS::UniqueChars nameChars = encode(cx, name, &name_str.len);
718718
name_str.ptr = nameChars.get();
719719

720-
c_at_e_world_string_t target_str;
720+
fastly_world_string_t target_str;
721721
JS::RootedString target(cx, JS::GetReservedSlot(backend, Backend::Slots::Target).toString());
722722
JS::UniqueChars targetChars = encode(cx, target, &target_str.len);
723723
target_str.ptr = targetChars.get();
@@ -1120,13 +1120,13 @@ bool Backend::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
11201120
}
11211121

11221122
if (version == 1.3) {
1123-
tlsMinVersion = TLS::VERSION_1_3;
1123+
tlsMinVersion = fastly::TLS::VERSION_1_3;
11241124
} else if (version == 1.2) {
1125-
tlsMinVersion = TLS::VERSION_1_2;
1125+
tlsMinVersion = fastly::TLS::VERSION_1_2;
11261126
} else if (version == 1.1) {
1127-
tlsMinVersion = TLS::VERSION_1_1;
1127+
tlsMinVersion = fastly::TLS::VERSION_1_1;
11281128
} else if (version == 1) {
1129-
tlsMinVersion = TLS::VERSION_1;
1129+
tlsMinVersion = fastly::TLS::VERSION_1;
11301130
} else {
11311131
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BACKEND_TLS_MIN_INVALID);
11321132
return false;
@@ -1156,13 +1156,13 @@ bool Backend::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
11561156
}
11571157

11581158
if (version == 1.3) {
1159-
tlsMaxVersion = TLS::VERSION_1_3;
1159+
tlsMaxVersion = fastly::TLS::VERSION_1_3;
11601160
} else if (version == 1.2) {
1161-
tlsMaxVersion = TLS::VERSION_1_2;
1161+
tlsMaxVersion = fastly::TLS::VERSION_1_2;
11621162
} else if (version == 1.1) {
1163-
tlsMaxVersion = TLS::VERSION_1_1;
1163+
tlsMaxVersion = fastly::TLS::VERSION_1_1;
11641164
} else if (version == 1) {
1165-
tlsMaxVersion = TLS::VERSION_1;
1165+
tlsMaxVersion = fastly::TLS::VERSION_1;
11661166
} else {
11671167
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BACKEND_TLS_MAX_INVALID);
11681168
return false;

c-dependencies/js-compute-runtime/builtins/cache-override.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CacheOverride : public BuiltinImpl<CacheOverride> {
1313
static const int ctor_length = 1;
1414

1515
// The values stored in these slots are ultimately passed to the host
16-
// via the c_at_e_req_cache_override_v2_set hostcall.
16+
// via the fastly_req_cache_override_v2_set hostcall.
1717
//
1818
// If `Mode` is not `Override`, all other values are ignored.
1919
//

c-dependencies/js-compute-runtime/builtins/config-store.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fastly_dictionary_handle_t ConfigStore::config_store_handle(JSObject *obj) {
1111
bool ConfigStore::get(JSContext *cx, unsigned argc, JS::Value *vp) {
1212
METHOD_HEADER(1)
1313

14-
c_at_e_world_string_t key_str;
14+
fastly_world_string_t key_str;
1515
JS::UniqueChars key = encode(cx, args[0], &key_str.len);
1616
// If the converted string has a length of 0 then we throw an Error
1717
// because Dictionary keys have to be at-least 1 character.
@@ -58,7 +58,7 @@ bool ConfigStore::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
5858
REQUEST_HANDLER_ONLY("The ConfigStore builtin");
5959
CTOR_HEADER("ConfigStore", 1);
6060

61-
c_at_e_world_string_t name_str;
61+
fastly_world_string_t name_str;
6262
JS::UniqueChars name_chars = encode(cx, args[0], &name_str.len);
6363
name_str.ptr = name_chars.get();
6464

c-dependencies/js-compute-runtime/builtins/crypto.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#pragma clang diagnostic pop
77

88
#include "crypto.h"
9-
#include "host_interface/c-at-e.h"
9+
#include "host_interface/fastly.h"
1010
#include "subtle-crypto.h"
1111

1212
bool is_int_typed_array(JSObject *obj) {
@@ -45,7 +45,7 @@ bool Crypto::get_random_values(JSContext *cx, unsigned argc, JS::Value *vp) {
4545
JS::AutoCheckCannotGC noGC(cx);
4646
bool is_shared;
4747
void *buffer = JS_GetArrayBufferViewData(typed_array, &is_shared, noGC);
48-
random_get((int32_t)buffer, byte_length);
48+
fastly::random_get((int32_t)buffer, byte_length);
4949

5050
args.rval().setObject(*typed_array);
5151
return true;
@@ -129,7 +129,7 @@ struct UUID {
129129
bool Crypto::random_uuid(JSContext *cx, unsigned argc, JS::Value *vp) {
130130
METHOD_HEADER(0)
131131
UUID id;
132-
random_get(reinterpret_cast<int32_t>(&id), sizeof(id));
132+
fastly::random_get(reinterpret_cast<int32_t>(&id), sizeof(id));
133133

134134
// Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to zero and
135135
// one, respectively.

c-dependencies/js-compute-runtime/builtins/dictionary.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ bool Dictionary::get(JSContext *cx, unsigned argc, JS::Value *vp) {
1313

1414
JS::HandleValue name_arg = args.get(0);
1515

16-
c_at_e_world_string_t name_str;
16+
fastly_world_string_t name_str;
1717
// Convert into a String following https://tc39.es/ecma262/#sec-tostring
1818
JS::UniqueChars name = encode(cx, name_arg, &name_str.len);
1919
if (!name) {
@@ -66,7 +66,7 @@ bool Dictionary::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
6666

6767
JS::HandleValue name_arg = args.get(0);
6868

69-
c_at_e_world_string_t name_str;
69+
fastly_world_string_t name_str;
7070
// Convert into a String following https://tc39.es/ecma262/#sec-tostring
7171
JS::UniqueChars name = encode(cx, name_arg, &name_str.len);
7272
if (!name) {

0 commit comments

Comments
 (0)