| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
… module, tests for it should be in the external repository from which this code is derived.
for more information, see https://pre-commit.ci
…ename certain internal things for readability and comprehension.
…ule substantially reducing it in size and complexity with only a few minor (edge) behavioural changes. Softly breaking changes include: - An element's classes are just a set. - An element's styles are just a dict. - Explicitly use `update_all` with ElementCollections (simpler and greater flexibility). - Extract a child element by id with `my_container["#an-id"]`
….py module. All code paths are exercised and checked.
…y all pass in a local browser.
…unt for the new named worker in the test HTML.
for more information, see https://pre-commit.ci
|
This PR is ready for review. My apologies for the size, but this relates to the nature of the changes taking place (lots of docs). So, some guidance for reviewers. My approachAs outlined at the start I had three aims:
The outcomeGiven these aims, for each of the sub-modules in the pyscript namespace I have completed the following tasks:
While the size of the code base has increased by a huge amount (just look at all those docs!) the mini-fied version delivered to the user (pyscript.js) is smaller, at 1k less than it was before. 🎉 Finally, there will be a complementary PR/branch in the docs repository for auto-generating our API docs from this source code. I'll reference it here once this work is ready to be reviewed. 👍 Softly breaking adjustmentsOur biggest module is (by far) pyscript.web. I have made significant changes to the source to save us hundreds of lines of code. As part of this refinement, and while the API is basically the same, I have had to make the following "softly breaking" adjustments to the module (i.e. functionally it's the same, but with some implementation changes):
That's it! Clearly some of this is opinionated, but I hope my way of working reveals why I've made the choices I have. Once this lands our API docs will be VASTLY improved, and we'll have a single source of truth for such technical documentation (i.e. it's a part of the context of the source code, as it should be). Finally, we've set an obvious and consistent precedent for code standards (small and simple with human-comprehensible names that will be minified), documentation (Markdown with examples) and tests (comprehensive, intentional and browser based). |
Sorry, something went wrong.
|
Related PR in the docs repostory: pyscript/docs#201 |
Sorry, something went wrong.
|
Now that I've got the docs automatically building via pyscript/docs#201 I need to revisit all the Markdown to adjust it so it renders properly in the context of the docs. |
Sorry, something went wrong.
…rated documentation (where triple quoted strings are used to document module attributes).
|
Markdown now renders nicely over in pyscript/docs#201. Side effect: I now know far too much about the mkdocstrings plugin. 🤦 |
Sorry, something went wrong.
|
@ntoll there are two main points to address but everything else looks good to me. I want this to land before the other because it looks like the one in docs just copies over these files so it'd be pointless to approve that one, even if the the automatic code generation looks fine, although it will need a rebase after changes happen in here and this gets merged, then eventually I can approve the other one too. |
Sorry, something went wrong.
|
OK... @WebReflection I've addressed your couple of points. If you're happy, I'm happy. 🚀 |
Sorry, something went wrong.
There was a problem hiding this comment.
thanks 🙏
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
This PR has several aims:
Already I've notice code that would never work in MicroPython (where dict ordering was implied in the code - but MicroPython's dicts don't guarantee order). More comprehensive and complete tests found this pretty quickly.
Changes
For each module in the pyscript namespace: docs, refactoring and tests have been accomplished (adjusted as work is completed):
Checklist