зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-08-28 15:36:17 +03:00
- 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>
3.4 KiB
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
- Existing Test App: The gem already has a full Rails test application at
spec/dummy/(not using Combustion) - Existing Tests: Comprehensive system tests already exist in
spec/system/ - Existing Formtastic Input:
QuillEditorInputclass already exists, just needs jQuery removal
Key Decisions Made
-
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
-
Serve assets directly from vendor/assets
- No NPM package needed initially
- Propshaft automatically serves from vendor/assets and app/assets
- Simple drop-in integration
-
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
- Download Quill 2.x assets and place in vendor/assets
- Create new JavaScript initializer without jQuery
- Update Formtastic input class (already exists, just needs updates)
- Update existing spec/dummy test app for Propshaft/Rails 8
- Configure GitHub Actions CI/CD
Implementation Order
- Asset Setup (vendor/assets structure)
- JavaScript Modernization (remove jQuery)
- Test App Updates (spec/dummy with Propshaft)
- CI/CD Setup (GitHub Actions with matrix)
- 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/assetsandapp/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
- Quill.js 2.x: https://quilljs.com/
- Propshaft docs: https://github.com/rails/propshaft
- Reference gems:
- /data/activeadmin_trumbowyg (modern CI/test setup)
- /data/activeadmin-searchable_select (alternative patterns)
Contact for Questions
Review the comprehensive guide at activeadmin-4-propshaft-update.md for complete implementation details.