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

fix(api/latica): allow PeerProxy create in Worker #983

Closed
wants to merge 1 commit into from

Conversation

chrisfarms
Copy link

what

removes window reference and ensure worker spawned with full URL to allow using socket:network api from a Worker

why

so that I can setup network connections from Worker context

note

⚠️ PR against next

Copy link

@JackPlaymint JackPlaymint left a comment

Choose a reason for hiding this comment

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

LGTM. I want to check my understanding here though: So this says that instead of creating a worker for the window, it creates it for the global object? And rather than using pathname from import.meta.url your specifically getting the href? I'm unclear on the difference there

@chrisfarms
Copy link
Author

LGTM. I want to check my understanding here though: So this says that instead of creating a worker for the window, it creates it for the global object? And rather than using pathname from import.meta.url your specifically getting the href? I'm unclear on the difference there

Read about globalThis here ... globalThis is sometimes the window, sometimes self, etc

"pathname" is relative, "href" is absolute ... worker's don't have a concept of relative, so needs to be absolute

@jwerle jwerle requested a review from heapwolf July 3, 2024 13:45
@jwerle jwerle added bug Something isn't working javascript An issue, discussion, or task related to the runtime javascript api An issue, task, or discussion related to public runtime APIs labels Jul 3, 2024
@jwerle
Copy link
Member

jwerle commented Aug 21, 2024

we fixed this in next and we actually handle relative paths for you in the Worker implementation :)

@jwerle jwerle closed this Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api An issue, task, or discussion related to public runtime APIs bug Something isn't working javascript An issue, discussion, or task related to the runtime javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants