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

fix: set up non-default ipx providers if options.ipx is set #1618

Merged
merged 6 commits into from
Dec 6, 2024

Conversation

whatcould
Copy link
Contributor

Fixes #1414

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • [ x] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Previously, specifying a custom provider would prevent setup of ipx, which happens in a 'nitro:init hook. That is, there was no way use ipx if it wasn't your default provider.

Now, you just need to add ipx to the image options:

image: {
  ipx: {},
  provider: "yourprovider",
  providers: {
    yourprovider: { ... }
  }
}

@whatcould whatcould requested a review from danielroe as a code owner December 5, 2024 19:05
Previously, specifying a custom provider would prevent setup of ipx
src/module.ts Outdated Show resolved Hide resolved
Co-authored-by: Daniel Roe <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Dec 5, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 62.83%. Comparing base (5dd30b4) to head (75f5fc0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/module.ts 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1618      +/-   ##
==========================================
- Coverage   62.93%   62.83%   -0.10%     
==========================================
  Files          79       79              
  Lines        3529     3536       +7     
  Branches      407      411       +4     
==========================================
+ Hits         2221     2222       +1     
- Misses       1279     1285       +6     
  Partials       29       29              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@danielroe
Copy link
Member

Pushed a slight refactor - does that still work for you?

@whatcould
Copy link
Contributor Author

Seems fine? I couldn't quite figure out what ipxStatic did or make it work myself β€” though it does seem to require the ipx initialization, so if you wanted to use it alongside another default, your change would make it impossible.

@danielroe
Copy link
Member

ipxStatic is basically ipx but only referencing files that were generated at build time, without any runtime component. And it should work fine - users can provide config in ipx: {} that gets passed to the ipxStatic provider.

@danielroe danielroe changed the title Setup the ipx provider if specified in options fix: setup non-default ipx providers Dec 6, 2024
@danielroe danielroe changed the title fix: setup non-default ipx providers fix: set up non-default ipx providers if options.ipx is set Dec 6, 2024
@danielroe danielroe merged commit 72e6bfb into nuxt:main Dec 6, 2024
2 checks passed
@github-actions github-actions bot mentioned this pull request Dec 6, 2024
@github-actions github-actions bot mentioned this pull request Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPX provider not working properly when the default provider is not IPX
3 participants