-
Notifications
You must be signed in to change notification settings - Fork 3
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
Migrating to @inox-tools/inline-mod
#32
Comments
Here's a direct link to the inline-mod package. This definitely sounds aligned with the goals of ATP. I don't have enough experience with Vite to contribute meaningfully at the moment. |
I talked to Luiz about this, he mentioned looking into using a factory wrapper. Anything that can't be serialized by |
Hello, I trid to implemented it, but it made a break change in export const configSchema = z.object({
title: z.string(),
...
});
export default defineTheme({
name: "theme-playground",
schema: configSchema,
... then, i trid to aviod, (globalThis as any)[themeName].config = userConfig;
const virtualImports: Parameters<typeof createVirtualResolver>[0]["imports"] = {
[`${themeName}:config`]: `export default globalThis["${themeName}"].config;`,
...
}; Are there any negative consequences of using globalThis? |
This is awesome! I am not sure if there are any negatives to using this pattern. This is definitely something we should explore! |
…astrolicious#32) - add function example usage in playground config
Currently, theme configurations have to be JSON serializable, migrating to
@inox-tools/inline-mod
could allow for more complicated theme configurations that include functions and more.@inox-tools/inline-mod
could also greatly improve the internals for creating virtual modules that provide theme assets. This would require a major rework of the current implementation, but it could also provide a large improvement to the experience for theme authors and users.Things to consider:
@inox-tools/inline-mod
can't guarantee that the code that it generates doesn't have edge cases. How safe is this to use? Are any of the known edge cases not worth the compromise?The text was updated successfully, but these errors were encountered: