Files
activeadmin-quill_editor/docs/session-summary.md
Gleb Tv 7f3d842e3a feat: Add ActiveAdmin 4 and Propshaft support
- Switch to ActiveAdmin 4 beta with Tailwind CSS
- Replace Sprockets with Propshaft for Rails 8
- Migrate from jQuery to vanilla JavaScript
- Implement proper module initialization without setTimeout hacks
- Add esbuild for JavaScript bundling with clean import aliases
- Configure Tailwind CSS build process with ActiveAdmin plugin
- Update engine configuration for both Propshaft and Sprockets
- Add comprehensive documentation for AA4 gem updates
- Maintain backward compatibility with legacy AA versions

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 12:58:00 +03:00

3.4 KiB

Session Summary - ActiveAdmin Quill Editor Modernization

Context

We analyzed replacing Trumbowyg with Quill for ActiveAdmin 4.x and Rails 8 compatibility. After evaluating SunEditor (too large at 450KB after removing source maps) and Quill.js (~200KB), we chose to modernize the existing activeadmin_quill_editor gem.

Important Discoveries

  1. Existing Test App: The gem already has a full Rails test application at spec/dummy/ (not using Combustion)
  2. Existing Tests: Comprehensive system tests already exist in spec/system/
  3. Existing Formtastic Input: QuillEditorInput class already exists, just needs jQuery removal

Key Decisions Made

  1. Use Quill.js instead of SunEditor

    • Quill: ~200KB minified
    • Clean delta-based architecture
    • No jQuery dependency for the core library
    • Existing gem foundation to build upon
  2. Serve assets directly from vendor/assets

    • No NPM package needed initially
    • Propshaft automatically serves from vendor/assets and app/assets
    • Simple drop-in integration
  3. Follow activeadmin_trumbowyg patterns

    • Combustion-based test app
    • Modern CI with matrix testing (Ruby 3.3/3.4, Rails 7.x/8.x)
    • Comprehensive GitHub Actions setup with caching
    • ESBuild for test app assets

Files Created

  • /data/activeadmin-quill_editor/docs/activeadmin-4-propshaft-update.md - Complete migration guide
  • /data/activeadmin-quill_editor/docs/session-summary.md - This summary

Next Steps

Immediate Tasks

  1. Download Quill 2.x assets and place in vendor/assets
  2. Create new JavaScript initializer without jQuery
  3. Update Formtastic input class (already exists, just needs updates)
  4. Update existing spec/dummy test app for Propshaft/Rails 8
  5. Configure GitHub Actions CI/CD

Implementation Order

  1. Asset Setup (vendor/assets structure)
  2. JavaScript Modernization (remove jQuery)
  3. Test App Updates (spec/dummy with Propshaft)
  4. CI/CD Setup (GitHub Actions with matrix)
  5. Documentation Update (README, examples)

Testing Strategy

  • Use existing spec/dummy Rails app (no Combustion needed)
  • Update existing system tests, add missing cases from trumbowyg
  • Matrix test against Ruby 3.3/3.4
  • Test Rails 7.x and 8.x with ActiveAdmin 4.x beta
  • Consider adding Playwright for modern browser tests
  • SimpleCov for coverage with SonarQube integration

Technical Notes

Propshaft Asset Serving

  • Gems can provide assets in vendor/assets and app/assets
  • Propshaft automatically includes these paths in load path
  • No compilation needed for vendored assets
  • Digest stamping handled automatically

JavaScript API Changes

Replace jQuery-based initialization:

// Old (jQuery)
$(document).ready(initQuillEditors);

// New (Vanilla)
document.addEventListener('DOMContentLoaded', initQuillEditors);
document.addEventListener('turbo:load', initQuillEditors);

Form Input Usage

f.input :content, as: :quill_editor, input_html: {
  data: {
    options: {
      theme: 'snow',
      modules: { toolbar: [...] }
    }
  }
}

Resources

Contact for Questions

Review the comprehensive guide at activeadmin-4-propshaft-update.md for complete implementation details.