René's URL Explorer Experiment


Title: ngcc: libraries using spread operator in object literals cannot be processed · Issue #34659 · angular/angular · GitHub

Open Graph Title: ngcc: libraries using spread operator in object literals cannot be processed · Issue #34659 · angular/angular

X Title: ngcc: libraries using spread operator in object literals cannot be processed · Issue #34659 · angular/angular

Description: Consider a library that uses a shared constant for host bindings. e.g. export const BASE_BINDINGS= { '[class.mat-themed]': '_isThemed', } ---- @Directive({ host: {...BASE_BINDINGS, '(click)': '...'} }) export class Dir1 {} @Directive({ h...

Open Graph Description: Consider a library that uses a shared constant for host bindings. e.g. export const BASE_BINDINGS= { '[class.mat-themed]': '_isThemed', } ---- @Directive({ host: {...BASE_BINDINGS, '(click)': '...'...

X Description: Consider a library that uses a shared constant for host bindings. e.g. export const BASE_BINDINGS= { '[class.mat-themed]': '_isThemed', } ---- @Directive({ host: {...BASE_BINDINGS, ...

Opengraph URL: https://github.com/angular/angular/issues/34659

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ngcc: libraries using spread operator in object literals cannot be processed","articleBody":"Consider a library that uses a shared constant for host bindings. e.g.\r\n\r\n```ts\r\nexport const BASE_BINDINGS= {\r\n  '[class.mat-themed]': '_isThemed',\r\n}\r\n\r\n----\r\n\r\n@Directive({\r\n  host: {...BASE_BINDINGS, '(click)': '...'}\r\n})\r\nexport class Dir1 {}\r\n\r\n@Directive({\r\n  host: {...BASE_BINDINGS, '(click)': '...'}\r\n})\r\nexport class Dir2 {}\r\n```\r\n\r\nPreviously when these components were shipped as part of the library to NPM, consumers were able to consume `Dir1` and `Dir2`. No errors showed up.\r\n\r\nNow with Ivy, when ngcc tries to process the library, an error will be thrown. The error is stating that the host bindings should be an object (which they obviously are). This happens because TypeScript transforms the object spread to individual `Object.assign` calls (for compatibility).\r\n\r\nThe partial evaluator used by the `@Directive` annotation handler is unable to process this expression because there is no integrated support for `Object.assign`. In View Engine, this was not a problem because the `metadata.json` files from the library were used to compute the host bindings.\r\n\r\n### Why should Object.assign work?\r\n\r\nCurrently ngtsc works with object spread operators. Just ngcc which runs into the transpiled `Object.assign` calls will not support object spreads. This results in inconsistent behavior.\r\n\r\nAlso, this previously worked in View Engine, so it would help avoiding a breaking change.\r\n\r\n\r\n### How could it be fixed?\r\n\r\nWe could add another `BuiltinFn` into the partial evaluator. It will be somewhat difficult to detect whether a expression with `Object.assign` is actually resolving to the default ES6 `Object.assign`.\r\n\r\nSince the default libs are disabled in the ngcc program, we cannot simply use the type checker. Joost had the idea of providing these types on our own in the program. That would make the detection easy and also work for ES5 files that rely on the `Object.assign` polyfill.","author":{"url":"https://github.com/devversion","@type":"Person","name":"devversion"},"datePublished":"2020-01-07T11:42:20Z","url":"https://github.com/angular/angular/issues/34659"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:818c56df-f45d-50e6-1f71-d8ee8d990aad
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCF0A:B79B3:44ECF2:5E5514:6AED551F
html-safe-nonce2a414de6e13e1c796bdac8bbead89a75f2db5bd51f8fa39164235c071d6655bc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjBBOkI3OUIzOjQ0RUNGMjo1RTU1MTQ6NkFFRDU1MUYiLCJ2aXNpdG9yX2lkIjoiMTk3ODMxOTA4NzE2NjM3OTI5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3afefa7074e59e0783f82a7cf7f05714ea5e5a26c43c8839f44f541cf547735d
hovercard-subject-tagissue:546238000
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/34659/issue_layout
twitter:imagehttps://opengraph.githubassets.com/24df8af2f5cd05ef8eba79514693e24c2aa66214d49f519300b3273823711bb4/angular/angular/issues/34659
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/24df8af2f5cd05ef8eba79514693e24c2aa66214d49f519300b3273823711bb4/angular/angular/issues/34659
og:image:altConsider a library that uses a shared constant for host bindings. e.g. export const BASE_BINDINGS= { '[class.mat-themed]': '_isThemed', } ---- @Directive({ host: {...BASE_BINDINGS, '(click)': '...'...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedevversion
hostnamegithub.com
expected-hostnamegithub.com
None56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/34659#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F34659
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%2Fissues%2F34659
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/34659
Reloadhttps://github.com/angular/angular/issues/34659
Reloadhttps://github.com/angular/angular/issues/34659
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues847 (847)https://github.com/angular/angular/issues
Pull requests180 (180)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 quality39 (39)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/pulse
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/34659
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/34659
ngcc: libraries using spread operator in object literals cannot be processedhttps://github.com/angular/angular/issues/34659#top
https://github.com/devversion
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/devversion
devversionhttps://github.com/devversion
on Jan 7, 2020https://github.com/angular/angular/issues/34659#issue-546238000
devversionhttps://github.com/devversion
severity5: ivy-compathttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22severity5%3A%20ivy-compat%22
on Jan 7, 2020https://github.com/angular/angular/issues/34659#event-2927351556
devversionhttps://github.com/devversion
v9-candidateshttps://github.com/angular/angular/milestone/89
on Jan 7, 2020https://github.com/angular/angular/issues/34659#event-2927351558
ngbothttps://github.com/apps/ngbot
v9-candidateshttps://github.com/angular/angular/milestone/89
on Jan 7, 2020https://github.com/angular/angular/issues/34659#event-2927351605
devversionhttps://github.com/devversion
on Jan 7, 2020https://github.com/angular/angular/issues/34659#event-2928592059
devversionhttps://github.com/devversion
comp: ngcchttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22comp%3A%20ngcc%22
on Jan 8, 2020https://github.com/angular/angular/issues/34659#event-2931321106
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Jan 8, 2020https://github.com/angular/angular/issues/34659#event-2931321220
JoostKhttps://github.com/JoostK
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
on Jan 21, 2020https://github.com/angular/angular/issues/34659#event-2965445027
devversionhttps://github.com/devversion
on Jan 23, 2020https://github.com/angular/angular/issues/34659#event-2972850016
fix(ngcc): libraries using spread in object literals cannot be processedhttps://github.com/devversion/angular/commit/59552cef78da90b40b06984f09f6225aff9700b2
https://docs.github.com/articles/closing-issues-via-commit-messages
59552cehttps://github.com/devversion/angular/commit/59552cef78da90b40b06984f09f6225aff9700b2
AndrewKushnirhttps://github.com/AndrewKushnir
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
6b468f9https://github.com/angular/angular/commit/6b468f9b2e4b99cd9e784c2515484bce47147476
on Jan 23, 2020https://github.com/angular/angular/issues/34659#event-2974796856
AndrewKushnirhttps://github.com/AndrewKushnir
on Jan 23, 2020https://github.com/angular/angular/issues/34659#event-2974797027
fix(ngcc): libraries using spread in object literals cannot be proces…https://github.com/angular/angular/commit/4eeb6cf24db74770eb0dc26e17e913e3f33ccaa3
https://docs.github.com/articles/closing-issues-via-commit-messages
4eeb6cfhttps://github.com/angular/angular/commit/4eeb6cf24db74770eb0dc26e17e913e3f33ccaa3
karahttps://github.com/kara
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
severity5: ivy-compathttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22severity5%3A%20ivy-compat%22
on Feb 11, 2020https://github.com/angular/angular/issues/34659#event-3024841575
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Mar 13, 2020https://github.com/angular/angular/issues/34659#issuecomment-598798743
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Mar 13, 2020https://github.com/angular/angular/issues/34659#event-3127335224
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/34659
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/34659
devversionhttps://github.com/devversion
regressionIndicates than the issue relates to something that worked in a previous versionhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22regression%22
state: has PRhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22state%3A%20has%20PR%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
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.