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

Remove partial shorthand _p and deprecate p #39

Merged

Conversation

kaspth
Copy link
Contributor

@kaspth kaspth commented Jul 3, 2022

Fixes #36

By default the deprecator logs to the console, put for ferreting errant p calls in CI, users could swap to raising:

NicePartials::DEPRECATOR.behavior = :raise

@@ -24,12 +24,19 @@ def with_nice_partials_t_prefix(lookup_context, block)
end
end

require "active_support/deprecation"
NicePartials::DEPRECATOR = ActiveSupport::Deprecation.new("1.0", "nice_partials")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andrewculver not sure what version number we want in here, could be something in the 0.x range too. Your pick 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

1.0 is good. That’s where we’re heading for sure.

kaspth added a commit that referenced this pull request Jul 3, 2022
@kaspth
Copy link
Contributor Author

kaspth commented Jul 3, 2022

Looks like the backtrace is getting tripped up DEPRECATION WARNING: p is deprecated and will be removed from nice_partials 1.0 (use partial instead) (called from block in capture at /home/circleci/project/lib/nice_partials/monkey_patch.rb:5)

I'll give it one shot and then just recommend swapping to :raise like above.

@kaspth kaspth force-pushed the remove-partial-shorthands branch from e304d9c to f281083 Compare July 3, 2022 12:14
@kaspth
Copy link
Contributor Author

kaspth commented Jul 3, 2022

Meh, can't figure out and it might be something with an interaction in the depending libraries that real apps might not see.

@andrewculver andrewculver merged commit f60021e into features/partial-instead-of-p Jul 4, 2022
@andrewculver andrewculver deleted the remove-partial-shorthands branch July 4, 2022 13:47
kaspth added a commit that referenced this pull request Jul 4, 2022
* Rename `content` to `partial`

Fixes #36

We're keeping the `_p` and `p` for now, to decide on separately.

* Remove `partial` shorthand `_p` and deprecate `p` (#39)

* Cut _p shorthand trial short by my own hands

* Deprecate p shorthand in favor of partial

Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>
kaspth added a commit that referenced this pull request Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants