Skip to content

refactor: cleanup public actions API#14844

Merged
florian-lefebvre merged 36 commits intowithastro:nextfrom
trueberryless:refactor/tbl-14608-cleanup-actions-public-api
Dec 8, 2025
Merged

refactor: cleanup public actions API#14844
florian-lefebvre merged 36 commits intowithastro:nextfrom
trueberryless:refactor/tbl-14608-cleanup-actions-public-api

Conversation

@trueberryless
Copy link
Contributor

@trueberryless trueberryless commented Nov 20, 2025

Changes

  • Refactor public API of actions to reduce what is exported (introduce new /entrypoints/{server|client}.ts files)
  • Cleanup additional internals regarding actions
  • Closes Cleanup actions public API #14608

Testing

I adapted some imports in test since the refactoring affects some.

Docs

No docs changed, this PR is intended to just refactor internal exports and remove public access to some types.
The docs were already adapted in withastro/docs#12596

Todo

  • Write a proper changeset with breaking changes once I understand what I actually need to do 😅

@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: db29578

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Nov 20, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 20, 2025

CodSpeed Performance Report

Merging #14844 will not alter performance

Comparing trueberryless:refactor/tbl-14608-cleanup-actions-public-api (283ea2e) with main (78ed8b5)1

Summary

✅ 6 untouched

Footnotes

  1. No successful run was found on main (e878679) during the generation of this report, so 78ed8b5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@florian-lefebvre
Copy link
Member

First of all, the PR should be against the next branch!

@florian-lefebvre florian-lefebvre added this to the v6.0.0 milestone Nov 21, 2025
@trueberryless trueberryless changed the base branch from main to next November 22, 2025 07:02
@trueberryless
Copy link
Contributor Author

First of all, the PR should be against the next branch!

I'm gonna do it better next time 😅

@florian-lefebvre
Copy link
Member

Do you need help?

@trueberryless
Copy link
Contributor Author

Hi, Florian!

That would be awesome, as I'm not totally sure what else to edit 🙏

@florian-lefebvre
Copy link
Member

The 2 last bullet points of the issue are handled, nicely done! Many things are missing from the 1st bullet point tho:

  • Currently you're only exporting some types but that is not enough. You should re-export also runtime utils. Basically all the things documented in https://docs.astro.build/en/reference/modules/astro-actions/
  • Old entrypoints must be removed if possible
  • In the actions vite plugin, you should update paths to point to the new files

Does that make sense? Happy to clarify

@trueberryless
Copy link
Contributor Author

Thanks Florian for the explanation, this made it much more clear to me 🙌

Regarding

In the actions vite plugin, you should update paths to point to the new files

I'm not totally sure, where you mean, I think I adapted it already, but I probably overlooked some place, so I updated it in the last commit again, please let me know, if I am completely mistaken here and which changes are actually required 🙏

Old entrypoints must be removed if possible

In the last commit, I moved as much things that are now exported from /entrypoints to the shared.ts instead of server.ts and completely deleted the runtime/client.ts file. I think the only thing that should still stay in server.ts is ActionClient, which therefore is still exported.

Also let me know if you would prefer some other ordering / structuring in the new entrypoint files, I grouped it by type vs functions/classes 👍

All in all, I'm pretty sure I missed some other things, but I really appreciate your guidance and patience! Thank you!

@trueberryless
Copy link
Contributor Author

Also, I just noticed this PR is still in draft mode. I think now is the time to mark it as ready for review to encourage reviews 🙌

@trueberryless trueberryless marked this pull request as ready for review November 28, 2025 14:50
@trueberryless
Copy link
Contributor Author

I'll also fix the CI issues later, I think they are self-explanatory 👍

Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trueberryless
Copy link
Contributor Author

When I talk about the vite plugin, I'm talking about this line specifically next/packages/astro/src/actions/vite-plugin-actions.ts#L117

Thanks very much for clarifying that! I was unable to find it myself, sorry!

@florian-lefebvre florian-lefebvre self-assigned this Dec 1, 2025
@trueberryless
Copy link
Contributor Author

Thank you so much, Florian, for helping out and cleaning up many 👀 important parts of code. I definitely couldn't have done that without you. Thanks for also being so patient with me and always offering help 🙌

As you can probably see, I created the docs PR for this breaking change, where I listed all removed utilities to my knowledge. I'm not sure if this is the best approach, but let's discuss these details over there 👍

Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
Copy link
Member

@florian-lefebvre florian-lefebvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect thank you! It may take a few days to merge this because we want to merge another PR first

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Dec 4, 2025
@github-actions github-actions bot removed the pkg: integration Related to any renderer integration (scope) label Dec 5, 2025
@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Dec 8, 2025
@florian-lefebvre florian-lefebvre merged commit 8d43b1d into withastro:next Dec 8, 2025
22 checks passed
@trueberryless trueberryless deleted the refactor/tbl-14608-cleanup-actions-public-api branch December 13, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pr pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup actions public API

3 participants