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

Deferred static files #77

Merged
merged 37 commits into from
Jul 1, 2022
Merged

Conversation

Archmonger
Copy link
Contributor

@Archmonger Archmonger commented Jun 23, 2022

This PR adds a static_css component, which reads the CSS file's from disk, stores the contents in cache (for performance purposes), and then puts the file contents into a html.style tag.

Currently, IDOM has no real way to "wait for CSS to load". This will lead to visual jank when attempting to use html.link to defer load CSS loading until a certain component exists. For example, visual jank occurs when using

html.link({"rel": "stylesheet", "href": static("conreq/buttons.css")})

This also mitigates the need for the following (within Django only):

Changelog

  • Deferred static file components
  • Docs for deferred static files
  • Bump minimum IDOM version
  • Create PR templates
  • Sync issue form template with idom-team/idom
  • Pin selenium to 4.2 for compatibility
  • Bump django-idom to v1.1.0
  • Docstring for component template tag
  • Minor readme wordsmithing

docs/features/components.md Outdated Show resolved Hide resolved
src/django_idom/components.py Outdated Show resolved Hide resolved
@Archmonger Archmonger changed the title Static CSS component Static CSS and JS components Jun 23, 2022
@Archmonger
Copy link
Contributor Author

@rmorshea This PR is still a draft, I have a bit more to work on.

I will mark as "Ready for review" when complete.

@Archmonger Archmonger marked this pull request as ready for review June 24, 2022 00:58
@Archmonger Archmonger requested a review from rmorshea June 24, 2022 00:58
@Archmonger Archmonger linked an issue Jun 24, 2022 that may be closed by this pull request
@Archmonger Archmonger changed the title Static CSS and JS components Deferred static files Jun 24, 2022
@Archmonger
Copy link
Contributor Author

@rmorshea Would you have time to review this weekend?

@rmorshea
Copy link
Contributor

I'll try to get to this today or tomorrow.

@Archmonger Archmonger mentioned this pull request Jun 29, 2022
3 tasks
@rmorshea
Copy link
Contributor

apologies. i will make time tomorrow

Copy link
Contributor

@rmorshea rmorshea left a comment

Choose a reason for hiding this comment

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

Just a few minor things here and there. Besides that, LGTM!

docs/features/components.md Outdated Show resolved Hide resolved
.github/ISSUE_TEMPLATE/issue-form.yml Outdated Show resolved Hide resolved
src/django_idom/components.py Show resolved Hide resolved
tests/test_app/static/static-css-test.css Outdated Show resolved Hide resolved
tests/test_app/static/static-js-test.js Outdated Show resolved Hide resolved
@Archmonger
Copy link
Contributor Author

Can't merge without re-approval.

@Archmonger Archmonger merged commit 18a419f into reactive-python:main Jul 1, 2022
@Archmonger Archmonger deleted the static-css branch July 1, 2022 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Welcome Message" CI Workflow
2 participants