Closed reeganviljoen closed 1 month ago
@Spone I have simplified the failing test with while keeping the same error
it seems strip_trailing_whitespace doesn't work with inline templates, I have created a fix locally that seem to work, I will push it up latter
Awesome, that's really useful!
@Spone I have updated the description, to reflect the actual bug, I then also fixed the test and have added the fix for the bug
@Spone I write a benchmark by rewriting the old performance inline_componet on a new component and testing that, it seems this is actually faster by a small margin see the description for more details
closes #2013
What are you trying to accomplish?
Inline components throws
when strip_trailing_whitespace is used, so this is an attempt to make
strip_trailing_whitespace
behave in inline components as they do for normal componentsWhat approach did you choose and why?
I removed
template.rstrip! if component_class.strip_trailing_whitespace?
as the template object is aViewComponent::InlineTemplate::Template
and not a string I then addedtemplate = template.source.dup
so tat the template string could be unfrozen for compile_template to remove the trailing white spacePerformance Imapct
before change
After