Skip to content

Allow PyScript to fully run locally #1805

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 1 commit into from
Oct 20, 2023
Merged

Allow PyScript to fully run locally #1805

merged 1 commit into from
Oct 20, 2023

Conversation

WebReflection
Copy link
Contributor

Description

As @fpliger currently spotted, it's harder than it should to run PyScript project offline because we reach the CDN for the optional toml parser.

This MR moves that file locally so that we can use the dist folder to load on demand that library as opposite of needing the CDN.

Changes

  • curl the toml.js file into pyscript.core/src/ folder
  • exclude such file from the pre-commit hooks
  • verify the file is indeed part of the dist folder
  • since we're here ... updated polyscript to latest as there are various fixes in both coincident and polyscript that recently landed

Checklist

  • All tests pass locally
  • I have updated docs/changelog.md
  • I have created documentation for this(if applicable)

@@ -0,0 +1,4 @@
// https://cdn.jsdelivr.net/npm/@webreflection/toml-j0.4/toml.js
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there value in noting the specific release of toml-j0.4 here, just in case we (you) ever do an update/release of that project and we want to be able to tell which version is included here? 1.1.3 it lookslike?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK nobody is planning to maintain or change that project so I might indeed jut create yet another automated artifact that grabs that from latest version (expected to be always the same) and place it in the src folder before building it.

Or maybe I can just add it as npm dependency and still automate that process ... this actually might be the best way to go:

  • the version is embedded in the package.json
  • the automation simply reflects that

Good hint!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Contributor

@JeffersGlass JeffersGlass left a comment

Choose a reason for hiding this comment

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

One comment about possibly adding a version number; otherwise Looks Good to Me!

@WebReflection WebReflection merged commit 6dd242f into pyscript:main Oct 20, 2023
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