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 notes about ignored paths (related to hotwired/turbo#1070) #152

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

Conversation

DaAwesomeP
Copy link

Please see hotwired/turbo#1070 for more info.

This reflects currently released behavior, so this is currently relevant despite of what changes may be in the pipeline.

cc @seanpdoyle

Copy link
Contributor

@brunoprietog brunoprietog left a comment

Choose a reason for hiding this comment

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

Thanks for documenting this.

However, paths ending in .htm, .html, .xhtml, and .php, are handled by Turbo. Also, you can include a . in the path, but you must make sure that the path ends with a /, like https://example.com/users/jason.json/.

@DaAwesomeP
Copy link
Author

However, paths ending in .htm, .html, .xhtml, and .php, are handled by Turbo. Also, you can include a . in the path, but you must make sure that the path ends with a /, like https://example.com/users/jason.json/.

Please confirm the following updated understanding:

A . character cannot appear in the last level of a path except for a file extension .htm, .html, .xhtml, or .php:

  • Handled: /mypath/messages.json/67
  • Handled: /mypath/messages.json/
  • Ignored: /mypath/messages.json
  • Ignored: /mypath/messages.67
  • Handled: /mypath/messages.php
  • Ignored: /mypath/messages.php.1
  • Handled: /messages.php
  • Ignored: /messages.67

@brunoprietog
Copy link
Contributor

Exactly

Copy link
Contributor

@brunoprietog brunoprietog left a comment

Choose a reason for hiding this comment

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

Now it's correct! I've just a minor comment


## Ignored Paths

Paths with a `.` in the last level of a path/URL will not be handled by Turbo unless they end in a file extension `.htm`, `.html`, `.xhtml`, or `.php`. Turbo will ignore forms and links that target these paths. For example, the following forms would be ignored:
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps here we could also explicitly say that if the URL ends in / it will be handled by Turbo. As it is now, if you don't notice the small detail of the final slash you wouldn't notice it. This would allow to put only 4 examples, 2 for those that are handled and 2 for those that aren't. Perhaps giving 4 examples for each case might be a bit excessive?

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