-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hotwire Support #461
Merged
Hotwire Support #461
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These were removed in Bootstrap 5 but have been restored as they also correct text colors on light backgrounds.
This was referenced May 27, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After keeping this development behind closed doors for way too long, I'm excited to finally publicly release one of the largest Trestle updates yet -- the Trestle Hotwire update. This has been a branch two years in the making, and brings the Trestle front-end much more up-to-date and in-line with modern Rails development practices.
Among the things I'm most excited about with this release are the full Stimulus integration, making it easier to override and extend default behavior; Turbo frames, and an easier pathway to real-time updates with Turbo streams; Sass no longer being a required dependency for theming, making it possible to live alongside applications using Tailwind CSS; as well as run-time theming options.
Key Points
Breaking Changes
Where possible, I've tried to avoid breaking changes but there are a few potential pitfalls:
app/assets/stylesheets/trestle/_theme.scss
. Instead define theme colors inconfig/initializers/trestle.rb
:Custom views: If you've customized your views by copying over the templates from the Trestle source, you'll want to merge in the updates from this branch to ensure that the required Turbo frames are present. Hopefully overriding views in this way won't be necessary for much longer as the custom actions API will be one of the next major pieces I'll be working on.
Bootstrap 5 changes: In particular, Bootstrap 5.x changed a number of class names from
-l
/-left
/-r
/-right
to-s
/-start
/-e
/-end
. e.g.ml-2
becomesms-2
,dropdown-menu-right
becomesdropdown-menu-end
. If you are using any of these in your code, they will need to be updated. See https://getbootstrap.com/docs/5.0/migration/ and https://getbootstrap.com/docs/5.2/migration/ for further information on changes within Bootstrap.If you do come across any more, please comment below and I'll update the list.
Deprecations
Defining a dialog form with
form dialog: true
has been deprecated. Instead useform modal: true
. It is also now possible to specify modal options e.g.form modal: { class: "modal-lg", controller: "stimulus-controller" }
The
dialog_request?
helper has been deprecated. Usemodal_request?
instead.Setting
Trestle.config.turbolinks
is deprecated. Turbo will always be used within Trestle views, and is provided by the Trestle JS bundle.Hooking into Trestle JS callbacks using
Trestle.ready(function() {
andTrestle.init(function(root)
is deprecated. They'll continue to work for now but will be removed by the time 1.0 rolls around. Stimulus controllers are a much better option for integrating custom code.Associated PRs
Updating & Testing
Update your Gemfile to refer to the
hotwire
branch of the trestle repository, and related gems as required:Next Steps
I am currently running these branches in production on a few of my applications and have managed to fix all of the issues I have myself encountered. As such, I'm hoping that this will be able to be merged and released as 0.10.0 fairly soon.
Following that, I'll be releasing a roadmap outlining the remaining features that I'd like to implement before making a 1.0 release.
If you do find any issues while testing this branch, please report them here (or in the relevant repo's PR linked above).