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

tab_id accessor #506

Merged
merged 1 commit into from
May 19, 2021
Merged

tab_id accessor #506

merged 1 commit into from
May 19, 2021

Conversation

leastbad
Copy link
Contributor

Type of PR (feature, enhancement, bug fix, etc.)

Enhancement

Description

Reflex class gains a tab_id accessor to compliment reflex_id. It is a UUIDv4 that is generated every time SR is initialized, eg once per tab. Refreshes and different/duplicated tabs will have different values.

Part of the ClientAttributes struct.

Updated the generator template to reflect this new accessor.

Why should this be added

Sometimes, I really wish that I had a way of uniquely identifying the browser tab which made a request without having to pack it into a data attribute. It's especially significant for an upcoming gem I'm working on.

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing
  • This is not a documentation update

@leastbad leastbad added enhancement New feature or request proposal ruby Pull requests that update Ruby code javascript Pull requests that update Javascript code labels May 17, 2021
@leastbad leastbad added this to the 3.5 milestone May 17, 2021
Copy link
Member

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

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

Nice! This is handy and looks straightforward!

@leastbad leastbad merged commit cbbbfc1 into stimulusreflex:master May 19, 2021
@leastbad leastbad deleted the tab_id branch August 16, 2021 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code proposal ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants