René's URL Explorer Experiment


Title: [Bug]: Order of constructor parameter properties vs class properties initializers - Discrepency between typescript and bable · Issue #13779 · babel/babel · GitHub

Open Graph Title: [Bug]: Order of constructor parameter properties vs class properties initializers - Discrepency between typescript and bable · Issue #13779 · babel/babel

X Title: [Bug]: Order of constructor parameter properties vs class properties initializers - Discrepency between typescript and bable · Issue #13779 · babel/babel

Description: 💻 Would you like to work on a fix? How are you using Babel? @rollup/plugin-babel Input code Original Code: class Dashboard { name = 'stats' + this.amount; constructor( readonly amount ) { } } Babel Emit: "use strict"; function _definePro...

Open Graph Description: 💻 Would you like to work on a fix? How are you using Babel? @rollup/plugin-babel Input code Original Code: class Dashboard { name = 'stats' + this.amount; constructor( readonly amount ) { } } Babel...

X Description: 💻 Would you like to work on a fix? How are you using Babel? @rollup/plugin-babel Input code Original Code: class Dashboard { name = 'stats' + this.amount; constructor( readonly amount ) { }...

Opengraph URL: https://github.com/babel/babel/issues/13779

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Order of constructor parameter properties vs class properties initializers - Discrepency between typescript and bable ","articleBody":"### 💻\n\n- [ ] Would you like to work on a fix?\n\n### How are you using Babel?\n\n@rollup/plugin-babel\n\n### Input code\n\nOriginal Code: \r\n\r\n```js\r\nclass Dashboard {\r\n    name = 'stats' + this.amount;\r\n\r\n    constructor(\r\n        readonly amount\r\n    ) { \r\n    }\r\n}\r\n```\r\n\r\nBabel Emit:\r\n\r\n```js\r\n\"use strict\";\r\n\r\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\r\n\r\nclass Dashboard {\r\n  constructor(amount) {\r\n    _defineProperty(this, \"name\", 'stats' + this.amount);\r\n\r\n    this.amount = amount;\r\n  }\r\n}\r\n```\r\n\r\nTypescript emits:\r\n\r\n```js\r\nclass Dashboard {\r\n    constructor(amount) {\r\n        this.amount = amount;\r\n        this.name = 'stats' + this.amount;\r\n    }\r\n}\r\n```\r\n\n\n### Configuration file name\n\nbabel.config.js\n\n### Configuration\n\nFor reproduction I've used the Babel online repl with Env stage 2 preset and Typescript preset. \r\n[link](https://babeljs.io/repl/#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.6&spec=false&loose=false&code_lz=MYGwhgzhAEAikAsBGB7MAnAJtA3gKGkOgDswBbAU2gF5oByCAFzEYjugGppGEBLCAHTkUAV2KMA3HgJFgKYk3QjgjFOgAUMokXQUwmeSACe0YWMZboASlzRLAXzz2gA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Creact%2Cstage-2%2Ctypescript&prettier=false&targets=&version=7.15.7&externalPlugins=&assumptions=%7B%7D)\r\n\r\nFor typescript reproduction I've used Typescript playground.\r\n[link](https://www.typescriptlang.org/play?ssl=9&ssc=2&pln=1&pc=1#code/MYGwhgzhAEAikAsBGB7MAnAJtA3gKGkOgDswBbAU2gF5oByCAFzEYjugGppGEBLCAHTkUAV2KMA3HgJFgKYk3QjgjFOgAUMokXQUwmeSACe0YWMYAuEiLJIK6ADRboASlzTtAXzyegA)\n\n### Current and expected behavior\n\nCurrent Behavior - Babel puts parameter properties in the constructor after class properties assignment. Typescript puts them before.\r\n\r\nExpected Behavior - Its a discrepancy. Not sure if Babel is the responsible or Typescript. Typescript behavior is more preferable to me because it makes writing shorter for me.\n\n### Environment\n\n- Babel - 7.15.7\r\n- Typescript - 4.4.2\n\n### Possible solution\n\nNot sure. I've found some issues talking about plugin orders but I'm not sure.\n\n### Additional context\n\n_No response_","author":{"url":"https://github.com/elpddev","@type":"Person","name":"elpddev"},"datePublished":"2021-09-21T09:30:24Z","url":"https://github.com/babel/babel/issues/13779"}

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:330dd88b-d8e7-5b6d-a7ef-63f91960caf9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE990:12F69A:144B49F:1A9E87C:6AED775E
html-safe-nonce2366e5a7c651a3c0380b2bb2e3c0f9938c72ff9b5578f51ec9f898fe5c7df3d8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTkwOjEyRjY5QToxNDRCNDlGOjFBOUU4N0M6NkFFRDc3NUUiLCJ2aXNpdG9yX2lkIjoiNTQyMDYyODc0ODA1MjI5NzU2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace2b113fe1f45265eb2ba64db448fbb8957efc73dd2ce5eb413be70bb7ebc40bc
hovercard-subject-tagissue:1002113189
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/babel/babel/13779/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8e6486a5fb9cbf630beb59a3b8923f1e60ded597159803983d453574a5ed9e6f/babel/babel/issues/13779
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8e6486a5fb9cbf630beb59a3b8923f1e60ded597159803983d453574a5ed9e6f/babel/babel/issues/13779
og:image:alt💻 Would you like to work on a fix? How are you using Babel? @rollup/plugin-babel Input code Original Code: class Dashboard { name = 'stats' + this.amount; constructor( readonly amount ) { } } Babel...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameelpddev
hostnamegithub.com
expected-hostnamegithub.com
None56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11
turbo-cache-controlno-preview
go-importgithub.com/babel/babel git https://github.com/babel/babel.git
octolytics-dimension-user_id9637642
octolytics-dimension-user_loginbabel
octolytics-dimension-repository_id24560307
octolytics-dimension-repository_nwobabel/babel
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24560307
octolytics-dimension-repository_network_root_nwobabel/babel
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/babel/babel/issues/13779#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbabel%2Fbabel%2Fissues%2F13779
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%2Fbabel%2Fbabel%2Fissues%2F13779
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=babel%2Fbabel
Reloadhttps://github.com/babel/babel/issues/13779
Reloadhttps://github.com/babel/babel/issues/13779
Reloadhttps://github.com/babel/babel/issues/13779
babelhttps://github.com/babel
babelhttps://github.com/babel/babel
Codehttps://github.com/babel/babel
Issues569 (569)https://github.com/babel/babel/issues
Pull requests187 (187)https://github.com/babel/babel/pulls
Discussionshttps://github.com/babel/babel/discussions
Actionshttps://github.com/babel/babel/actions
Projectshttps://github.com/babel/babel/projects
Security and quality4 (4)https://github.com/babel/babel/security
Insightshttps://github.com/babel/babel/pulse
https://github.com/babel/babel
New issuehttps://github.com/login?return_to=https://github.com/babel/babel/issues/13779
New issuehttps://github.com/login?return_to=https://github.com/babel/babel/issues/13779
[Bug]: Order of constructor parameter properties vs class properties initializers - Discrepency between typescript and bable https://github.com/babel/babel/issues/13779#top
i: needs triagehttps://github.com/babel/babel/issues?q=state%3Aopen%20label%3A%22i%3A%20needs%20triage%22
https://github.com/elpddev
elpddevhttps://github.com/elpddev
on Sep 21, 2021https://github.com/babel/babel/issues/13779#issue-1002113189
linkhttps://babeljs.io/repl/#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.6&spec=false&loose=false&code_lz=MYGwhgzhAEAikAsBGB7MAnAJtA3gKGkOgDswBbAU2gF5oByCAFzEYjugGppGEBLCAHTkUAV2KMA3HgJFgKYk3QjgjFOgAUMokXQUwmeSACe0YWMZboASlzRLAXzz2gA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Creact%2Cstage-2%2Ctypescript&prettier=false&targets=&version=7.15.7&externalPlugins=&assumptions=%7B%7D
linkhttps://www.typescriptlang.org/play?ssl=9&ssc=2&pln=1&pc=1#code/MYGwhgzhAEAikAsBGB7MAnAJtA3gKGkOgDswBbAU2gF5oByCAFzEYjugGppGEBLCAHTkUAV2KMA3HgJFgKYk3QjgjFOgAUMokXQUwmeSACe0YWMYAuEiLJIK6ADRboASlzTtAXzyegA
elpddevhttps://github.com/elpddev
i: needs triagehttps://github.com/babel/babel/issues?q=state%3Aopen%20label%3A%22i%3A%20needs%20triage%22
on Sep 21, 2021https://github.com/babel/babel/issues/13779#event-5334104777
https://github.com/babel-bot
babel-bothttps://github.com/babel-bot
on Sep 21, 2021https://github.com/babel/babel/issues/13779#issuecomment-923803140
@elpddevhttps://github.com/elpddev
Slack communityhttps://babeljs.slack.com
herehttps://slack.babeljs.io/
elpddevhttps://github.com/elpddev
on Sep 21, 2021https://github.com/babel/babel/issues/13779#event-5334115754
elpddevhttps://github.com/elpddev
on Sep 21, 2021https://github.com/babel/babel/issues/13779#event-5334116693
https://github.com/nicolo-ribaudo
nicolo-ribaudohttps://github.com/nicolo-ribaudo
on Sep 21, 2021https://github.com/babel/babel/issues/13779#issuecomment-923867982
https://github.com/fedeci
fedecihttps://github.com/fedeci
on Sep 21, 2021https://github.com/babel/babel/issues/13779#issuecomment-923877852
https://github.com/nicolo-ribaudo
nicolo-ribaudohttps://github.com/nicolo-ribaudo
on Sep 21, 2021https://github.com/babel/babel/issues/13779#issuecomment-923962138
https://github.com/forivall
forivallhttps://github.com/forivall
on Oct 26, 2021https://github.com/babel/babel/issues/13779#issuecomment-951481953
https://github.com/Lyoko-Jeremie
Lyoko-Jeremiehttps://github.com/Lyoko-Jeremie
on Nov 9, 2023https://github.com/babel/babel/issues/13779#issuecomment-1803103170
typescript projecthttps://github.com/Lyoko-Jeremie/sugarcube-2-ModLoader
https://github.com/liuxingbaoyu
liuxingbaoyuhttps://github.com/liuxingbaoyu
on Nov 9, 2023https://github.com/babel/babel/issues/13779#issuecomment-1803312567
microsoft/TypeScript#45995https://github.com/microsoft/TypeScript/issues/45995
https://github.com/Lyoko-Jeremie
Lyoko-Jeremiehttps://github.com/Lyoko-Jeremie
on Nov 9, 2023https://github.com/babel/babel/issues/13779#issuecomment-1803596035
@liuxingbaoyuhttps://github.com/liuxingbaoyu
https://github.com/nicolo-ribaudo
nicolo-ribaudohttps://github.com/nicolo-ribaudo
on Nov 9, 2023https://github.com/babel/babel/issues/13779#issuecomment-1803601672
https://github.com/Thulof
Thulofhttps://github.com/Thulof
on Apr 10, 2024https://github.com/babel/babel/issues/13779#issuecomment-2046494796
TS Playgroundhttps://www.typescriptlang.org/play?target=1&useDefineForClassFields=true#code/MYGwhgzhAECC0G8BQ1rAPYDsIBcBOArsDungBQAOeAlgG5g4Cm0YAXNJgQLYBGjeASkQBfFNCp0GzYNAC80HAAtqEAHRhoAamgAmANxJhQA
SWC Playgroundhttps://play.swc.rs/?version=1.3.100&code=H4sIAAAAAAAAA0vOSSwuVnBUqOZSUEjOzysuKSpNLskv0igoyixLLElVSLRSyCvNTUot0lSorgWqgYknK9gqlGRkFuslKmgrGFlz1QIA4nq%2FcEkAAAA%3D&config=H4sIAAAAAAAAA1WPSw7DIAwF9zkF8rrbdtE79BCIOhERP9mOVBTl7oUE0maH3xszsA5KwcwGnmotxzIkTYx0ziXhHER%2FSgKSE7IhmwRuvRWu1agd4x5tRwOiaUKpW8j3hoOLkbHjLfM22DH%2FC030iZD5ClZUh8nhVTc0Jfj4XvayfaQ%2B9tA%2F4Ad12XkxWH71TaEFh%2B0LYuVI0xQBAAA%3D
Babel Playgroundhttps://babeljs.io/repl#?browsers=chrome%2064&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=MYGwhgzhAECC0G8BQ1rAPYDsIBcBOArsDungBQAOeAlgG5g4Cm0YAXNJgQLYBGjeASkQBfFNCp0GzYNAC80HAAtqEAHRhoAamgAmANxJhQA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=true&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Ctypescript&prettier=true&targets=&version=7.24.4&externalPlugins=&assumptions=%7B%7D
Sign up for freehttps://github.com/signup?return_to=https://github.com/babel/babel/issues/13779
Sign in to commenthttps://github.com/login?return_to=https://github.com/babel/babel/issues/13779
i: needs triagehttps://github.com/babel/babel/issues?q=state%3Aopen%20label%3A%22i%3A%20needs%20triage%22
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.