ux icon indicating copy to clipboard operation
ux copied to clipboard

[StimulusBundle] Rename bootstrap.js to bootstrap-stimulus.js

Open tacman opened this issue 2 years ago • 6 comments

Given the ubiquity of the bootstrap framework, I find it confusing to have the script to integrating stimulus also called bootstrap.js.

My app.js usually looks like this

// stimulus
import './bootstrap.js';

// bootstrap 5
import 'bootstrap'; // bootstrap javascript
import 'bootstrap/dist/css/bootstrap.min.css'

It's so easy to get these confused, I think bootstrap-stimulus.js would be clearer. Also, it's generated by the recipe, so it's not even like its saving typing.

tacman avatar Nov 14 '23 12:11 tacman

Had at work the same « wtf » moment with coworker when i introduced this package /file

boot_ux.js / init_ux.js / boot_app.js ?

naming can be « improved » to dissociate with bootstrap framework indeed :)

94noni avatar Jan 05 '24 21:01 94noni

This is still confusing to me too.

If others face the same issue, we could revisit this and consider a name change.

javiereguiluz avatar Apr 09 '24 10:04 javiereguiluz

This is very "webpack-like"..

If we can find a way to do this with no BC / generating frustration, i'm all in to rename.... but i'd even think we could entirely remove it (and merge within app.js)

WDYT ?

smnandre avatar Apr 09 '24 11:04 smnandre

I quite like the idea of moving it into app.js. If we were to do that, what about also renaming the app var to application, so it'd be more consistent with stimulus-components and the hotwired documentation

  • https://www.stimulus-components.com/docs/stimulus-timeago
  • https://stimulus.hotwired.dev/reference/controllers#registering-controllers-manually

that is

import { Application } from '@hotwired/stimulus'

const application = Application.start()

I think the recipe should include

application.debug=true;

or false, but either way, make it explicit.

One potential downside to embedding the code in app.js is that if someone were to create a command that installs stimulus components, it'd be easier to automate initializing it. That is

bin/console importmap:require-stimulus timeago
# same as 
bin/console importmap:require stimulus-timeago
cat assets/stimulus-bootstrap.js

would install it as well.

import { startStimulusApp } from '@symfony/stimulus-bundle';
import Timeago from 'stimulus-timeago'

const application = startStimulusApp();
application.debug=true;
application.register('timeago', Timeago);

tacman avatar Apr 09 '24 11:04 tacman

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar Oct 10 '24 12:10 carsonbot

Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3

carsonbot avatar Oct 24 '24 12:10 carsonbot

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

carsonbot avatar Nov 07 '24 12:11 carsonbot

Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?

carsonbot avatar May 08 '25 12:05 carsonbot

Not something we can do for now, let's reopen the debate in 3.0

smnandre avatar May 10 '25 16:05 smnandre