Skip to content
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

await plugins at startup #1915

Closed
1 task done
huang-julien opened this issue Nov 16, 2023 · 1 comment
Closed
1 task done

await plugins at startup #1915

huang-julien opened this issue Nov 16, 2023 · 1 comment

Comments

@huang-julien
Copy link
Contributor

Describe the feature

Hello 👋

https://github.com/unjs/nitro/blob/f412af16b358e941e90cb222586be1e6a77066b7/src/runtime/app.ts#L196

When using nitro plugins, some of them can be async. Since plugins are here to modify/setup nitro, would this make sense to await for all plugins before starting nitro like awaiting nuxt plugins before rendering the nuxt app ?

Additional information

  • Would you be willing to help implement this feature?
@huang-julien huang-julien changed the title Awaited plugins at startup await plugins at startup Nov 16, 2023
@pi0
Copy link
Member

pi0 commented Nov 17, 2023

Hi, thanks for making the suggestion. It would be nice indeed but a tricky thing to do. But ideally (also for Nuxt) it is usually better to use lazy-loaded async composables that are initialized in paths that need them to be preferred over plugins.

Let's track in #915

@pi0 pi0 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants