You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<ReadMore>Learn more about [available session drivers](/en/reference/session-driver-reference/#building-a-session-driver).</ReadMore>
376
377
378
+
### Deprecated: `createExports()` and `start()` (Adapter API)
379
+
380
+
<SourcePRnumber="15461"title="feat: improve naming of new adapter api" />
381
+
382
+
In Astro 5.x, adapters had to provide the exports required by the host in their server entrypoint using a `createExports()` function before passing them to `setAdapter()` as an `exports` list.
383
+
384
+
Astro 6.0 introduces a simpler yet more powerful way of making server entrypoints. This relies on passing a new option `entrypointResolution: "auto"` to `setAdapter()`.
385
+
386
+
However, for backwards compatibility with existing adapters, the default value of `entrypointResolution` (`"explicit"`) mimics Astro 5.x API behavior. This means that your adapters can to continue to function until you can fully migrate your adapter to the `auto` value, as shown below.
387
+
388
+
Note that `entrypointResolution: "explicit"` (maintaining v5 API behavior) is considered deprecated usage, but the option has been provided so that no immediate change to your adapter is required and to allow adapter authors time to update. This option will be removed in a future major version in favor of all adapters using `entrypointResolution: "auto"`.
389
+
390
+
#### What should I do?
391
+
392
+
If you are an adapter author with a public repository and [include the `astro-adapter` keyword in your `package.json`](/en/reference/publish-to-npm/#categories), the Astro core team will attempt to make a PR to your repository directly to help you migrate your code if you have not yet followed the steps below.
393
+
394
+
If you are seeing warnings because you are using a community adapter that is not yet updated, please reach out to the adapter author directly to let them know. It is ultimately their responsibility to update their adapters. You can also let the Astro core team know in the [`#integrations` channel of our Discord](https://astro.build/chat) and we will attempt to help the adapter author upgrade.
395
+
396
+
If you have built an adapter, follow these steps to remove the legacy v5 behaviour:
397
+
398
+
<Steps>
399
+
400
+
1. Update your `setAdapter()`: set `entrypointResolution: "auto"`, remove `exports` and `args`
401
+
402
+
```js title="my-adapter.mjs" ins={3} del={4-5}
403
+
setAdapter({
404
+
// ...
405
+
entrypointResolution:'auto',
406
+
exports: ['handler'],
407
+
args: { assets:config.build.assets }
408
+
})
409
+
```
410
+
411
+
2. Update your server entrypoint to provide any required exports without `createExports()`:
4. If you were relying on `args`, [create a virtual module to pass the build time configuration](/en/reference/adapter-reference/#passing-build-time-configuration) and import them from the virtual module instead:
<ReadMore>Learn more about [the Adapter API](/en/reference/adapter-reference/).</ReadMore>
467
+
377
468
## Removed
378
469
379
470
The following features have now been entirely removed from the code base and can no longer be used. Some of these features may have continued to work in your project even after deprecation. Others may have silently had no effect.
0 commit comments