Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[BootstrapAdminUi] Add custom stimulus controller

オープン
#200 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
php

調査の方向性

まず src/BootstrapAdminUi/assets/app.js にある BootstrapAdminUi のアセットエントリポイントと、src/BootstrapAdminUi/assets/scripts 配下のスクリプトを読みます。Symfony Stimulus Bundle をインストールした後に重複する AJAX リクエストを再現し、sylius_admin.base#javascripts フックを調査します。BootstrapAdminUi の機能を壊したり live components を二重に起動したりせずに、カスタム Stimulus コントローラーをサポートする統合方式が決まれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
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
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.

主要言語
PHP
スター
45
フォーク
34
平均マージ
4日 33分
マージ済み PR(30日)
8

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Sylius/Stack のほかの issue

Sylius/Stack の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。