Introduce trix/actiontext module
#1264
Open
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.
Depends on #1263
Proposal
In an effort to absorb responsibilities from
@rails/actiontext(namelythe app/javascript/actiontext/index.js and
app/javascript/actiontext/attachment_upload.js files), this commit
introduces a new
trix/actiontextfile that the build process willoutput to be consumable from the
action_text-trixengine's assetdirectory.
The
trix/actiontextmodule will depend on two in-browser dependencies:trixexpected to be imported separately@rails/activestorageexpected to available for import. Since thereis a direct dependency on
@rails/activestoragethrough the@rails/acitontextpackage, the dependency will dependably (😉) bepresent.
In support of this change, this commit also expands the system test
coverage introduced by #1258 to also account for
direct-upload:-prefixed events dispatched during file uploads.Release strategy
This change should not be part of a release until the corresponding event listener in app/javascript/actiontext/index.js (as part of
rails/rails) is removed.I defer on the rest of the maintenance team to coordinate the switch with the
rails/railsmaintenance team. I suggest that this package introduce the change and rails/rails add conditional logic or guidance to include constraints on the package version, rather than the other way around. I suspect that this package is more regularly release and has more flexibility than its upstream counterpart.Once introduced, this
trix/actiontextmodule (and the correspondingtest/system/**/*_test.rbcoverage could serve as a replacement for CI's upstreamgit checkoutand code coverage.