René's URL Explorer Experiment


Title: perf(core): cache CSS media query results until their inputs change by triniwiz · Pull Request #11505 · NativeScript/NativeScript · GitHub

Open Graph Title: perf(core): cache CSS media query results until their inputs change by triniwiz · Pull Request #11505 · NativeScript/NativeScript

X Title: perf(core): cache CSS media query results until their inputs change by triniwiz · Pull Request #11505 · NativeScript/NativeScript

Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. You have signed the CLA. All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application. Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md. What is the current behavior? CSS matching evaluates every @media block for every view it matches. Each evaluation reads Screen.mainScreen width and height (on iOS, two native reads each), fetches the application orientation and appearance, and re-parses the query string. A stylesheet with media queries pays that once per view per query on every mount and restyle. What is the new behavior? Results are cached per query string. The inputs only change through the application, so the cache is cleared there, before CSS is re-applied: setOrientation (which also refreshes screen metrics) setSystemAppearance syncTraitsFromWindow, which seeds the first window's traits without going through the setters Clearing from event listeners would be too late: the application re-applies CSS before it raises orientationChanged and systemAppearanceChanged. matchMedia() and MediaQueryList change events still evaluate their query directly. A cache epoch (getMediaQueryEpoch) lets other caches derived from query results notice a change; #11506 uses it. The benchmark stylesheets have no @media rules, so this has no effect on the numbers in #11506, #11507 and #11510. The new spec shows the screen is read once per query until the cache is invalidated. Part of a series: #11505 (this), #11506 (stacked on this one), #11507, #11510.

Open Graph Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

X Description: PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...

Opengraph URL: https://github.com/NativeScript/NativeScript/pull/11505

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:531929ee-e905-306e-cd21-d9ef358b6441
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id85DA:395430:1697621:1DCD029:6B01304A
html-safe-nonce7d7a00bbad8610df2b3e492d8fad0cf22e92ccc16fa46db5d6f8936af457c4cf
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NURBOjM5NTQzMDoxNjk3NjIxOjFEQ0QwMjk6NkIwMTMwNEEiLCJ2aXNpdG9yX2lkIjoiNzMwNTMyODA1MTg2MzIzNjY4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc4fc0906e1bf4ccabab74f5c114933c4e47434cb98f60c2dc526a97ae53c98bf
hovercard-subject-tagpull_request:4752619222
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/NativeScript/pull/11505/files
twitter:imagehttps://avatars.githubusercontent.com/u/6695919?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/6695919?s=400&v=4
og:image:altPR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id31492490
octolytics-dimension-repository_nwoNativeScript/NativeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31492490
octolytics-dimension-repository_network_root_nwoNativeScript/NativeScript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/NativeScript/NativeScript/pull/11505/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11505%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2FNativeScript%2Fpull%2F11505%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2FNativeScript
Reloadhttps://github.com/NativeScript/NativeScript/pull/11505/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11505/files
Reloadhttps://github.com/NativeScript/NativeScript/pull/11505/files
NativeScripthttps://github.com/NativeScript
NativeScripthttps://github.com/NativeScript/NativeScript
Codehttps://github.com/NativeScript/NativeScript
Issues231 (231)https://github.com/NativeScript/NativeScript/issues
Pull requests107 (107)https://github.com/NativeScript/NativeScript/pulls
Discussionshttps://github.com/NativeScript/NativeScript/discussions
Actionshttps://github.com/NativeScript/NativeScript/actions
Projectshttps://github.com/NativeScript/NativeScript/projects
Wikihttps://github.com/NativeScript/NativeScript/wiki
Security and qualityhttps://github.com/NativeScript/NativeScript/security
Insightshttps://github.com/NativeScript/NativeScript/insights
Sign up for GitHub https://github.com/signup?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FNativeScript%2FNativeScript%2Fissues%2Fnew%2Fchoose
triniwizhttps://github.com/triniwiz
mainhttps://github.com/NativeScript/NativeScript/tree/main
perf/css-media-query-cachehttps://github.com/NativeScript/NativeScript/tree/perf/css-media-query-cache
Conversation 3 https://github.com/NativeScript/NativeScript/pull/11505
Commits 2 https://github.com/NativeScript/NativeScript/pull/11505/commits
Checks 8 https://github.com/NativeScript/NativeScript/pull/11505/checks
Files changed https://github.com/NativeScript/NativeScript/pull/11505/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11505/files
perf(core): cache CSS media query results until their inputs change https://github.com/NativeScript/NativeScript/pull/11505/files#top
Show all changes 2 commits https://github.com/NativeScript/NativeScript/pull/11505/files
d586c4f perf(core): cache CSS media query results until their inputs change triniwiz Oct 6, 2026 https://github.com/NativeScript/NativeScript/pull/11505/commits/d586c4f088f9d2e9290f7f21628b2b3667ffc555
ef2411b fix(core): invalidate cached media query results when the screen size… NathanWalker Oct 6, 2026 https://github.com/NativeScript/NativeScript/pull/11505/commits/ef2411b0917b36c50cbf1e51da6a4547d01f0d7f
Clear filters https://github.com/NativeScript/NativeScript/pull/11505/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11505/files
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11505/files
application-common.ts https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
index.spec.ts https://github.com/NativeScript/NativeScript/pull/11505/files#diff-c5ea57a69d525b2ee4a352129ed7d83b1eb7c9f5e81be0b6a8c00ec2ec28dd3b
index.ts https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1ec7e15bd44f67f6c121c96737065e72441ea93e6753117485a78ba58894c76d
css-selector.ts https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
packages/core/application/application-common.tshttps://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
View file https://github.com/NativeScript/NativeScript/blob/ef2411b0917b36c50cbf1e51da6a4547d01f0d7f/packages/core/application/application-common.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11505/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-74dd81a44a15a91a76f316f55634e635f829da2ae2d8df02fceea55958bae881
packages/core/media-query-list/index.spec.tshttps://github.com/NativeScript/NativeScript/pull/11505/files#diff-c5ea57a69d525b2ee4a352129ed7d83b1eb7c9f5e81be0b6a8c00ec2ec28dd3b
View file https://github.com/NativeScript/NativeScript/blob/ef2411b0917b36c50cbf1e51da6a4547d01f0d7f/packages/core/media-query-list/index.spec.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11505/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-c5ea57a69d525b2ee4a352129ed7d83b1eb7c9f5e81be0b6a8c00ec2ec28dd3b
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-c5ea57a69d525b2ee4a352129ed7d83b1eb7c9f5e81be0b6a8c00ec2ec28dd3b
packages/core/media-query-list/index.tshttps://github.com/NativeScript/NativeScript/pull/11505/files#diff-1ec7e15bd44f67f6c121c96737065e72441ea93e6753117485a78ba58894c76d
View file https://github.com/NativeScript/NativeScript/blob/ef2411b0917b36c50cbf1e51da6a4547d01f0d7f/packages/core/media-query-list/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11505/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1ec7e15bd44f67f6c121c96737065e72441ea93e6753117485a78ba58894c76d
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1ec7e15bd44f67f6c121c96737065e72441ea93e6753117485a78ba58894c76d
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1ec7e15bd44f67f6c121c96737065e72441ea93e6753117485a78ba58894c76d
packages/core/ui/styling/css-selector.tshttps://github.com/NativeScript/NativeScript/pull/11505/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
View file https://github.com/NativeScript/NativeScript/blob/ef2411b0917b36c50cbf1e51da6a4547d01f0d7f/packages/core/ui/styling/css-selector.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/NativeScript/pull/11505/{{ revealButtonHref }}
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
https://github.com/NativeScript/NativeScript/pull/11505/files#diff-1f27f906b14ae2bb91cc3944e13b38bfacef5539cd7d3cedb6c8bf6624e3081c
Please reload this pagehttps://github.com/NativeScript/NativeScript/pull/11505/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.