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

Page load improvements #2006

Merged
merged 1 commit into from
Jan 4, 2025
Merged

Page load improvements #2006

merged 1 commit into from
Jan 4, 2025

Conversation

liamcmitchell
Copy link
Contributor

Minor performance improvements and refactoring.

  • remove mix compile --force from asset build watch script
  • styling
    • set apple-os class in inline_html.js
    • remove non-apple-os class, replace with :not(.apple-os) selector
    • update isAppleOs() helper to query this class for source of truth
  • content
    • replace fixLinks() & .no-underline with CSS-only :has(code, img) selector
    • remove fixSpacebar(), there is no need to focus content to enable keybinds
    • inline and refactor setLivebookBadgeUrl() - the only remaining code
  • copy-button
    • optimise button HTML, remove unneeded attrs, replace span.sr-only with appropriate attrs on svg
    • replace .insertAdjacentHTML() with .cloneNode() (only parses HTML once)
    • implement array filters in query selectors
  • makeup
    • inline many things
    • implement mouseenter/leave callbacks in single function, no need for closures
    • only search parent for matching delimiters
  • search-bar
    • remove reading of window.scrollY on init, this forces layout and is not required
    • refactor logic
    • remove scrollThreshold of 70 px, looking at git history and PR comments, this is no longer needed
  • tooltips
    • inline HTML, no need for handlebars
    • inline a few functions
    • move filter logic into query selectors
    • remove need for closures in event handlers

Performance improvement is so minor, I can't record it reliably. JS is 0.8kb smaller.

Copy link

github-actions bot commented Jan 4, 2025

@josevalim josevalim merged commit 50f7876 into elixir-lang:main Jan 4, 2025
4 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@liamcmitchell liamcmitchell deleted the assets branch January 4, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants