Skip to content

Conversation

@PixelDust22
Copy link
Contributor

This PR does three things:

  • Use URLSearchParams for extra query params
  • Use window.open for Get Started button on the demo header, so we retrieve the email field from local storage when you click the button, instead of at page load time. This will not trigger the popup button blocker because it is triggered by an user event.
  • Make sure that the docs / request demo / signup pages are opened in a new window.

@PixelDust22 PixelDust22 requested a review from scefali October 27, 2021 23:06
@PixelDust22 PixelDust22 requested a review from a team as a code owner October 27, 2021 23:06
@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2021

size-limit report

Path Base Size (10381e3) Current Size Change
src/sentry/static/sentry/dist/entrypoints/app.js 52.74 KB 52.75 KB +0.02% 🔺
src/sentry/static/sentry/dist/entrypoints/sentry.css 70.89 KB 70.89 KB 0%

Copy link
Contributor

Choose a reason for hiding this comment

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

@Neo-Zhixing It would be nice to keep that as a link but doing that would require us to make a HoC that listens for local storage changes and re-renders the child when that happens. Maybe too much work given the level of importance. But I'd still add a comment explaining why we are calling window.open this way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about listening to local storage changes but that requires us to replace localStorage.setItem which is a global change. Will add lots of maintenance overhead.

https://stackoverflow.com/questions/26974084/listen-for-changes-with-localstorage-on-the-same-window

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will add comment.

Copy link
Member

Choose a reason for hiding this comment

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

You can do this with a react hook, which I think we already do in some places

Copy link
Contributor

Choose a reason for hiding this comment

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

@evanpurkhiser and which hook is that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I also don't know if a hook works here when a different part of the app is updating the local storage. I think this hook only works when you're changing the session storage with the setState that the hook returns in that single component.

Copy link
Member

Choose a reason for hiding this comment

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

it would work if you have a state that is updated on localstorage change. You can use the storage event for that.

Copy link
Contributor

Choose a reason for hiding this comment

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

@evanpurkhiser

Note: This won't work on the same page that is making the changes — it is really a way for other pages on the domain using the storage to sync any changes that are made. Pages on other domains can't access the same storage objects.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

ew gross event. Yeah just do what you've got here. Or put it in reflux but 🤷

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants