Skip to content

Commit

Permalink
Make Action Text + Trix JS/CSS available via the asset pipeline (#42857)
Browse files Browse the repository at this point in the history
* Action Text JS should be available via the asset pipeline too

* Main was a module anyway, no need to reference that twice

* Fix rollup references

* Precompile action text JS for asset pipeline

* No JavaScript dependencies needed with the asset pipeline

* Stub Webpacker::Engine to trigger webpack path for testing

* Extract asset paths

* Exercise asset pipeline path

* Terser doesn't do anything useful on this small package

* Make trix directly available to the asset pipeline

* Indirect doesn't carry its worth

* Reminder for development about keeping things in sync for the asset pipeline

* Ensure this isn't turned into undefined while mirroring

* Mirror Trix CSS for asset pipeline

* Add the needed JS include tag automatically under the asset pipeline

* Please RuboCop

* Keep the peer dependency

Even though we also need it explicitly as a dev dependency in order to generate the mirror output for trix.

* Fix test

* Add CHANGELOG entry
  • Loading branch information
dhh committed Jul 26, 2021
1 parent e9ed237 commit 9c73d4a
Show file tree
Hide file tree
Showing 12 changed files with 1,517 additions and 23 deletions.
4 changes: 4 additions & 0 deletions actiontext/CHANGELOG.md
@@ -1,3 +1,7 @@
* Make the Action Text + Trix JavaScript and CSS available through the asset pipeline.

*DHH*

* OpenSSL constants are now used for Digest computations.

*Dirkjan Bussink*
Expand Down
4 changes: 4 additions & 0 deletions actiontext/README.md
Expand Up @@ -4,6 +4,10 @@ Action Text brings rich text content and editing to Rails. It includes the [Trix

You can read more about Action Text in the [Action Text Overview](https://edgeguides.rubyonrails.org/action_text_overview.html) guide.

## Development

The JavaScript for Action Text is distributed both as a npm module under @rails/actiontext and via the asset pipeline as action_text.js (and we mirror Trix as trix.js). To ensure that the latter remains in sync, you must run `yarn build` and checkin the artifacts whenever the JavaScript source or the Trix dependency is bumped. CSS changes must be brought over manually to app/assets/stylesheets/trix.css

## License

Action Text is released under the [MIT License](https://opensource.org/licenses/MIT).

0 comments on commit 9c73d4a

Please sign in to comment.