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

Show warning if view_template method is not defined on Phlex class #828

Merged

Conversation

marcoroth
Copy link
Contributor

@marcoroth marcoroth commented Dec 12, 2024

I just upgraded Phlex to the latest 2.x rc in a Rails app and after bumping the phlex and phlex-rails versions the app would boot, the pages would render but all components would just render out as empty strings, since none of the components defined the new view_template method.

This pull request adds a warning to the rendered component output so that you know what's going on when you are upgrading.

Feel free to close this pull request if you feel like there's no place for this in Phlex.

@marcoroth
Copy link
Contributor Author

marcoroth commented Dec 12, 2024

FWIW, looks like the RuboCop config is broken (also happens on main):

Output
❯ bundle exec rubocop -A
Error: unrecognized cop or department Lint/DuplicateMatchPattern found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Lint/DuplicateBranch`?
unrecognized cop or department Lint/ItWithoutArgumentsInBlock found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Lint/LambdaWithoutLiteralBlock`?
unrecognized cop or department Lint/LiteralAssignmentInCondition found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Lint/AssignmentInCondition`?
unrecognized cop or department Lint/RedundantRegexpQuantifiers found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Lint/RedundantCopEnableDirective`?
unrecognized cop or department Style/ComparableClamp found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/Sample`?
unrecognized cop or department Style/DirEmpty found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/Strip`?
unrecognized cop or department Style/ExactRegexpMatch found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/RedundantRegexpCharacterClass`?
unrecognized cop or department Style/RedundantArrayConstructor found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/RedundantEach`?
unrecognized cop or department Style/RedundantCurrentDirectoryInPath found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/RedundantConditional`?
unrecognized cop or department Style/RedundantFilterChain found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/RedundantInterpolation`?
unrecognized cop or department Style/RedundantHeredocDelimiterQuotes found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/RedundantFileExtensionInRequire`?
unrecognized cop or department Style/RedundantLineContinuation found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/RedundantCondition`?
unrecognized cop or department Style/RedundantRegexpArgument found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/RedundantRegexpEscape`, `Style/RedundantArgument`, `Style/RedundantSelfAssignment`?
unrecognized cop or department Style/RedundantRegexpConstructor found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/RedundantRegexpEscape`?
unrecognized cop or department Style/SendWithLiteralMethodName found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/TrailingMethodEndStatement`?
unrecognized cop or department Style/SingleLineDoEndBlock found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/SingleLineMethods`?
unrecognized cop or department Style/SuperArguments found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/PerlBackrefs`?
unrecognized cop or department Style/SuperWithArgsParentheses found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/DefWithParentheses`?
unrecognized cop or department Style/YAMLFileRead found in .rubocop-https---www-goodcop-style-base-yml
Did you mean `Style/FileRead`?

@joeldrapper joeldrapper merged commit 3617dac into phlex-ruby:main Dec 12, 2024
10 of 11 checks passed
@joeldrapper
Copy link
Collaborator

Thank you @marcoroth 🙏

@marcoroth marcoroth deleted the add-warning-if-view-template-is-missing branch December 12, 2024 18:31
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