Skip to content

Rewrite with more modern extension framework#81

Open
Erik-Handeland wants to merge 1 commit into
mainfrom
2.0.0
Open

Rewrite with more modern extension framework#81
Erik-Handeland wants to merge 1 commit into
mainfrom
2.0.0

Conversation

@Erik-Handeland
Copy link
Copy Markdown
Collaborator

@Erik-Handeland Erik-Handeland commented Apr 4, 2026

Rebuild Complete - via claude

What Changed (Old vs New)

Metric v1 (Current) v2 (Rebuild)
Build time ~30s (CRA+Craco) 1.3s (Vite+CRXJS)
Bundle CSS ~200KB+ (MUI) 25.8 KB (Tailwind)
Bundle JS ~800KB+ (MUI+forge+moment+lodash) 363 KB (React+Radix+date-fns)
Dependencies 25 packages 13 packages
Crypto library node-forge (300KB) Web Crypto API (0 KB, native)
State mgmt Context+useReducer (30+ actions, 350 LoC) Zustand (130 LoC)
Date library moment.js (300KB) date-fns (tree-shaken)
Manifest V4 (invalid) V3 (correct)
React 17 19
TypeScript 4.0 5.7
Source files 23 components 17 components (less boilerplate)

Architecture

v2/
├── manifest.json          # Proper MV3 manifest
├── vite.config.ts         # Vite + CRXJS + Tailwind v4
├── src/
│   ├── main.tsx           # Entry point
│   ├── App.tsx            # HashRouter + Routes
│   ├── background.ts      # Service worker (context menus)
│   ├── lib/
│   │   ├── crypto.ts      # Web Crypto API (AES-GCM/CBC/CTR, PBKDF2)
│   │   ├── pastebin.ts    # Pastebin API (no hardcoded cookies)
│   │   ├── storage.ts     # Promise-based Chrome storage
│   │   ├── store.ts       # Zustand store with persistence
│   │   └── constants.ts   # Enums, limits, defaults
│   ├── components/
│   │   ├── NavBar.tsx      # Top nav with active state
│   │   ├── editor/
│   │   │   ├── TextEditor.tsx   # Smart text detection
│   │   │   └── ActionBar.tsx    # Split button + dropdown
│   │   ├── dialog/
│   │   │   ├── EncryptDialog.tsx  # Passkey w/ auto-generate
│   │   │   ├── DecryptDialog.tsx  # Key input
│   │   │   └── ConfirmDialog.tsx  # Destructive action confirm
│   │   └── common/
│   │       ├── CopyBox.tsx       # Copy/mask/open-in-new
│   │       ├── PageHeader.tsx    # Back nav + title
│   │       ├── SettingsRow.tsx   # Reusable settings item
│   │       └── StatusBadge.tsx   # Success/error/empty states
│   └── routes/
│       ├── Editor.tsx      # Main encrypt/decrypt/post flows
│       ├── Settings.tsx    # Theme, encryption, API, data
│       ├── History.tsx     # Date-grouped item list
│       ├── Result.tsx      # Pastebin link, ciphertext, passkey
│       ├── ApiKeyConfig.tsx # Validated API key input
│       ├── EncConfig.tsx   # Algorithm + key length picker
│       └── Support.tsx     # FAQ, bug report, donate links

Key Improvements

  1. No more hardcoded cookies in Pastebin requests (security issue in v1)
  2. No more alert() from service worker (MV3 incompatible)
  3. Native crypto - hardware-accelerated, zero-dependency encryption
  4. Proper Promise APIs everywhere (no callback hell)
  5. Modern dark mode using CSS custom properties with Tailwind
  6. Clean glass/blur aesthetic with backdrop-blur, rounded corners, subtle shadows
  7. Accessible dialogs via Radix UI primitives (keyboard + screen reader support)
  8. Lucide icons - consistent, tree-shakeable (only ships icons you use)

To install and test

cd v2
npm install
npm run build    # outputs to v2/dist/
# Load v2/dist as unpacked extension in chrome://extensions
image image

@Erik-Handeland Erik-Handeland requested a review from bindeman April 4, 2026 10:09
@bindeman
Copy link
Copy Markdown
Member

bindeman commented Apr 6, 2026

Damn claude. This is nice. I have some other changes I had from my side, including some visual changes and how it renders in the browser instead of as a standalone. Going to merge those into 2.0.0 branch you created here then we can review and release

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.

2 participants