Migrate alchemy-select to tom-select#3931
Merged
Merged
Conversation
041ea3a to
8082de7
Compare
9b0aece to
e851707
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3931 +/- ##
=======================================
Coverage 98.15% 98.15%
=======================================
Files 343 343
Lines 8899 8911 +12
=======================================
+ Hits 8735 8747 +12
Misses 164 164 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e851707 to
64f0a72
Compare
The basic enhanced select (`<select is="alchemy-select">`) is the simplest of the Select2 usages and a good first step toward dropping jQuery. Tom Select is a maintained, dependency-free library that wraps the native select, so the component keeps its public API (setOptions, enable, disable, allowClear) and every render site stays unchanged.
Instead of bundling floating-ui into two bundles, we share it as it's own bundle between shoelace and alchemy-select.
We only want to autofocus the element select inside of the new element form, not anywhere else (ie. the styleguide).
If we open a select in the elements window and the popup opens to the top off the window, we must not cut-off the content. For this to work well, we need to move the top bar below the main_content, because it is fied and would cut-off the elements window.
The importmap cache_sweeper only watched the JavaScript source directories, but the importmap pins resolve to the bundled files in app/assets/builds. After a rebuild the cached importmap kept emitting the previous asset digest, so the browser requested a digest that no longer existed and the asset returned a 404 until the server was restarted. Watching the build output directory sweeps the cache on every rebuild so the importmap always resolves the current digest. Watching the source directories was misleading because it is enough for a plain importmap setup where the pins point at the source files themselves, but Alchemy bundles its admin JavaScript with rollup into a separate output directory.
64f0a72 to
c74be87
Compare
Open
This file contains hidden or 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
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.
What is this pull request for?
Migrate the
alchemy-selectcustomElement from using select2 to tom-select.It keeps the features, but reimplements them in tom-select.
Checklist