Skip to content

Commit

Permalink
Revert "node compatibility typescript infrastructure (#258)" (#262)
Browse files Browse the repository at this point in the history
This reverts commit dee37c5.
  • Loading branch information
mikea authored Jan 11, 2023
1 parent dee37c5 commit e064a8b
Show file tree
Hide file tree
Showing 11 changed files with 2 additions and 236 deletions.
103 changes: 0 additions & 103 deletions build/wd_api_bundle.bzl

This file was deleted.

35 changes: 0 additions & 35 deletions src/node/BUILD.bazel

This file was deleted.

1 change: 0 additions & 1 deletion src/node/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions src/node/buffer.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/node/internal/bufferImpl.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/node/tsconfig.json

This file was deleted.

11 changes: 2 additions & 9 deletions src/workerd/jsg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ wd_cc_library(
),
visibility = ["//visibility:public"],
deps = [
":modules_capnp",
"//src/workerd/util",
"@capnp-cpp//src/kj",
"@workerd-v8//:v8",
"//src/workerd/util",
],
)

Expand All @@ -38,10 +37,10 @@ js_capnp_library(
npm_package(
name = "jsg_js",
srcs = [":rtti_capnp_js"],
visibility = ["//visibility:public"],
# Required to ensure source files are copied when running internal builds
# that depend on `workerd` as an external repository
include_external_repositories = ["workerd"],
visibility = ["//visibility:public"],
)

wd_cc_library(
Expand All @@ -56,12 +55,6 @@ wd_cc_library(
],
)

wd_cc_capnp_library(
name = "modules_capnp",
srcs = ["modules.capnp"],
visibility = ["//visibility:public"],
)

[kj_test(
src = f,
deps = [
Expand Down
21 changes: 0 additions & 21 deletions src/workerd/jsg/modules.capnp

This file was deleted.

9 changes: 0 additions & 9 deletions src/workerd/jsg/modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "jsg.h"
#include <kj/filesystem.h>
#include <kj/map.h>
#include <workerd/jsg/modules.capnp.h>

namespace workerd::jsg {

Expand Down Expand Up @@ -239,14 +238,6 @@ class ModuleRegistryImpl final: public ModuleRegistry {
entries.insert(Entry(specifier, Type::BUNDLE, kj::fwd<ModuleInfo>(info)));
}

void addBuiltinBundle(Bundle::Reader bundle) {
for (auto module: bundle.getModules()) {
// TODO: asChars() might be wrong for wide characters
addBuiltinModule(module.getName(), module.getSrc().asChars(),
module.getInternal() ? Type::INTERNAL : Type::BUILTIN);
}
}

void addBuiltinModule(kj::StringPtr specifier,
kj::ArrayPtr<const char> sourceCode,
Type type = Type::BUILTIN) {
Expand Down
1 change: 0 additions & 1 deletion src/workerd/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ wd_cc_library(
deps = [
":workerd_capnp",
"@capnp-cpp//src/capnp:capnpc",
"//src/node:bundle",
"//src/workerd/io",
"//src/workerd/jsg",
],
Expand Down
7 changes: 0 additions & 7 deletions src/workerd/server/workerd-api.c++
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
#include <openssl/hmac.h>
#include <openssl/rand.h>

#include <node/bundle.capnp.h>

namespace workerd::server {

JSG_DECLARE_ISOLATE_TYPE(JsgWorkerdIsolate,
Expand Down Expand Up @@ -234,7 +232,6 @@ kj::Own<jsg::ModuleRegistry> WorkerdApiIsolate::compileModules(
Worker::ValidationErrorReporter& errorReporter) const {
auto& lock = kj::downcast<JsgWorkerdIsolate::Lock>(lockParam);
v8::HandleScope scope(lock.v8Isolate);
auto& featureFlags = *impl->features;

auto modules = kj::heap<jsg::ModuleRegistryImpl<JsgWorkerdIsolate_TypeWrapper>>();

Expand Down Expand Up @@ -315,10 +312,6 @@ kj::Own<jsg::ModuleRegistry> WorkerdApiIsolate::compileModules(
}
}

if (featureFlags.getNodeJsCompat()) {
modules->addBuiltinBundle(NODE_BUNDLE);
}

jsg::setModulesForResolveCallback<JsgWorkerdIsolate_TypeWrapper>(lock, modules);

return modules;
Expand Down

0 comments on commit e064a8b

Please sign in to comment.