feat: migrate comments.js from jquery to vanilla js#3
Merged
Conversation
009d0dd to
624e0c2
Compare
treehousedevelopers
approved these changes
Jan 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate from jQuery to Vanilla JavaScript and update configuration API
Description
Complete migration of FOSCommentBundle JavaScript code from jQuery to vanilla JavaScript (ES6+). This includes removing jQuery and easyXDM dependencies, implementing modern JavaScript features (Fetch API, const/let, arrow functions, CustomEvents), and introducing a new object-based configuration format for better API design.
Breaking Changes
Configuration API:
fos_comment_thread_id,fos_comment_thread_api_base_url,fos_comment_thread_view) replaced withwindow.FosComment.configobjectScope
window.FosComment.config)varwithconstin JavaScript code for modern practicesFiles Changed
Template files:
src/Resources/views/Thread/async.html.twig- Updated to use new configuration objectJavaScript:
src/Resources/public/js/comments.js- Updated JSDoc comments, replaced var with const/let, modernized codeDocumentation:
docs/4-enable_comments_on_a_page.md- Updated basic usage examplesdocs/10-other_ways_of_adding_comments_to_a_page.md- Added configuration example for manual loadingdocs/13-hooking_into_the_js_code.md- Updated event listener examplesdocs/99-faq.md- Minor documentation updateTest files:
tests/Functional/Bundle/CommentBundle/Resources/views/Comment/async.html.twig- Removed jQuery dependencytests/Functional/Bundle/CommentBundle/Resources/views/Comment/inline.html.twig- Removed jQuery script tagTechnical Changes
Old syntax (removed):
New syntax: