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

fix: disable optmized registry ids #137

Merged
merged 1 commit into from
Jun 1, 2024
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
5 changes: 5 additions & 0 deletions .changeset/wet-sheep-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marko/vite": patch
---

Disable registry id optimization while it (hopefully) stabalizes in Marko core.
28 changes: 14 additions & 14 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ interface BrowserManifest {
}

interface ServerManifest {
optimizedRegistryIds?: { [id: string]: string };
// optimizedRegistryIds?: { [id: string]: string };
entries: {
[entryId: string]: string;
};
Expand Down Expand Up @@ -102,7 +102,7 @@ const babelCaller = {
supportsTopLevelAwait: true,
supportsExportNamespaceFrom: true,
};
const optimizedRegistryIds: Map<string, string> = new Map();
// const optimizedRegistryIds: Map<string, string> = new Map();
let registeredTagLib = false;

export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
Expand Down Expand Up @@ -184,8 +184,8 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
baseConfig = {
cache,
optimize,
optimizedRegistryIds:
optimize && linked ? optimizedRegistryIds : undefined,
// optimizedRegistryIds:
// optimize && linked ? optimizedRegistryIds : undefined,
runtimeId,
sourceMaps: true,
writeVersionComment: false,
Expand Down Expand Up @@ -456,14 +456,14 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
if (isBuild && linked && !isSSRBuild) {
try {
serverManifest = await store.read();
if (serverManifest.optimizedRegistryIds) {
for (const id in serverManifest.optimizedRegistryIds) {
optimizedRegistryIds.set(
id,
serverManifest.optimizedRegistryIds[id],
);
}
}
// if (serverManifest.optimizedRegistryIds) {
// for (const id in serverManifest.optimizedRegistryIds) {
// optimizedRegistryIds.set(
// id,
// serverManifest.optimizedRegistryIds[id],
// );
// }
// }

inputOptions.input = toHTMLEntries(root, serverManifest.entries);
for (const entry in serverManifest.entrySources) {
Expand Down Expand Up @@ -780,8 +780,8 @@ export default function markoPlugin(opts: Options = {}): vite.Plugin[] {
}
}

serverManifest.optimizedRegistryIds =
Object.fromEntries(optimizedRegistryIds);
// serverManifest.optimizedRegistryIds =
// Object.fromEntries(optimizedRegistryIds);
store.write(serverManifest!);
} else {
const browserManifest: BrowserManifest = {};
Expand Down
Loading