8000 Updating polyscript to its latest by WebReflection · Pull Request #2128 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

Updating polyscript to its latest #2128

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 4 commits into from
Jul 29, 2024

Conversation

WebReflection
Copy link
Contributor
@WebReflection WebReflection commented Jul 24, 2024

This is currently published as 0.5.0-rc4 on npm:

  • JS https://cdn.jsdelivr.net/npm/@pyscript/core@next/dist/core.js
  • CSS https://cdn.jsdelivr.net/npm/@pyscript/core@next/dist/core.css

Documentation

pyscript/docs#134

Summary

The latest coincident is being tested to provide the following features:

  • faster than before in general
  • easier to maintain, debug, or reason about
  • SharedArrayBuffer are always on so "it just works" at least when it comes to async utilities (main invoking worker exposed utilities)
  • if a serviceWorker or service_worker url is passed as options / config, it eventually does fallback to sync XHR based exchanges that makes it still possible to use window or document from workers, even if headers required to enabled native SharedArrayBuffer are nowhere in the project, thanks to sabayon helper
  • logic has been improved via js-proxy too, which makes the whole dance way more elegant and less error prone, granting correct types all over

The current polyscript@next also has been improved to both use latest coincident and simplify the bootstrap logic, providing better ways to also understand when window or document cannot be used, printing better / more meaningful errors too.

The concept here is that as long as you don't try to use window or document, you don't need to care about SharedArrayBuffer so that general DX should hopefully be better now.

Literally nothing that was working before should break now, quite the opposite, it should be eventually slightly faster with more fine-tuned memory leaks prevention thanks to underlying libraries updates and the communication channel between multiple workers have been improved too.

@WebReflection WebReflection force-pushed the polyscript-next branch 3 times, most recently from 30d99b2 to 4a08e77 Compare July 24, 2024 15:07
@WebReflection
Copy link
Contributor Author

@mchilvers FYI all issues around SAB and named workers are automatically resolved by this latest version. I have decided to use a console.warn to inform users window and document cannot be accessed if SAB is not there or just polyfilled without a ServiceWorker companion, but everything else seems to work without issues ... if you could give this a try, it'd be awesome, thank you!

@WebReflection WebReflection force-pushed the polyscript-next branch 2 times, most recently from 54c89a6 to fc1750f Compare July 25, 2024 08:02
@WebReflection WebReflection marked this pull request as ready for review July 29, 2024 09:43
@WebReflection WebReflection requested a review from ntoll July 29, 2024 11:09
Copy link
Member
@ntoll ntoll left a comment

Choose a reason for hiding this comment

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

A quick question about a hardcoded mpy..! But otherwise LGTM. 👍

@WebReflection WebReflection merged commit 8c46fca into pyscript:main Jul 29, 2024
2 checks passed
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.

2 participants
0