Skip to content

Commit

Permalink
fix: fix importfn and remove ts snip
Browse files Browse the repository at this point in the history
  • Loading branch information
Percslol committed Jan 11, 2025
1 parent f71e9c1 commit 6b43c90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion rewriter/wasm/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ cd ../../
wasm-snip rewriter/wasm/out/wasm_bg.wasm -o rewriter/wasm/out/wasm_snipped.wasm \
-p 'oxc_regular_expression::.*' \
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_non_array_type' \
'oxc_parser::ts::statement::<impl oxc_parser::ParserImpl>::parse_declaration' \
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_ts_import_type' \
'oxc_parser::ts::types::<impl oxc_parser::ParserImpl>::parse_type_operator_or_higher' \
'oxc_parser::ts::statement::<impl oxc_parser::ParserImpl>::parse_ts_interface_declaration' \
Expand Down
10 changes: 3 additions & 7 deletions src/client/shared/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ import { rewriteUrl } from "../../shared/rewriters/url";
export default function (client: ScramjetClient, self: Self) {
const Function = client.natives.store["Function"];

self[config.globals.importfn] = function (base: string) {
return function (url: string) {
const resolved = new URL(url, base).href;
self[config.globals.importfn] = function (base: string, url: string) {
const resolved = new URL(url, base).href;

return Function(
`return import("${rewriteUrl(resolved, client.meta)}")`
)();
};
return Function(`return import("${rewriteUrl(resolved, client.meta)}")`)();
};

self[config.globals.metafn] = function (base: string) {
Expand Down

0 comments on commit 6b43c90

Please sign in to comment.