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

Render templates directly for JS responses #133

Closed
jaryl opened this issue Apr 30, 2019 · 3 comments
Closed

Render templates directly for JS responses #133

jaryl opened this issue Apr 30, 2019 · 3 comments

Comments

@jaryl
Copy link

jaryl commented Apr 30, 2019

On a legacy codebase, I would like to spit out tracking code with a JavaScript response. However, rack tracker does not conveniently expose the templates for rendering such responses.

At present, I am pushing the params I need to the session in order for rack-tracker to pick up on the next request. However, there is no guarantee that the user will navigate to a next page, nor will all next-requests be a regular non-xhr request.

The closest issue I could find on this is here: #79

Also, I've looked through the code base a bit, but it seems like it would necessitate quite a lot of hacking to get right. Is there an easy way to pass the params I need to the relevant templates for rendering?

@DonSchado
Copy link
Collaborator

Currently not supported :/

@jclusso
Copy link

jclusso commented Mar 29, 2020

@DonSchado as I mentioned in #152, I really think this would be the best approach long term for solving the issue I essentially monkey patched. While it allows the tracker to eventually get called it seems like it would be far more ideal to have JS template support so that the tracker doesn't have to wait until the next HTML request.

Is there a reason this issue was closed? If it has to do with the time investment to update all of the templates then I completely understand.

What are your thoughts on code that sets up the ability for JS templates and the documentation could specify which trackers support JS and HTML. Then it could be left up to developers that need them to implement them over time.

@DonSchado
Copy link
Collaborator

@jclusso This would be a neat feature, definitely.
But at the moment I'm not using this gem in production at all... so that's maybe my main problem.

If you already have an idea how to achieve this, don't hesitate to prototype something and then we can discuss this further. :)

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

No branches or pull requests

3 participants