Defaulting to async for top-level await #2134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We have been discussing about making our code always asynchronous so that there are less attributes to type, latest named workers would work out of the box and so it would the storage. The amount of things that need
async
attribute is just growing so it's about the time to just make it work while keeping it simpler than before.The previously used
async
attribute won't be affected by this change while scripts that needs to be synchronous can now useasync="false"
... wherefalse
can be also0
orno
orFalse
.This MR has been published already as
@pyscript/core@next
on npm so it's possible to test it already via the following URLs:https://cdn.jsdelivr.net/npm/@pyscript/core@next/dist/core.js
https://cdn.jsdelivr.net/npm/@pyscript/core@next/dist/core.css
It would be lovely to understand if current projects based on PyScript default sync behavior would have any issue here ... /cc @ntoll @mchilvers @laffra @JeffersGlass
Changes
Checklist
CHANGELOG.md