Skip to content
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

Add optional compatibility module for capture/form/turbo compatibility fixes #1650

Merged
merged 18 commits into from
Feb 3, 2023

Conversation

BlakeWilliams
Copy link
Contributor

@BlakeWilliams BlakeWilliams commented Feb 1, 2023

This adds an optional module, CaptureCompatibility which is meant to
monkey patch ActionView::Base so that forms, turbo frames, and
content_for, and other common Rails code works as-expected.

Close #1651, close #1384, close #1485, close #1099, close #241, close #1607, close #1137

This adds an optional module, `CaptureCompatibility` which is meant to
monkey patche `ActionView::Base` so that forms, turbo frames, and
content_for, and other common Rails code works as-expected.
@camertron camertron mentioned this pull request Feb 1, 2023
@BlakeWilliams BlakeWilliams marked this pull request as ready for review February 1, 2023 19:26
.github/workflows/ci.yml Outdated Show resolved Hide resolved
lib/view_component/capture_compatibility.rb Outdated Show resolved Hide resolved
docs/CHANGELOG.md Outdated Show resolved Hide resolved
@BlakeWilliams
Copy link
Contributor Author

Alright, got the matrix build working and validated it's running the compatibility tests because the capture_patch_enabled builds have no skipped tests.

@Spone
Copy link
Collaborator

Spone commented Feb 2, 2023

@BlakeWilliams I updated the description to mention all issues (I could find) that would be solved by this PR.

@BlakeWilliams
Copy link
Contributor Author

@Spone great idea, thanks for updating it!

Copy link
Member

@joelhawksley joelhawksley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎊 I'll be sure to mention asking for feedback on this when I publish the next RC changelog ❤️

It's not easy to add a test for this since HAML raises in this scenario
too.
@BlakeWilliams
Copy link
Contributor Author

Alright, I tested this module on GitHub locally, clicked around and it all worked as expected. I also ran the tests with the patch enabled and all is 🟢. That being said, this is still experimental so please validate that it works as expected in your own applications and report any bugs you run into (with reproducible examples, please).

@BlakeWilliams BlakeWilliams merged commit 067a5c2 into main Feb 3, 2023
@BlakeWilliams BlakeWilliams deleted the bmw/compat-module branch February 3, 2023 18:21
tmaier added a commit to tmaier/view_component that referenced this pull request Mar 7, 2023
joelhawksley added a commit that referenced this pull request Mar 8, 2023
…1674)

* Add capture_compatibility_patch_enabled as option

Related to #1650 and #1644

* Update CHANGELOG.md

* Update docs/known_issues.md

* Update docs/known_issues.md

* reorder item

* make test more flexible to account for change in rails main

---------

Co-authored-by: Joel Hawksley <[email protected]>
Co-authored-by: Joel Hawksley <[email protected]>
claudiob pushed a commit to claudiob/view_component that referenced this pull request Dec 22, 2023
…y fixes (ViewComponent#1650)

This adds an optional module, `CaptureCompatibility` which is meant to
monkey patch `ActionView::Base` so that forms, turbo frames, and
content_for, and other common Rails code works as-expected.
claudiob pushed a commit to claudiob/view_component that referenced this pull request Dec 22, 2023
…iewComponent#1674)

* Add capture_compatibility_patch_enabled as option

Related to ViewComponent#1650 and ViewComponent#1644

* Update CHANGELOG.md

* Update docs/known_issues.md

* Update docs/known_issues.md

* reorder item

* make test more flexible to account for change in rails main

---------

Co-authored-by: Joel Hawksley <[email protected]>
Co-authored-by: Joel Hawksley <[email protected]>
claudiob pushed a commit to claudiob/view_component that referenced this pull request Jan 3, 2024
…y fixes (ViewComponent#1650)

This adds an optional module, `CaptureCompatibility` which is meant to
monkey patch `ActionView::Base` so that forms, turbo frames, and
content_for, and other common Rails code works as-expected.
claudiob pushed a commit to claudiob/view_component that referenced this pull request Jan 3, 2024
…iewComponent#1674)

* Add capture_compatibility_patch_enabled as option

Related to ViewComponent#1650 and ViewComponent#1644

* Update CHANGELOG.md

* Update docs/known_issues.md

* Update docs/known_issues.md

* reorder item

* make test more flexible to account for change in rails main

---------

Co-authored-by: Joel Hawksley <[email protected]>
Co-authored-by: Joel Hawksley <[email protected]>
@sdhull
Copy link

sdhull commented Jan 4, 2024

Thank you for this!! Just blundered into this particular bug and was super stoked to find all I had to do was update the gem and enable the experimental mode 🎉

@marcelolx
Copy link

Thank you for this, everyone who was involved. You all rock!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants