Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BootstrapAdminUi] Add custom stimulus controller

Aperta
#200 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
php

Direzione di ricerca

Inizia leggendo l’entry point degli asset di BootstrapAdminUi in src/BootstrapAdminUi/assets/app.js e gli script presenti in src/BootstrapAdminUi/assets/scripts. Riproduci le richieste AJAX duplicate dopo aver installato Symfony Stimulus Bundle e analizza l’hook sylius_admin.base#javascripts. Il lavoro è completato quando un’integrazione definita supporta controller Stimulus personalizzati senza interrompere le funzionalità di BootstrapAdminUi né avviare due volte i live components.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
PHP
Stelle
45
Fork
34
Merge medio
4g 33m
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Sylius/Stack

Tutte le issue di Sylius/Stack

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.