Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@astrojs/[email protected]
Major Changes
#5056
e55af8a23
Thanks @matthewp! - # Standalone mode for the Node.js adapterNew in
@astrojs/node
is support for standalone mode. With standalone mode you can start your production server without needing to write any server JavaScript yourself. The server starts simply by running the script like so:To enable standalone mode, set the new
mode
to'standalone'
option in your Astro config:See the @astrojs/node documentation to learn all of the options available in standalone mode.
Breaking change
This is a semver major change because the new
mode
option is required. Existing @astrojs/node users who are using their own HTTP server framework such as Express can upgrade by setting themode
option to'middleware'
in order to build to a middleware mode, which is the same behavior and API as before.Minor Changes
#5056
e55af8a23
Thanks @matthewp! - # Adapter support forastro preview
Adapters are now about to support the
astro preview
command via a new integration option. The Node.js adapter@astrojs/node
is the first of the built-in adapters to gain support for this. What this means is that if you are using@astrojs/node
you can new preview your SSR app by running:Adapter API
We will be updating the other first party Astro adapters to support preview over time. Adapters can opt-in to this feature by providing the
previewEntrypoint
via thesetAdapter
function inastro:config:done
hook. The Node.js adapter's code looks like this:export default function() { return { name: '@astrojs/node', hooks: { 'astro:config:done': ({ setAdapter, config }) => { setAdapter({ name: '@astrojs/node', serverEntrypoint: '@astrojs/node/server.js', + previewEntrypoint: '@astrojs/node/preview.js', exports: ['handler'], }); // more here } } }; }
The
previewEntrypoint
is a module in the adapter's package that is a Node.js script. This script is run whenastro preview
is run and is charged with starting up the built server. See the Node.js implementation in@astrojs/node
to see how that is implemented.#5056
e55af8a23
Thanks @matthewp! - # New build configurationThe ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server
(the server code for SSR),client
(your client-side JavaScript and assets), andserverEntry
(the name of the entrypoint server module). Here are the defaults:These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
Integration hook change
The integration hook
astro:build:start
includes a parambuildConfig
which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the newbuild.config
options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead:[email protected]
Minor Changes
#5056
e55af8a23
Thanks @matthewp! - # Adapter support forastro preview
Adapters are now about to support the
astro preview
command via a new integration option. The Node.js adapter@astrojs/node
is the first of the built-in adapters to gain support for this. What this means is that if you are using@astrojs/node
you can new preview your SSR app by running:Adapter API
We will be updating the other first party Astro adapters to support preview over time. Adapters can opt-in to this feature by providing the
previewEntrypoint
via thesetAdapter
function inastro:config:done
hook. The Node.js adapter's code looks like this:export default function() { return { name: '@astrojs/node', hooks: { 'astro:config:done': ({ setAdapter, config }) => { setAdapter({ name: '@astrojs/node', serverEntrypoint: '@astrojs/node/server.js', + previewEntrypoint: '@astrojs/node/preview.js', exports: ['handler'], }); // more here } } }; }
The
previewEntrypoint
is a module in the adapter's package that is a Node.js script. This script is run whenastro preview
is run and is charged with starting up the built server. See the Node.js implementation in@astrojs/node
to see how that is implemented.#4986
ebd364e39
Thanks @bluwy! - ## New properties for API routesIn API routes, you can now get the
site
,generator
,url
,clientAddress
,props
, andredirect
fields on the APIContext, which is the first parameter passed to an API route. This was done to make the APIContext more closely align with theAstro
global in .astro pages.For example, here's how you might use the
clientAddress
, which is the user's IP address, to selectively allow users.Check out the docs for more information on the newly available fields: https://docs.astro.build/en/core-concepts/endpoints/#server-endpoints-api-routes
#4959
0ea6187f9
Thanks @Princesseuh! - Added support for updating TypeScript settings automatically when usingastro add
The
astro add
command will now automatically update yourtsconfig.json
with the proper TypeScript settings needed for the chosen frameworks.For instance, typing
astro add solid
will update yourtsconfig.json
with the following settings, per Solid's TypeScript guide:#4947
a5e3ecc80
Thanks @JuanM04! - - AddedisRestart
andaddWatchFile
to integration stepisRestart
.#4986
ebd364e39
Thanks @bluwy! - ## Support passing a custom status code for Astro.redirectNew in this minor is the ability to pass a status code to
Astro.redirect
. By default it uses302
but now you can pass another code as the second argument:#5056
e55af8a23
Thanks @matthewp! - # New build configurationThe ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server
(the server code for SSR),client
(your client-side JavaScript and assets), andserverEntry
(the name of the entrypoint server module). Here are the defaults:These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
Integration hook change
The integration hook
astro:build:start
includes a parambuildConfig
which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the newbuild.config
options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead:Patch Changes
#5057
baf88ee9e
Thanks @bluwy! - Skip JSX tagging for export statements with source#5044
44ea0c6d9
Thanks @JuanM04! - Upgrade Astro compiler to 0.27.1#5059
f7fcdfe62
Thanks @bluwy! - Support strict dependency install for libraries with JSX#5047
1e2799243
Thanks @matthewp! - Update Astro.cookies.set types to allow booleans and numbersNote that booleans and numbers were already allowed, they just were not allowed by the type definitions.
@astrojs/[email protected]
Minor Changes
#5056
e55af8a23
Thanks @matthewp! - # New build configurationThe ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server
(the server code for SSR),client
(your client-side JavaScript and assets), andserverEntry
(the name of the entrypoint server module). Here are the defaults:These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
Integration hook change
The integration hook
astro:build:start
includes a parambuildConfig
which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the newbuild.config
options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead:@astrojs/[email protected]
Minor Changes
#5056
e55af8a23
Thanks @matthewp! - # New build configurationThe ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server
(the server code for SSR),client
(your client-side JavaScript and assets), andserverEntry
(the name of the entrypoint server module). Here are the defaults:These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
Integration hook change
The integration hook
astro:build:start
includes a parambuildConfig
which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the newbuild.config
options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead:@astrojs/[email protected]
Minor Changes
#5056
e55af8a23
Thanks @matthewp! - # New build configurationThe ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server
(the server code for SSR),client
(your client-side JavaScript and assets), andserverEntry
(the name of the entrypoint server module). Here are the defaults:These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
Integration hook change
The integration hook
astro:build:start
includes a parambuildConfig
which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the newbuild.config
options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead:Patch Changes
#5073
93f72f90b
Thanks @bluwy! - Fix image external config in build#5072
3918787cb
Thanks @bluwy! - Support relative protocol image URL@astrojs/[email protected]
Minor Changes
#5056
e55af8a23
Thanks @matthewp! - # New build configurationThe ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server
(the server code for SSR),client
(your client-side JavaScript and assets), andserverEntry
(the name of the entrypoint server module). Here are the defaults:These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
Integration hook change
The integration hook
astro:build:start
includes a parambuildConfig
which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the newbuild.config
options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead:@astrojs/[email protected]
Minor Changes
f7fcdfe62
Thanks @bluwy! - Auto ssr.noExternal solidjs dependencies@astrojs/[email protected]
Minor Changes
#4947
a5e3ecc80
Thanks @JuanM04! - ## HMR on config file changesNew in this release is the ability for config changes to automatically reflect via HMR. Now when you edit your
tsconfig.json
ortailwind.config.js
configs, the changes will reload automatically without the need to restart your dev server.@astrojs/[email protected]
Minor Changes
#5056
e55af8a23
Thanks @matthewp! - # New build configurationThe ability to customize SSR build configuration more granularly is now available in Astro. You can now customize the output folder for
server
(the server code for SSR),client
(your client-side JavaScript and assets), andserverEntry
(the name of the entrypoint server module). Here are the defaults:These new configuration options are only supported in SSR mode and are ignored when building to SSG (a static site).
Integration hook change
The integration hook
astro:build:start
includes a parambuildConfig
which includes all of these same options. You can continue to use this param in Astro 1.x, but it is deprecated in favor of the newbuild.config
options. All of the built-in adapters have been updated to the new format. If you have an integration that depends on this param we suggest upgrading to do this instead:@astrojs/[email protected]
Patch Changes
0f2a88ba5
Thanks @matthewp! - Allow class to be passed into Svelte islands