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 failing test for rendering turbo stream tags #1227

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

boardfish
Copy link
Collaborator

@boardfish boardfish commented Jan 3, 2022

Summary

Replicates #1137 with the aim of supporting #1106.

Other Information

I'm not sure how to get this test to pass. I've tried using helpers.tag.turbo_stream and helpers.tag.template too, but neither seems to change the output.

Desired output (whitespace formatted for readability):

<turbo-stream action="update" target="area1">
    <template>
        <span>Hello, world!</span>
    </template>
</turbo-stream>

Actual output (whitespace formatted for readability):

<span>Hello, world!</span>
<turbo-stream action="update" target="area1">
    <template>
        &lt;span&gt;Hello, world!&lt;/span&gt;
    </template>
</turbo-stream>

Regardless of whether helpers.tag.turbo_stream or turbo_stream.update is used, what seems to be happening is that the block that is received is concatenated to the view as normal, then done again without being marked as html_safe within the tags.

Implementation of the turbo_stream tag builder starts around here.This is the object returned by calling turbo_stream against the view.

@boardfish
Copy link
Collaborator Author

@boardfish boardfish commented Jan 3, 2022

Turbo doesn't support Rails < 6 - that seems to come right down to installation, since the builds are failing on dependencies. Was Appraisal ever added to our testing setup? I seem to remember seeing talk about it in another PR. I think that'd resolve this issue.

@Spone
Copy link
Collaborator

@Spone Spone commented Jan 3, 2022

Turbo doesn't support Rails < 6 - that seems to come right down to installation, since the builds are failing on dependencies. Was Appraisal ever added to our testing setup? I seem to remember seeing talk about it in another PR. I think that'd resolve this issue.

Yes this is still a work in progress here: #1225

Feel free to review :)

@Spone Spone mentioned this pull request Jan 4, 2022
@Spone
Copy link
Collaborator

@Spone Spone commented Jan 5, 2022

@boardfish #1225 is merged, you can rebase and add turbo as a conditional dependency!

@boardfish boardfish force-pushed the test-turbo-stream-rendering branch from 61cd18c to ad60f96 Compare Jan 5, 2022
@boardfish boardfish requested a review from Spone as a code owner Jan 5, 2022
@boardfish
Copy link
Collaborator Author

@boardfish boardfish commented Jan 5, 2022

@Spone I've tried to move things over to using Appraisal, but CI seems to be failing because it doesn't recognize turbo-rails as having been installed. I'm not having this problem locally when I run bundle exec appraisal install && bundle exec appraisal rake on a version that's compatible with turbo-rails (Ruby 3, rails-head). It doesn't look to me as though the tests are running via appraisal in CI, but I'm not confident around the source of the issue - would you be able to look into it?

@Spone
Copy link
Collaborator

@Spone Spone commented Feb 14, 2022

It doesn't look to me as though the tests are running via appraisal in CI, but I'm not confident around the source of the issue - would you be able to look into it?

I guess we will have to wait for #1230 (see this comment)

@github github deleted a comment from primer-css May 23, 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