Split up + generate client & server bundles, support framework +router in GenerateNodeModulesBundle , read framework from package.json + rename "publicURL" to "origin" + add import.meta.filepath

Former-commit-id: 1e76ebb5375247231181ec19a6396c6acf4684fb
This commit is contained in:
Jarred Sumner
2021-08-09 02:21:31 -07:00
parent 687b22908f
commit f74771144e
35 changed files with 2845 additions and 2000 deletions

View File

@@ -290,16 +290,26 @@ JSC::JSObject *GlobalObject::moduleLoaderCreateImportMetaProperties(JSGlobalObje
JSValue key,
JSModuleRecord *record,
JSValue val) {
return nullptr;
// auto res = Zig__GlobalObject__createImportMetaProperties(
// globalObject,
// loader,
// JSValue::encode(key),
// record,
// JSValue::encode(val)
// );
// return JSValue::decode(res).getObject();
ZigString specifier = Zig::toZigString(key, globalObject);
JSC::VM &vm = globalObject->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
JSC::JSObject *metaProperties =
JSC::constructEmptyObject(vm, globalObject->nullPrototypeObjectStructure());
RETURN_IF_EXCEPTION(scope, nullptr);
metaProperties->putDirect(vm, Identifier::fromString(vm, "filePath"), key);
RETURN_IF_EXCEPTION(scope, nullptr);
// metaProperties->putDirect(vm, Identifier::fromString(vm, "resolve"),
// globalObject->globalThis()
// ->get(vm, Identifier::fromString("Wundle"))
// .getObject()
// ->get(vm, Identifier::fromString("resolve"))); );
// RETURN_IF_EXCEPTION(scope, nullptr);
return metaProperties;
}
JSC::JSValue GlobalObject::moduleLoaderEvaluate(JSGlobalObject *globalObject,