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
Container APIs #916
base: main
Are you sure you want to change the base?
Container APIs #916
Conversation
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Considering the fact that this API doesn't involve any configuration or virtual module, the API | ||
will be released with a `experimental_` prefix, e.g. `experimental_AstroContainer`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a data point, currently Astro's programmatic APIs are experimental too but doesn't have the experimental_
prefix, so I'm biased that we don't need to prefix these and only add an @experimental
jsdoc tag. Curious to hear what others think about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this sync and we decided to keep the prefix.
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
} | ||
``` | ||
The `astroConfig` object is literally the same object exposed by the `defineConfig`, inside the `astro.config.mjs` file. This very configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you found use-case for passing the astroConfig yet? I'm worried about getting bug reports when people try to pass through vite
config and other non-supported stuff.
What do you think about instead raising the relevant config values up to the AstroContainerOptions
level. That would be stuff like trailingSlash
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about instead raising the relevant config values up to the AstroContainerOptions level. That would be stuff like trailingSlash.
I don't think that would work easily. These options, internally, are used to create a manifest. If we pass these options when rendering a component, it would mean generating a new manifest every time we attempt to render a component, and then discard that manifest. We have to be careful not to override the existing manifest, because the manifest is tight to the lifetime of the instance of the container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not when rendering, AstroContainerOptions
is the name of the options passed to AstroContainer.create()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I misunderstood what you meant. Yeah we should be able to provide the individual options.
Summary
An API for rendering components in isolation:
Links