Repository navigation
Conversation
|
Hi @pi0 I have written up my idea and implemented it into a couple of presets. Before I continue and implement it into others, I thought it would be wise to seek some feedbadk. What do you think of the idea? Do you think the utilities and constants are located in the right places? Is there anything else you would like me to consider? |
|
@luc122c is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Hi dear @luc122c i love this idea sorry i couldn't check earlier. Please let me back on this, perhaps we can introduce in v3 branch first (also we should drop 16, 18 :D) |
|
@pi0 no problem at all! I forgot about it too 😆 Yes, I will target the v3 branch, make 20 the minimum and try to finish it off. Thanks for your support :) |
…not do unnecessary iterations.
49414b7 to
97546a4
Compare
|
Well, this rebase has turned into a great big mess 😆 I might close this and start a new branch and cherry-pick the relevant commits. |
|
It looks like Nitro no longer needs to specify the node version in the preset for Firebase App Hosting. The buildpack picks it up from package.json. |
|
@pi0 I have refactored the function to take the node version in package.json into consideration. I have also applied it to all applicable presets. I've tried to make it as simple as possible to apply this to other presets. Is there anywhere you'd like me to write any documentation for this? |
|
This has become much more relevant since Sept 23 when AWS Amplify dropped support for Node 18. The temporary work around I have found is this: It would be great if we could have a way to change the automatically generated deploy-manifest that is currently defaulting to node 18 with Nuxt 3. (Hopefully this is the correct place to make this request) |
|
This PR is targetting nitro v3 (upcoming nuxt) i will review ASAP. @Rothalack If AWS needs a hotfix please feel free to make a PR against |
|
Thanks for the quick reply @pi0 I did a deeper dive through things before I went making a PR, making sure I really understood everything. I was on Nuxt 3.17.2, which uses Nitro 2.11.11, which defaults to Node 18. I found that Nuxt 3.2, uses Nitro 2.12.9, which defaults to Node 20. Effectively doing exactly what I was hoping to find. So I think what I was asking for has already been solved. Thanks! |
This comment was written by an AI assistant on behalf of the Nitro maintainers. Please double-check anything that looks wrong. |
|
Thanks for the PR and sorry for late reply ❤️ Closing as it seems stalled now. |
|
@pi0 Yeah, no problem. It think if this was to be implemented now, it would need a different solution to the one in the PR. |
🔗 Linked issue
Closes #2716
❓ Type of change
📚 Description
A preset should accept the user's choice of Node.js runtime, as long as it is supported by the platform. In cases where the user's choice is not supported, or the user does not specify a runtime, a sensible default/fallback should be used.
Currently, the fallback is defined per preset. However, to ensure all deploy providers behave uniformly, we should define this globally at the Nitro level.
See #2654 (comment) for reference.
Methodology
To decide an appropriate fallback, we need to know two pieces of information:
To do this, we can export a
getDefaultNodeVersionutility which takes the supported Node versions as a set of numbers, and a function to convert the number to a runtime defintion. It then compared this to a globally set default. As Nitro is updated and newer Node features are used, this global can be increased to bump all presets.Examples
Considerations
This utility should consider the case where the Nitro default is not supported by the platform yet.
The documentation for preset authors should be updated to only list GA node versions in
supportedNodeVersions.📝 Checklist