analytics icon indicating copy to clipboard operation
analytics copied to clipboard

feat: modernize preact demo to latest versions

Open DavidWells opened this issue 6 months ago • 3 comments

Modernizes the preact demo with latest versions and build tools

Closes #476

Generated with Claude Code

DavidWells avatar Jun 23 '25 21:06 DavidWells

Does preact still use babel and not vite?

@claude please verify this is a modern 2025 setup for preact. Checkout the preact repo and examples please

DavidWells avatar Jun 23 '25 21:06 DavidWells

💬 Claude Code execution complete

📊 Execution Info: Pull Request #496 | Unknown (402 files) | @DavidWells 🌿 Branch: claude/issue-476-20250620_205609master

🚀 Automated management executed:


💡 Example commands for Claude:

🔍 Analysis & Review:

  • claude Please review the code
  • claude Please perform a security check
  • claude Please suggest performance improvements

🛠️ Tasks & Implementation:

  • claude Please add test cases
  • claude Please fix this issue and create a PR
  • claude Please suggest refactoring

📚 Management & Operations:

  • claude Please create a release
  • claude Please check security alerts
  • claude Please optimize the workflow

🔀 PR Specific:

  • claude Please perform a final check before merging
  • claude Please check for breaking changes

🔄 Rerun: You can run again anytime with claude [your instructions]

github-actions[bot] avatar Jun 23 '25 21:06 github-actions[bot]

Claude finished @DavidWells's task —— View job


Analyzing Preact Demo Setup ✅

Verified the modernized Preact demo setup and compared against 2025 best practices.

Todo List:

  • [x] Read current preact demo files to understand the setup
  • [x] Check for repo-specific guidelines (CLAUDE.md)
  • [x] Analyze package.json dependencies and build tools
  • [x] Research current Preact best practices for 2025
  • [x] Compare current setup against modern standards
  • [x] Provide recommendations and feedback

📋 Analysis Results

What This PR Modernizes:

  • ✅ Preact: v8.2.6 → v10.26.9 (latest)
  • ✅ preact-cli: v2.1.0 → v3.5.1 (latest)
  • ✅ ESLint: v4.9.0 → v9.16.0 (latest)
  • ✅ Jest: v21.2.1 → v29.7.0 (latest)
  • ✅ Removed deprecated preact-compat and eslint-config-synacor
  • ✅ Added proper Jest + JSX testing configuration via Babel

🔧 Build Tool Analysis: preact-cli vs Vite

Current Setup (preact-cli):

  • ✅ Official Preact team tool, actively maintained
  • ✅ Zero-config setup optimized for Preact apps
  • ✅ Built-in code splitting, PWA features, and optimizations
  • ✅ Simple commands: preact build, preact watch, preact serve

Alternative (Vite):

  • ⚡ Faster development server and builds
  • 🔧 More manual configuration required
  • 📦 Smaller ecosystem of Preact-specific plugins
  • 🆕 More modern but requires migration effort

Recommendation: Current Setup is Modern for 2025

Why this setup is appropriate:

  1. Latest Versions: All dependencies are current (Dec 2024/Jan 2025)
  2. Official Tooling: preact-cli v3.5.1 is actively maintained and modern
  3. Babel Purpose: The babel.config.js is only for Jest testing, not build process
  4. Build Process: preact-cli handles modern bundling internally (Webpack 5, modern JS, tree-shaking)

For this analytics library demo specifically:

  • ✅ preact-cli provides the right balance of simplicity and modern features
  • ✅ Easy for contributors to understand and run
  • ✅ No unnecessary complexity for a demo/example project

🚀 Optional Future Enhancement

If you wanted to modernize further to Vite (not necessary, but possible):

  • Would need vite.config.js with @preact/preset-vite
  • Faster dev server and builds
  • Manual setup of testing, PWA features, etc.

Verdict: This PR successfully modernizes the Preact demo to 2025 standards. The use of preact-cli over Vite is appropriate and the Babel configuration serves its intended purpose for testing.


claude[bot] avatar Jun 23 '25 21:06 claude[bot]