-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Remove support for process.server
/process.client
#25323
Comments
I absolutely agree it makes sense to not have to rely on these. I like |
As someone that's on the outside of core things in Nuxt but whose target audience is Enterprise customers the following consideration is scaring me a bit:
V2 -> V3 already almost broke the ecosystem (granted, upstream Vue also had a lot to do with this also) and I'm scared that too much/many low-level breaking changes from one version to another (that could potentially break a lot of deps in bigger projects) could scare away even more potential enterprise users / devs. I'd really like to see soft deprecation first and finally removing support for ground breaking stuff only the major version after to give devs time to sort those kind of changes out in a reasonable timeframe without breaking things "overnight". I know that this might not be the place to discuss this, but it raises a concern for me. I've already seen some scare in the community because of talk of yearly major releases and I urge you to handle major breaking changes with care between yearly major version releases. Please give the ecosystem time to get stable and stay stable. Long Term Support, plan-ability and upgradeability are one of the major reasons for success of frameworks like Symfony or Laravel in the enterprise world. |
Thanks for bringing up your concerns @bernhardberger! I can ensure you, there will be nothing as drastic as V2 -> V3 because lots of moving pieces changed. With V3 -> V4 that won't be the case at all (No Vue major, no migration to Vite, no Nuxt TS rewrite, No new server engine etc. etc.)
This is usually the way it goes 👍
Absolutely! I fully agree. We also discussed how we can make the next major migration as friction-free as possible (think of e.g. codemods and, as it happened already for minors, PRs to open-source modules) and will evaluate each suggestion, as this one, carefully. |
Just to be clear on another part to this ticket: I like proposal in general and I especially like the discussion in #21855 - a unified and clear to understand/read API would be welcome. Abstracting away the low level stuff would also leave room to adapt the implementation details down the road, like this ticket proposes, with less impact. |
Adding to this. I've tried to get away from |
@daniluk4000 (or anyone else) if you are facing issues like Obviously, (as for any other open namespace), library authors and users should be careful to not abuse |
@pi0 it's easy. export default defineNuxtModule({
async setup(_, nuxt: Nuxt) {
console.log(import.meta.server);
}
}) Done. Of course you can assume you're always on SSR inside module. Yet process.server could still be used inside some inner composable, process.server worked fine and import.meta does not work fine. |
Thanks for sharing @daniluk4000 yes indeed this is kind of stuff we need to resolve (in jiti). The counterpoint is, we were always depending on Node.js |
Perhaps it would be a good idea to use |
nuxt prefix makes sense! It also solves the ambiguity of which server we are in and also makes it easier to for example configure jiti especially handle with a prefix in AST. |
I absolutely agree we shouldn't remove |
One missing piece that I found when considering dropping ExamplesHere I'm using it in the template just to demonstrate, but in practice it's more likely to have statements like Example using
|
@rudolfbyker It should work with |
Describe the feature
In
v4v5, we could remove support forprocess.server
/process.client
in place ofimport.meta.server
/import.meta.client
(and similar). We could even help with a codemod.Impact might be modules providing components using it 🤔
Additional information
Final checks
The text was updated successfully, but these errors were encountered: