[BootstrapAdminUi] Add custom stimulus controller
Đá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
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- php
- Lĩnh vực
- developer-experience, frontend
Hướng nghiên cứu
Bắt đầu bằng cách đọc điểm vào asset của BootstrapAdminUi tại src/BootstrapAdminUi/assets/app.js và các script trong src/BootstrapAdminUi/assets/scripts. Tái hiện các yêu cầu AJAX trùng lặp sau khi cài đặt Symfony Stimulus Bundle và kiểm tra hook sylius_admin.base#javascripts. Công việc được xem là hoàn tất khi một phương án tích hợp đã được xác định hỗ trợ các controller Stimulus tùy chỉnh mà không làm hỏng các tính năng của BootstrapAdminUi hoặc khởi động live components hai lần.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
When using the BootstrapAdminUi bundle out of the box, it is a nice DX to not have to install and configure Symfony Stimulus Bundle and care that it exists at all.
At some point, when needed to add custom Stimulus controllers, we tried with what it seems a "standard Symfony way" by adding Symfony Stimulus Bundle.
For completeness, we chose AssetMapper to handle assets.
Consequences are there are two started Stimulus apps: one by BootstrapAdminUi and the other is the custom one with Stimulus Bundle.
So all requests made by live components are made twice.
Additional context
By overriding the template of the sylius_admin.base#javascripts hook, we may avoid the load of the asset bundles/syliusbootstrapadminui/app.js.
It avoids the start of the Stimulus app by BootstrapAdminUi but other features like the ones provided by https://github.com/Sylius/Stack/tree/8fcb13f517662e7aa0cb24453dcd2e721a4af0eb/src/BootstrapAdminUi/assets/scripts are broken.
How to reproduce
- Follow https://stack.sylius.com/getting-started.
- Install Symfony Stimulus Bundle
- Go on an admin page where there is a live component.
- Trigger an action (either live action or update a model or emit an event etc..)
- Check the number of AJAX requests with the profiler
Possible solutions
Before proposing a patch, I'd like to have feedback on how to address this.
Maybe I missed something somewhere 🤔
-
BootstrapAdminUi may stop starting a Stimulus app.
It will imply that users will have to do it themselves like with Stimulus Bundle.
It seems fairly simple for a user to do it. In another hand it increases the number of dependencies a user have to handle. -
BootstrapAdminUi may propose a way to allow users to chose if it should start a Stimulus app or not.
It may increase the complexity of maintenance of BootstrapAdminUi.
It will keep the nice DX allowing people to not care about the Stimulus part if they don't need to. -
BootstrapAdminUi may propose to reuse it's started Stimulus app in order to register custom controllers with it.
Users won't be able to use the default behavior of the Stimulus Bundle which register the controllers automagically.
Others "admin UI theme" may chose to do the same to ease life of users.
- Ngôn ngữ chính
- PHP
- Star
- 45
- Fork
- 34
- Merge trung bình
- 4 ngày 33 phút
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Sylius/Stack
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 84/100
-
[Docs][SyliusStack] add a "filters" section in the cookbook with links towards the Grid docsĐang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
-
feature question
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
-
Use env vars to trigger hooksĐang mởfeature
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Question : Creating userĐang mởdocumentation good first issue question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
smarty-php/smarty#1215 ·
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
sync-en
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
ProfessionalWiki/NeoWiki#1637 ·
Maintainer thường phản hồi trong vòng 1 ngày