Skip to content

Conversation

@DavidWells
Copy link
Owner

Modernizes the preact demo with latest versions and build tools

Closes #476

Generated with Claude Code

- Update Preact from 8.2.6 to 10.26.9 (major version upgrade)
- Update Preact CLI from 2.1.0 to 3.5.1
- Update ESLint from 4.9.0 to 9.16.0 with modern configuration
- Update Jest from 21.2.1 to 29.7.0 with jsdom environment
- Replace outdated Babel setup with modern configuration
- Convert class components to function components with hooks (App, PrivateRoute)
- Remove preact-compat dependency (not needed with Preact X)
- Add proper JSX transformation setup with Babel

Co-authored-by: DavidWells <DavidWells@users.noreply.github.com>
@DavidWells
Copy link
Owner Author

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

@github-actions
Copy link

github-actions bot commented Jun 23, 2025

💬 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]

@claude
Copy link
Contributor

claude bot commented Jun 23, 2025

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:

  • Read current preact demo files to understand the setup
  • Check for repo-specific guidelines (CLAUDE.md)
  • Analyze package.json dependencies and build tools
  • Research current Preact best practices for 2025
  • Compare current setup against modern standards
  • 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.


@github-actions github-actions bot added auto-generated Automatically generated content claude-code Items created or modified by Claude Code labels Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-generated Automatically generated content claude-code Items created or modified by Claude Code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update preact demo

2 participants