Skip to content

fix: Add getAppConfig as an alias to useAppConfig#2144

Merged
aklinker1 merged 3 commits intowxt-dev:mainfrom
Arktomson:fix-1911-get-app-config-name
Feb 21, 2026
Merged

fix: Add getAppConfig as an alias to useAppConfig#2144
aklinker1 merged 3 commits intowxt-dev:mainfrom
Arktomson:fix-1911-get-app-config-name

Conversation

@Arktomson
Copy link
Contributor

Overview

useAppConfig is not a hook — it's a plain synchronous function that returns the app config object. The use prefix is misleading, especially for React users where use* conventionally implies a hook with re-rendering behavior.

This PR renames it to getAppConfig to better reflect its nature as a simple getter. The original useAppConfig is kept as a backward-compatible alias that delegates to getAppConfig, so existing code continues to work without changes.

Changes include:

  • Add getAppConfig as the primary function in wxt/utils/app-config, with useAppConfig calling it internally
  • Register getAppConfig as an auto-import alongside useAppConfig
  • Update all docs and internal usages to prefer getAppConfig
  • Update e2e test snapshots for auto-imports

Manual Testing

  1. In any WXT project, use getAppConfig() — verify it is auto-imported and returns the app config
  2. Verify useAppConfig() still works as before (backward compatibility)
  3. Run pnpm test and pnpm build to confirm all tests and builds pass

Related Issue

This PR closes #1911

@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit b07aff5
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6999d0e68e93760008ff157b
😎 Deploy Preview https://deploy-preview-2144--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@aklinker1 aklinker1 left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the PR. I added some missing JSDoc to the useAppConfig and getAppConfig functions, I didn't realize they didn't have any docs.

@aklinker1 aklinker1 changed the title fix: add getAppConfig auto import alias fix: Add getAppConfig as an alias to useAppConfig Feb 21, 2026
@aklinker1 aklinker1 enabled auto-merge (squash) February 21, 2026 15:36
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 21, 2026

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@2144

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@2144

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@2144

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@2144

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@2144

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@2144

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@2144

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@2144

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@2144

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@2144

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@2144

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@2144

wxt

npm i https://pkg.pr.new/wxt@2144

commit: b07aff5

@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.97%. Comparing base (395c584) to head (b07aff5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/wxt/src/utils/app-config.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2144      +/-   ##
==========================================
- Coverage   76.28%   75.97%   -0.32%     
==========================================
  Files         113      113              
  Lines        3045     3047       +2     
  Branches      683      683              
==========================================
- Hits         2323     2315       -8     
- Misses        637      646       +9     
- Partials       85       86       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aklinker1 aklinker1 merged commit 430a3ac into wxt-dev:main Feb 21, 2026
18 checks passed
@github-actions
Copy link
Contributor

Thanks for helping make WXT better!

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.

Rename useAppConfig to getAppConfig to avoid linter complaints/ai confusion

2 participants