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

Make the cable_server_path configurable #62

Merged
merged 3 commits into from
Jan 25, 2025

Conversation

codergeek121
Copy link
Contributor

This PR adds the option to make the cable_server path /hotwire-spark configurable. This could be used to fix #60. Apps that need to mount on a different path (e.g. because of relative_url_root, could just reconfigure the mount path for them)

It also fixes a circular dependency warning in main, by extracting a config.js file.

* Swap the meta-options and the script tag insertion in the middleware to avoid relying on DOMContentLoaded for setting the configuration values
* Introduce config.js to avoid a circular dependency (fixes a warning in rollup)
This allows users to reconfigure their mount path, e.g. to add a prefix to it. With this config, hotwired#60 could reconfigure the mount path to include the relative_url_root prefix.
Copy link
Member

@jorgemanrubia jorgemanrubia left a comment

Choose a reason for hiding this comment

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

Great one, thanks @codergeek121

@jorgemanrubia jorgemanrubia merged commit 5ac8698 into hotwired:main Jan 25, 2025
2 checks passed
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.

Relative url
2 participants