-
-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove jQuery & Bootstrap #4111
base: 2.x
Are you sure you want to change the base?
Conversation
marked jquery as deprecated removed jquery from the following components: - AbstractGlobalSearch - Dropdown - Page - Tooltip - Drawer - DiscussionListItem - DiscussionListPane - IndexPage - LogInModal - Pane - slidable - liveHumanTimes
Hello @YUCLing, Thank you so much for opening a Draft PR for this. Looking at your description and title, I think we originally wanted to not just drop jQuery, but also Bootstrap, see this archived issue as an example: flarum/issue-archive#179. Right now I don't exactly know if we can and should pursue that in the scope of this overhaul. But generally speaking, if you touch something that breaks all extensions, it might as well touch more. @flarum/core opinions appreciated. |
Like I mentioned in the discuss thread. Really appreciate the effort 🙏 The changes will very very likely still be relevant for another major version, just not at this time right for 2.0 as it's a little late, but also because it is already difficult as it is upgrading extensions for 2.0 with all the breaking changes already introduced. |
That can be done too. But I would like to focus on jQuery first, then Bootstrap. Just split them into small tasks.
It's not a big problem. This PR doesn't have to be merged now.
Nevermind, if some extensions extend/override the functions that returns jQuery, that will be a problem. |
removed jquery from components: - AutocompleteDropdown - KeyboardNavigatable
removed jquery from components: - EditUserModal - FormModal - SearchModal - TextEditor - UploadImageButton - highlight - anchorScroll - GambitsAutocomplete
removed jquery from component: ConfirmDocumentUnload fix: anchor scroll cannot accept string
removed jquery from components: - ForumApplication - AbstractPost - Search
removed jquery from components: - AvatarEditor - CommentPost - HeaderList - LogInButton - NotificationGrid - PostMeta - PostsPage - PostStream - ReplyPlaceholder - SignUpModal - WelcomeHero - ComposerState fix: wrong usage of select fix: incorrect selector syntax
removed jquery from component: AffixedSidebar
removed jquery from core
I'm planning to introduce a new library (https://github.com/floating-ui/floating-ui) to take care of things like Tooltip and Dropdown's positioning, what's your opinion? |
removed jquery from extensions: - embed - emoji
I'll put a pause to this PR, since Mithril v3 is right around (MithrilJS/mithril.js#2982). This PR is scheduled for 3.x, which is still far away. I'm gonna decide next steps after Mithril v3 is settled. It might turn to a big overhaul to frontend instead of just removing jQuery & Bootstrap. |
This is still an ongoing work and brings huge breaking changes. Quality check and feedback are required before final merge.
Completes https://github.com/orgs/flarum/projects/22?pane=issue&itemId=5300309
Changes proposed in this pull request:
This PR removes jQuery and Bootstrap completely from Flarum, which can greatly reduce the frontend size.
Reviewers should focus on:
css
returns computed style valueNecessity
Components using jQuery
Core
Common
components/AutocompleteDropdown
components/ConfirmDocumentUnload
components/EditUserModal
components/FormModal
components/SearchModal
components/TextEditor
components/UploadImageButton
helpers/highlight
utils/anchorScroll
utils/GambitsAutocomplete
utils/KeyboardNavigatable
Forum
ForumApplication
components/AbstractPost
components/AffixedSidebar
components/AvatarEditor
components/CommentPost
components/Composer
components/HeaderList
components/LogInButton
components/NotificationGrid
components/PostMeta
components/PostsPage
components/PostStream
components/PostStreamScrubber
components/ReplyPlaceholder
components/Search
components/SignUpModal
components/WelcomeHero
states/ComposerState
Admin
components/AdminNav
components/CreateUserModal
components/UserListPage
Extensions
embed
index
emoji
addComposerAutocomplete
fragments/AutocompleteDropdown
mentions
index
addComposerAutocomplete
addMentionedByList
addPostMentionPreviews
addPostQuoteButton
fragments/AutocompleteDropdown
fragments/PostQuoteButton
utils/selectedText
messages
components/MessagesPage
components/MessageStream
nicknames
index
subscriptions
components/SubscriptionMenu
suspend
components/SuspendUserModal
tags
components/TagsPage
components/TagSelectionModal
addTagComposer
Additional Work
Search
andAutocompleteDropdown
Changed behaviors
Some features are not available in vanilla JS and is not worth implementing them. They are listed below:
Confirmed