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

Allow context to be set via call #821

Merged
merged 1 commit into from
Nov 25, 2024
Merged

Allow context to be set via call #821

merged 1 commit into from
Nov 25, 2024

Conversation

willcosgrove
Copy link
Contributor

This PR is doing more than one thing 🙈

If you want me to split this up, let me know. But in addition to allowing context to be passed via call, I've also moved where view_context is stored. It's now inside of the Phlex::Context instead of in an ivar of SGML.

I think that ultimately, view_context as a concept can be fully removed from Phlex, and only defined in phlex-rails which is the only place it gets used. But as I went down that path the changes got more and more complicated. phlex-rails then needs to redefine call, which means it needs to be tightly coupled to phlex's definition of call... it got messy.

Let me know what you think, and if you want me to leave @_view_context alone, that's fine too. I'll open a sibling PR over on phlex-rails to coincide with this change.

willcosgrove added a commit to phlex-ruby/phlex-rails that referenced this pull request Nov 9, 2024
@joeldrapper joeldrapper merged commit 960ad5a into main Nov 25, 2024
4 of 5 checks passed
@joeldrapper joeldrapper deleted the call-with-context branch November 25, 2024 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants