René's URL Explorer Experiment


Title: feat(core): Redesign the afterRender & afterNextRender phases API by mmalerba · Pull Request #55648 · angular/angular · GitHub

Open Graph Title: feat(core): Redesign the afterRender & afterNextRender phases API by mmalerba · Pull Request #55648 · angular/angular

X Title: feat(core): Redesign the afterRender & afterNextRender phases API by mmalerba · Pull Request #55648 · angular/angular

Description: Previously afterRender and afterNextRender allowed the user to pass a phase to run the callback in as part of the AfterRenderOptions. This worked, but made it cumbersome to coordinate work between phases. let size: DOMRect|null = null; afterRender(() => { size = nativeEl.getBoundingClientRect(); }, {phase: AfterRenderPhase.EarlyRead}); afterRender(() => { otherNativeEl.style.width = size!.width + 'px'; }, {phase: AfterRenderPhase.Write}); This PR replaces the old phases API with a new one that allows passing a callback per phase in a single afterRender / afterNextRender call. The return value of each phase's callback is passed to the next phase callback that was part of the same afterRender call. afterRender({ earlyRead: () => nativeEl.getBoundingClientRect(), write: (rect) => { otherNativeEl.style.width = rect.width + 'px'; } }); This API also retains the ability to pass a single callback, which will be run in the mixedReadWrite phase. afterRender(() => { // read some stuff ... // write some stuff ... });

Open Graph Description: Previously afterRender and afterNextRender allowed the user to pass a phase to run the callback in as part of the AfterRenderOptions. This worked, but made it cumbersome to coordinate work between ...

X Description: Previously afterRender and afterNextRender allowed the user to pass a phase to run the callback in as part of the AfterRenderOptions. This worked, but made it cumbersome to coordinate work between ...

Opengraph URL: https://github.com/angular/angular/pull/55648

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:3123219d-b63c-b6b9-623b-1bb5d4a97df4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE1AC:2A7C1C:3B21F2:4E2807:6B0193FF
html-safe-nonce639b537576b98d23c7fdfb686fa458bebaed9e910e27f8caea4e7f9785ac0bf5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUFDOjJBN0MxQzozQjIxRjI6NEUyODA3OjZCMDE5M0ZGIiwidmlzaXRvcl9pZCI6IjcyNzU4OTQ0NjQ4OTAxMTUwNzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacef995ceead5010eb723b646fad03f5870b31655458c50f32bf9067f106171acc
hovercard-subject-tagpull_request:1852731101
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/angular/angular/pull/55648/files
twitter:imagehttps://avatars.githubusercontent.com/u/14793288?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/14793288?s=400&v=4
og:image:altPreviously afterRender and afterNextRender allowed the user to pass a phase to run the callback in as part of the AfterRenderOptions. This worked, but made it cumbersome to coordinate work between ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
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/angular/angular/pull/55648/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fpull%2F55648%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%2Fangular%2Fangular%2Fpull%2F55648%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=angular%2Fangular
Reloadhttps://github.com/angular/angular/pull/55648/files
Reloadhttps://github.com/angular/angular/pull/55648/files
Reloadhttps://github.com/angular/angular/pull/55648/files
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues836 (836)https://github.com/angular/angular/issues
Pull requests143 (143)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular%2Fissues%2Fnew%2Fchoose
mmalerbahttps://github.com/mmalerba
angular:mainhttps://github.com/angular/angular/tree/main
mmalerba:after-renderhttps://github.com/mmalerba/angular/tree/after-render
Conversation 31 https://github.com/angular/angular/pull/55648
Commits 3 https://github.com/angular/angular/pull/55648/commits
Checks 0 https://github.com/angular/angular/pull/55648/checks
Files changed https://github.com/angular/angular/pull/55648/files
Please reload this pagehttps://github.com/angular/angular/pull/55648/files
feat(core): Redesign the afterRender & afterNextRender phases API https://github.com/angular/angular/pull/55648/files#top
Show all changes 3 commits https://github.com/angular/angular/pull/55648/files
0b55e48 feat(core): Redesign the `afterRender` & `afterNextRender` phases API mmalerba May 3, 2024 https://github.com/angular/angular/pull/55648/commits/0b55e48cb279f259ec90a8d24e5a4ec87795c4fc
a58cb31 fix(core): Add back phase flag option as a deprecated API mmalerba Jun 4, 2024 https://github.com/angular/angular/pull/55648/commits/a58cb313d98b2f719491bac1b5e6f1071b4985e3
845dacb feat(core): Add a schematic to migrate afterRender phase flag mmalerba Jun 4, 2024 https://github.com/angular/angular/pull/55648/commits/845dacb5f098a773660422346585c129648c5f5f
Clear filters https://github.com/angular/angular/pull/55648/files
Please reload this pagehttps://github.com/angular/angular/pull/55648/files
Please reload this pagehttps://github.com/angular/angular/pull/55648/files
lifecycle.md https://github.com/angular/angular/pull/55648/files#diff-bd518cb7d9123f9c00ab37f0210641041125f7ac1702fb045cc1d09f7cde5200
index.api.md https://github.com/angular/angular/pull/55648/files#diff-a7621e4b50059e7a08c54943489143cc49e54a20c42f38e2dfa391465bca0ab9
BUILD.bazel https://github.com/angular/angular/pull/55648/files#diff-0237962d3d0f4090a0aadcb62f418e6484b60d0571265044c0d4ffc572ddf24a
migrations.json https://github.com/angular/angular/pull/55648/files#diff-f201313890b0b55a2e0a53275e2549e2df7d66dc7af2cd3c14fc098002f57ae6
BUILD.bazel https://github.com/angular/angular/pull/55648/files#diff-4863407d806dd685db573a3f2e72072e59fa7b8f9c3a86ba0da4dc73de90125d
index.ts https://github.com/angular/angular/pull/55648/files#diff-42dc5fdcfcb3fdcea4e154001b9e887034fb98c086a13c024f391e932cac47a0
migration.ts https://github.com/angular/angular/pull/55648/files#diff-d853b06b8fbbbce743aa49557df33f9b8b44d77316f5cd1f3d7e32daab65d980
BUILD.bazel https://github.com/angular/angular/pull/55648/files#diff-4e2dcd9f2e9053f3648d98963e144c747f86f8889e2904605e1896c09f0710aa
after_render_phase_spec.ts https://github.com/angular/angular/pull/55648/files#diff-75ae6e60aec1e4c227e9f917a328822d822f41f56ba96a517d1c3caf5c34334e
core.ts https://github.com/angular/angular/pull/55648/files#diff-f63fb32fca85d8e177d6400ce078818a4815b80ac7a3319b60d3507354890992
after_render_hooks.ts https://github.com/angular/angular/pull/55648/files#diff-7293241a2e6dc735506a3139f20e921671bc499476021d1a21c534a9ec0ca277
after_render_hook_spec.ts https://github.com/angular/angular/pull/55648/files#diff-ac931cbe8dc27e08d3d7e01a1515af7c3a383058513a064ef4659ca34fe5f543
adev/src/content/guide/components/lifecycle.mdhttps://github.com/angular/angular/pull/55648/files#diff-bd518cb7d9123f9c00ab37f0210641041125f7ac1702fb045cc1d09f7cde5200
View file https://github.com/mmalerba/angular/blob/845dacb5f098a773660422346585c129648c5f5f/adev/src/content/guide/components/lifecycle.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/55648/{{ revealButtonHref }}
https://github.com/angular/angular/pull/55648/files#diff-bd518cb7d9123f9c00ab37f0210641041125f7ac1702fb045cc1d09f7cde5200
https://github.com/angular/angular/pull/55648/files#diff-bd518cb7d9123f9c00ab37f0210641041125f7ac1702fb045cc1d09f7cde5200
https://github.com/angular/angular/pull/55648/files#diff-bd518cb7d9123f9c00ab37f0210641041125f7ac1702fb045cc1d09f7cde5200
goldens/public-api/core/index.api.mdhttps://github.com/angular/angular/pull/55648/files#diff-a7621e4b50059e7a08c54943489143cc49e54a20c42f38e2dfa391465bca0ab9
View file https://github.com/mmalerba/angular/blob/845dacb5f098a773660422346585c129648c5f5f/goldens/public-api/core/index.api.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/55648/{{ revealButtonHref }}
https://github.com/angular/angular/pull/55648/files#diff-a7621e4b50059e7a08c54943489143cc49e54a20c42f38e2dfa391465bca0ab9
https://github.com/angular/angular/pull/55648/files#diff-a7621e4b50059e7a08c54943489143cc49e54a20c42f38e2dfa391465bca0ab9
packages/core/schematics/BUILD.bazelhttps://github.com/angular/angular/pull/55648/files#diff-0237962d3d0f4090a0aadcb62f418e6484b60d0571265044c0d4ffc572ddf24a
View file https://github.com/mmalerba/angular/blob/845dacb5f098a773660422346585c129648c5f5f/packages/core/schematics/BUILD.bazel
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/55648/{{ revealButtonHref }}
https://github.com/angular/angular/pull/55648/files#diff-0237962d3d0f4090a0aadcb62f418e6484b60d0571265044c0d4ffc572ddf24a
https://github.com/angular/angular/pull/55648/files#diff-0237962d3d0f4090a0aadcb62f418e6484b60d0571265044c0d4ffc572ddf24a
packages/core/schematics/migrations.jsonhttps://github.com/angular/angular/pull/55648/files#diff-f201313890b0b55a2e0a53275e2549e2df7d66dc7af2cd3c14fc098002f57ae6
View file https://github.com/mmalerba/angular/blob/845dacb5f098a773660422346585c129648c5f5f/packages/core/schematics/migrations.json
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/55648/{{ revealButtonHref }}
https://github.com/angular/angular/pull/55648/files#diff-f201313890b0b55a2e0a53275e2549e2df7d66dc7af2cd3c14fc098002f57ae6
packages/core/schematics/migrations/after-render-phase/BUILD.bazelhttps://github.com/angular/angular/pull/55648/files#diff-4863407d806dd685db573a3f2e72072e59fa7b8f9c3a86ba0da4dc73de90125d
View file https://github.com/mmalerba/angular/blob/845dacb5f098a773660422346585c129648c5f5f/packages/core/schematics/migrations/after-render-phase/BUILD.bazel
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/55648/{{ revealButtonHref }}
packages/core/schematics/migrations/after-render-phase/index.tshttps://github.com/angular/angular/pull/55648/files#diff-42dc5fdcfcb3fdcea4e154001b9e887034fb98c086a13c024f391e932cac47a0
View file https://github.com/mmalerba/angular/blob/845dacb5f098a773660422346585c129648c5f5f/packages/core/schematics/migrations/after-render-phase/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/55648/{{ revealButtonHref }}
packages/core/schematics/migrations/after-render-phase/migration.tshttps://github.com/angular/angular/pull/55648/files#diff-d853b06b8fbbbce743aa49557df33f9b8b44d77316f5cd1f3d7e32daab65d980
View file https://github.com/mmalerba/angular/blob/845dacb5f098a773660422346585c129648c5f5f/packages/core/schematics/migrations/after-render-phase/migration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/55648/{{ revealButtonHref }}
packages/core/schematics/test/BUILD.bazelhttps://github.com/angular/angular/pull/55648/files#diff-4e2dcd9f2e9053f3648d98963e144c747f86f8889e2904605e1896c09f0710aa
View file https://github.com/mmalerba/angular/blob/845dacb5f098a773660422346585c129648c5f5f/packages/core/schematics/test/BUILD.bazel
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular/pull/55648/{{ revealButtonHref }}
https://github.com/angular/angular/pull/55648/files#diff-4e2dcd9f2e9053f3648d98963e144c747f86f8889e2904605e1896c09f0710aa
https://github.com/angular/angular/pull/55648/files#diff-4e2dcd9f2e9053f3648d98963e144c747f86f8889e2904605e1896c09f0710aa
Please reload this pagehttps://github.com/angular/angular/pull/55648/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.