Skip to content

[r5n-88] Modernize extension: React 17-19 support, performance fixes, updated snippets#353

Merged
ice-chillios merged 8 commits intomasterfrom
r5n-88-snippets
Apr 28, 2026
Merged

[r5n-88] Modernize extension: React 17-19 support, performance fixes, updated snippets#353
ice-chillios merged 8 commits intomasterfrom
r5n-88-snippets

Conversation

@deralaxo
Copy link
Copy Markdown
Contributor

@deralaxo deralaxo commented Apr 26, 2026

Summary

Performance

  • Removed bundled prettier dependency (was experimental, had race conditions, caused activation crashes). Snippet search now delegates formatting to the user's configured VS Code formatter
  • Converted all synchronous file I/O to async
  • Replaced JSON.stringify emptiness check with Object.keys in activation
  • Removed arbitrary 1s setTimeout in config change handler
  • Zero runtime dependencies

Snippet updates

  • Added React 18 hooks: useId, useTransition, useDeferredValue
  • Added React 19 hooks: useActionState, useFormStatus, useOptimistic, use
  • Added 'use client' and 'use server' directive snippets
  • Updated React Router imports for v6 (Switch removed, added Routes, useNavigate, useParams, useSearchParams, createBrowserRouter, useLoaderData, useFetcher)
  • Added router setup snippets: rtrsetup (createBrowserRouter boilerplate), rtrla (route with loader/action)
  • Added Redux Toolkit snippets: createAsyncThunk, RTK Query createApi, createSlice with extraReducers
  • Changed default wrapper from <div> to <></> (Fragments) in all component snippets
  • Changed importReactOnTop default to false (React 17+ JSX transform)
  • Removed deprecated rfcreduxp snippet and broken imbrs (imported removed Switch)

Bug fixes

  • Fixed extensionConfig to use explicit config.get() instead of unsafe cast — settings were not being read correctly
  • Fixed snippet regeneration mutating source objects (Object.assign(snippet, ...)Object.assign({}, snippet, ...)), which prevented settings changes from taking effect after first generation
  • importReactOnTop now applies to all snippets consistently (was only applied to a hardcoded subset)
  • Added languageScopes validation with user warning for invalid values
  • Fixed activationEvents casing (typescriptReacttypescriptreact)
  • Added missing export to tsrafc snippet to match its JS counterpart rafc

Documentation

  • Rewrote README: removed dead badge links and sponsor section, updated options table, fixed repo URLs
  • Rewrote Snippets.md: all 194 snippets now documented, removed ghost entries (imrs, imrse, imbrr, fref, ptypes), updated all examples to match current output

Issues

Fixes #348, fixes #347, fixes #346, fixes #344, fixes #320 — Performance / slow IDE
Fixes #333, fixes #325, fixes #313, fixes #305 — Extension crashes on startup
Fixes #350 — React import unnecessary with JSX transform
Fixes #316 — Snippets should use Fragments instead of <div>
Fixes #319 — Unknown language in activationEvents
Fixes #299 — Docs linking to deprecated reactjs.org

PR contributions incorporated

Closes #280 — Remove unnecessary React import (approach reworked)
Closes #291 — Update react-router imports to v6 (approach reworked)
Closes #317 — Redux API slice snippet (implemented as rxapi)
Closes #300 — Fix docs linking to old reactjs.org
Closes #301 — Missing export on tsrafc

@deralaxo deralaxo requested a review from ice-chillios April 26, 2026 13:38
@ice-chillios ice-chillios merged commit 015b27e into master Apr 28, 2026
1 check failed
@ice-chillios ice-chillios deleted the r5n-88-snippets branch April 28, 2026 09:43
@luislealdev
Copy link
Copy Markdown

Great work @deralaxo, #280 was something that really used to bother me if you ask and happy to be part of this great contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment