Add an option to stop loading jQuery

Đang mở
#6,778 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, jquery, php
Lĩnh vực
full-stack

Hướng nghiên cứu

Start by locating where headIncludeJavaScript.tpl and acp/templates/header.tpl are included and how the core decides which JavaScript assets to load per request. Then read the package-update search and cache paths, since the allowlist must be fetched, cached, refreshed, and fall back to the last known copy. Also identify how ACP options are registered and read, so the three-state setting can gate jQuery, jQuery UI, and plugin loading. Done means all three modes behave as described, including the fallback when no allowlist has ever been fetched.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Background

The core and all official WoltLab packages no longer depend on jQuery. It is still loaded on every request (headIncludeJavaScript.tpl, acp/templates/header.tpl), together with jQuery UI and its plugins, because third-party plugins may still rely on it. This adds download size and parse time, and it keeps legacy code paths from being removed.

Proposal

Add a new option that controls whether jQuery (including jQuery UI and its plugins) is loaded:

Value Behavior
Automatic (default) jQuery is only loaded if needed. It is skipped if every installed package is either an official WoltLab package or a third-party plugin on the allowlist. As soon as any other package is installed, jQuery is loaded.
Yes jQuery is always loaded.
No jQuery is never loaded. Plugins that still depend on it may break.
Allowlist of third-party plugins
  • The list of third-party plugins known to work without jQuery comes from the plugin store, so it can be updated without a new core release.
  • The list is cached locally and refreshed regularly, for example alongside the regular package update search. If the plugin store can't be reached, the last known list is used. If no list has ever been fetched, "automatic" falls back to loading jQuery.
Ngôn ngữ chính
PHP
Star
248
Fork
147
Merge trung bình
17 phút
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của WoltLab/WCF

Tất cả issue của WoltLab/WCF

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.