Skip to content

Migrate beacon to dom #564

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

Merged
merged 2 commits into from
Sep 6, 2021
Merged

Migrate beacon to dom #564

merged 2 commits into from
Sep 6, 2021

Conversation

armanbilge
Copy link
Member

Towards #545. Tried my hand at this but kind of tricky to do while maintaining source compatibility, let me know what you think, thanks!

@armanbilge armanbilge requested a review from japgolly September 6, 2021 03:00
@armanbilge armanbilge requested a review from japgolly September 6, 2021 03:45
Copy link
Contributor

@japgolly japgolly left a comment

Choose a reason for hiding this comment

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

Looks great!!

@armanbilge armanbilge merged commit 432af50 into master Sep 6, 2021
@armanbilge armanbilge deleted the topic/migrate-beacon branch September 6, 2021 03:51
@armanbilge
Copy link
Member Author

Thanks! Hopefully got the hang of it, going to try and slowly slog away at #545. Not looking forward to the big ones... (ahem crypto..)

@japgolly
Copy link
Contributor

japgolly commented Sep 6, 2021

Yeah I know, I appreciate the slog through tedium hehe and I'll be joining you soon I promise 😆

@armanbilge
Copy link
Member Author

Haha can't scalafix us out of this one eh? 😛

* @param data
* The data parameter is the ArrayBufferView, Blob, DOMString, or FormData data that is to be transmitted.
*/
def sendBeacon(url: String, data: dom.BodyInit = null): Boolean = js.native
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 be much simpler and cleaner to directly integrate this method in Navigator instead of using those implicit conversions. See for example d7933f9 where I did this for the Vibration API.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point! I guess the reason they were separated before was to quarantine the experimental methods?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that was it. But now it doesn't make sense anymore, and it just obscures the API.

@japgolly
Copy link
Contributor

japgolly commented Sep 6, 2021

Haha can't scalafix us out of this one eh? 😛

Lol I'm literally considering it hahahaha

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

Successfully merging this pull request may close these issues.

3 participants