Fix/accessibility and perf frontend fixes#1231
Open
spotkorner-dot wants to merge 4 commits into
Open
Conversation
The email input only ever referenced email-error via aria-describedby, so screen-reader users navigating back to the field after an API failure got no indication of the associated error.
setLocale updated in-memory/localStorage state and re-rendered text but never touched the html lang attribute, so switching locales would leave the page's declared language mismatched with its visible content (WCAG 3.1.1).
Locale was hand-typed as 'en' | 'es' | 'fr' | 'de' while translations only implemented 'en', so the language selector's type promised locales it could never actually render. Locale is now keyof typeof translations, so it can't drift ahead of what's implemented, and the selector's rendered options are guaranteed to match.
client.ts (imported by LandingPage.tsx and Statistics.tsx) shipped the full ~50-entry CONTRACT_ERROR_MESSAGES map and 15+ admin/blockchain/email request builders, even though the landing page only ever calls getStatistics and newsletterSubscribe. Split into: - request.ts: shared retry/timeout/cache request layer - client.ts: the two endpoints the landing page actually uses - admin-client.ts: everything else (admin, blockchain, email, contract error messages), for whatever internal tooling needs that surface A production build shows the two clients' code and string literals no longer appear together; client.ts now type-checks to expose only getStatistics and newsletterSubscribe, enforced by a test. Note: a byte-for-byte comparison of the built .next/static/chunks output against main showed no size difference for this app today, because Turbopack's dead-code elimination already stripped the unused api object's properties before this split. bundlewatch.config.json also still targets classic webpack output paths (vendor.js, main*.js, pages/_app*.js) that don't exist under this app's Turbopack/App Router build, so it isn't actually wired up to catch a regression here either. The split is still correct to make explicit and guards against future regressions (e.g. a stray import pulling the admin surface back in), but the bundlewatch config would need a separate fix to point at real Turbopack chunk paths before it could verify this in CI.
|
@spotkorner-dot Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1168
closes #1169
closes #1170
closes #1171
Description
Type of Change
Testing Done
Bundle Size
Checklist
docs/architecture.mdRelated Issues
Closes #