René's URL Explorer Experiment


Title: BridgeJS: Enable struct as default parameter and enable default parameters in struct init / methods by krodak · Pull Request #480 · swiftwasm/JavaScriptKit · GitHub

Open Graph Title: BridgeJS: Enable struct as default parameter and enable default parameters in struct init / methods by krodak · Pull Request #480 · swiftwasm/JavaScriptKit

X Title: BridgeJS: Enable struct as default parameter and enable default parameters in struct init / methods by krodak · Pull Request #480 · swiftwasm/JavaScriptKit

Description: Introduction This PR extends support for default parameter values when exporting Swift functions and constructors to JavaScript/TypeScript using the BridgeJS plugin. It adds ability to: use struct as default parameter use default parameters in struct init and methods Additional Changes Some minor refactor to DefaultValueGenerator was needed, it got refactored into DefaultValueUtils, moved outside of BridgeJSLink as it needs to be used in JSGlueGen. I considered moving it to separate module, considered using BridgeJSUtilities too, but it would require dependency on BridgeJSSkeleton so probably not worth it. I think I might eventually extract some StackBasedThunkBuilder after array implementation to extract some helper functionality and lowering / lifting from JSGlueGen for stack-based types, but let's see after Array implementation 😅 Hope this is ok enough for now, but I'm happy to extract this into separate file, module or use different approach.

Open Graph Description: Introduction This PR extends support for default parameter values when exporting Swift functions and constructors to JavaScript/TypeScript using the BridgeJS plugin. It adds ability to: use struct...

X Description: Introduction This PR extends support for default parameter values when exporting Swift functions and constructors to JavaScript/TypeScript using the BridgeJS plugin. It adds ability to: use struct...

Opengraph URL: https://github.com/swiftwasm/JavaScriptKit/pull/480

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4ce0a517-99a5-cbe7-cc16-de230c641316
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8C28:32FD5:1B85238:2558F49:697AA5C9
html-safe-nonce730134e45be199776cf50783f8fda5759d442658c13bf1f5f839906c62469528
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzI4OjMyRkQ1OjFCODUyMzg6MjU1OEY0OTo2OTdBQTVDOSIsInZpc2l0b3JfaWQiOiI0ODAzMjA0NTM4OTgwNTQxODk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac66defa118bf0750de0cb78e0d45899e459a0a73c060a974a1a4e5adb7abb09c8
hovercard-subject-tagpull_request:3123441342
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/swiftwasm/JavaScriptKit/pull/480/files
twitter:imagehttps://avatars.githubusercontent.com/u/1955364?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1955364?s=400&v=4
og:image:altIntroduction This PR extends support for default parameter values when exporting Swift functions and constructors to JavaScript/TypeScript using the BridgeJS plugin. It adds ability to: use struct...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None4d375b6c612de26fd037e0638eaf57e32cf9b16daf53ab68c25c04cd3b058113
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/swiftwasm/JavaScriptKit git https://github.com/swiftwasm/JavaScriptKit.git
octolytics-dimension-user_id49500752
octolytics-dimension-user_loginswiftwasm
octolytics-dimension-repository_id244832006
octolytics-dimension-repository_nwoswiftwasm/JavaScriptKit
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id244832006
octolytics-dimension-repository_network_root_nwoswiftwasm/JavaScriptKit
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
release5b310e2c1221fb24ffd3f38a097000863d2dfdd4
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fswiftwasm%2FJavaScriptKit%2Fpull%2F480%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fswiftwasm%2FJavaScriptKit%2Fpull%2F480%2Ffiles
Sign up https://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=swiftwasm%2FJavaScriptKit
Reloadhttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes
Reloadhttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes
Reloadhttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes
swiftwasm https://github.com/swiftwasm
JavaScriptKithttps://github.com/swiftwasm/JavaScriptKit
Please reload this pagehttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes
Notifications https://github.com/login?return_to=%2Fswiftwasm%2FJavaScriptKit
Fork 61 https://github.com/login?return_to=%2Fswiftwasm%2FJavaScriptKit
Star 833 https://github.com/login?return_to=%2Fswiftwasm%2FJavaScriptKit
Code https://github.com/swiftwasm/JavaScriptKit
Issues 30 https://github.com/swiftwasm/JavaScriptKit/issues
Pull requests 11 https://github.com/swiftwasm/JavaScriptKit/pulls
Actions https://github.com/swiftwasm/JavaScriptKit/actions
Projects 0 https://github.com/swiftwasm/JavaScriptKit/projects
Security 0 https://github.com/swiftwasm/JavaScriptKit/security
Insights https://github.com/swiftwasm/JavaScriptKit/pulse
Code https://github.com/swiftwasm/JavaScriptKit
Issues https://github.com/swiftwasm/JavaScriptKit/issues
Pull requests https://github.com/swiftwasm/JavaScriptKit/pulls
Actions https://github.com/swiftwasm/JavaScriptKit/actions
Projects https://github.com/swiftwasm/JavaScriptKit/projects
Security https://github.com/swiftwasm/JavaScriptKit/security
Insights https://github.com/swiftwasm/JavaScriptKit/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fswiftwasm%2FJavaScriptKit%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fswiftwasm%2FJavaScriptKit%2Fissues%2Fnew%2Fchoose
krodakhttps://github.com/krodak
swiftwasm:mainhttps://github.com/swiftwasm/JavaScriptKit/tree/main
PassiveLogic:feat/default-values-structhttps://github.com/PassiveLogic/JavaScriptKit/tree/feat/default-values-struct
Conversation 0 https://github.com/swiftwasm/JavaScriptKit/pull/480
Commits 1 https://github.com/swiftwasm/JavaScriptKit/pull/480/commits
Checks 10 https://github.com/swiftwasm/JavaScriptKit/pull/480/checks
Files changed https://github.com/swiftwasm/JavaScriptKit/pull/480/files
Please reload this pagehttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes
BridgeJS: Enable struct as default parameter and enable default parameters in struct init / methods https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#top
Show all changes 1 commit https://github.com/swiftwasm/JavaScriptKit/pull/480/files
0872dbd BridgeJS: Add default parameters to struct and enable struct as defau… krodak Dec 22, 2025 https://github.com/swiftwasm/JavaScriptKit/pull/480/commits/0872dbd7e2dd9c4a3a315d141ef2fd51e4b109ef
Clear filters https://github.com/swiftwasm/JavaScriptKit/pull/480/files
Please reload this pagehttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes
Please reload this pagehttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes
ExportSwift.swift https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-732eb5968cb5b084c3c18741c725556c2155c453e272c576180202771b66f523
BridgeJSLink.swift https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
JSGlueGen.swift https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-23ddfec0648eff8087f2c98c886320798a83d96f2c7e9e12da7c423d7503cdaa
BridgeJSSkeleton.swift https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-5562ed70b47e454811e43eb59179c550471eb249368cd624534b478a0f2dc557
DefaultParameters.swift https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-ec0fd826191e0fcaa6074fcc2a65324ae3afd8f2793a4343671cdb4d76572ee7
DefaultParameters.Export.d.ts https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-e1dc321b57bdfd8a13ac010fe30192b5b5604ea803d210d9bff77d2b965bf2a5
DefaultParameters.Export.js https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-c84664f96fa58a7cc955717819cdac7531b99ed32e19d736d523e8c78ea64bc4
DefaultParameters.json https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-83e7840e0a456de75f3d2027c9685ff42b8110c6c06d1f8e10265c9b18649642
DefaultParameters.swift https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-201ce527e3508c1f64009034a7913b22b143528c857152fd5c215e927c7aa4b6
Exporting-Swift-Default-Parameters.md https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-ee2019d2c116b7f391d816eca8fefbca6e1c53f7e3de5a4423d9a5987375ba58
ExportAPITests.swift https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-fd034a6b3245c6475995a7497846e184065bf873d332a0bfbe4f2ad476356e74
BridgeJS.ExportSwift.swift https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-b348fb8880707414b193160851f4bcae79d6b5a58f743c0d44d9b80ac7095dac
BridgeJS.ExportSwift.json https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-5bc8d5bc68082cda06bb3abbff623b4c2b5cbf8d0c3f145c4a13c3ba4107a177
prelude.mjs https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-dda8cfeae3332b2f8f690d2093fa921a3bf1a647e8704fd22025f8d3bf3854ef
Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swifthttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-732eb5968cb5b084c3c18741c725556c2155c453e272c576180202771b66f523
View file https://github.com/PassiveLogic/JavaScriptKit/blob/0872dbd7e2dd9c4a3a315d141ef2fd51e4b109ef/Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/swiftwasm/JavaScriptKit/pull/480/{{ revealButtonHref }}
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-732eb5968cb5b084c3c18741c725556c2155c453e272c576180202771b66f523
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-732eb5968cb5b084c3c18741c725556c2155c453e272c576180202771b66f523
Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swifthttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
View file https://github.com/PassiveLogic/JavaScriptKit/blob/0872dbd7e2dd9c4a3a315d141ef2fd51e4b109ef/Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/swiftwasm/JavaScriptKit/pull/480/{{ revealButtonHref }}
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-0664e8ae05a5000d6f6b615753e1a6f206d8820aa2125550b83ab36957ac8aea
Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swifthttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-23ddfec0648eff8087f2c98c886320798a83d96f2c7e9e12da7c423d7503cdaa
View file https://github.com/PassiveLogic/JavaScriptKit/blob/0872dbd7e2dd9c4a3a315d141ef2fd51e4b109ef/Plugins/BridgeJS/Sources/BridgeJSLink/JSGlueGen.swift
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/swiftwasm/JavaScriptKit/pull/480/{{ revealButtonHref }}
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-23ddfec0648eff8087f2c98c886320798a83d96f2c7e9e12da7c423d7503cdaa
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-23ddfec0648eff8087f2c98c886320798a83d96f2c7e9e12da7c423d7503cdaa
Plugins/BridgeJS/Sources/BridgeJSSkeleton/BridgeJSSkeleton.swifthttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-5562ed70b47e454811e43eb59179c550471eb249368cd624534b478a0f2dc557
View file https://github.com/PassiveLogic/JavaScriptKit/blob/0872dbd7e2dd9c4a3a315d141ef2fd51e4b109ef/Plugins/BridgeJS/Sources/BridgeJSSkeleton/BridgeJSSkeleton.swift
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/swiftwasm/JavaScriptKit/pull/480/{{ revealButtonHref }}
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-5562ed70b47e454811e43eb59179c550471eb249368cd624534b478a0f2dc557
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-5562ed70b47e454811e43eb59179c550471eb249368cd624534b478a0f2dc557
https://github.com/swiftwasm/JavaScriptKit/pull/480/changes#diff-5562ed70b47e454811e43eb59179c550471eb249368cd624534b478a0f2dc557
Please reload this pagehttps://github.com/swiftwasm/JavaScriptKit/pull/480/changes
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.