René's URL Explorer Experiment


Title: Opt-in Call Tracing Mode · Issue #547 · swiftwasm/JavaScriptKit · GitHub

Open Graph Title: Opt-in Call Tracing Mode · Issue #547 · swiftwasm/JavaScriptKit

X Title: Opt-in Call Tracing Mode · Issue #547 · swiftwasm/JavaScriptKit

Description: Motivation Crossing the Swift <-> JavaScript bridge is expensive, but today JavaScriptKit users have almost no visibility into how the bridge is actually used at runtime. As a result, performance issues related to excessive calls or unin...

Open Graph Description: Motivation Crossing the Swift <-> JavaScript bridge is expensive, but today JavaScriptKit users have almost no visibility into how the bridge is actually used at runtime. As a result, performance i...

X Description: Motivation Crossing the Swift <-> JavaScript bridge is expensive, but today JavaScriptKit users have almost no visibility into how the bridge is actually used at runtime. As a result, perform...

Opengraph URL: https://github.com/swiftwasm/JavaScriptKit/issues/547

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Opt-in Call Tracing Mode","articleBody":"## Motivation\n\nCrossing the Swift \u003c-\u003e JavaScript bridge is expensive, but today JavaScriptKit users have almost no visibility into how the bridge is actually used at runtime. As a result, performance issues related to excessive calls or unintended data bouncing across the bridge are often identified only by intuition.\n\nTo make performance work more data-driven, we want a minimal observability mechanism that allows users to trace when and how JavaScriptKit bridge calls happen, without imposing overhead on production builds.\n\n## Overview\n\nThis proposal introduces an optional tracing hook API, focused purely on providing hook points at bridge crossings.\n\nThe key design constraints are:\n\n- Tracing must be opt-in and compile-time gated\n- When disabled, there must be no runtime overhead\n- JavaScriptKit itself should not perform logging or aggregation\n- The API should be flexible enough to integrate with user-defined tracing systems\n\nTo achieve this, tracing hooks are only compiled when a specific SwiftPM package trait is enabled. When the trait is not enabled (default), the feature is entirely absent from the binary.\n\nFor each bridge crossing, JavaScriptKit calls a *start hook* provided by the user. That hook returns a closure, which JavaScriptKit later invokes at the *end* of the bridge crossing. This closure-based pairing avoids the need for JavaScriptKit to manage call IDs or start/end bookkeeping.\n\n## API Design (draft)\n\nThe initial scope covers two kinds of bridge crossings.\n\n### Swift -\u003e JavaScript calls\n\nWhen Swift code calls into JavaScript via JavaScriptKit, a tracing hook is invoked at the start and end of the call.\n\n- If a JavaScript function is called directly (i.e. without a receiver), the hook receives the function object and arguments.\n- If a JavaScript method is called, the hook receives the receiver object, the method name, and arguments.\n\n### JavaScript -\u003e Swift calls (JSClosure)\n\nWhen a JSClosure is invoked from the JavaScript side, a tracing hook is invoked.\n\nThe hook receives the file name and line number where the JSClosure was created. This information is already tracked by JavaScriptKit and can be forwarded without additional runtime cost.\n\n### API shape\n\n```swift\n#if Tacing\npublic struct JSTracing {\n  public static let default = JSTracing()\n\n  public enum JSCallInfo {\n    case function(function: JSObject, arguments: [JSValue])\n    case method(receiver: JSObject, methodName: String, arguments: [JSValue])\n  }\n\n  /// Register a hook for Swift to JavaScript calls.\n  ///\n  /// - Returns: A cleanup closure that unregisters the hook.\n  public func addJSCallHook(\n    _ hook: @escaping (_ info: JSCallInfo) -\u003e (() -\u003e Void)?\n  ) -\u003e () -\u003e Void\n\n  public struct JSClosureCallInfo {\n    /// The file identifier where the called JSClosure is defined\n    public let fileID: StaticString\n    /// The line number where the called JSClosure is defined\n    public let line: UInt\n  }\n  /// Register a hook for JavaScript to Swift calls via JSClosure.\n  ///\n  /// - Returns: A cleanup closure that unregisters the hook.\n  public func addJSClosureCallHook(\n    _ hook: @escaping (_ info: JSClosureCallInfo) -\u003e (() -\u003e Void)?\n  ) -\u003e () -\u003e Void\n}\n#endif\n```\n\nUsage:\n\n```swift\nlet remove = JSTracing.default.addJSCallHook { info in\n  let start = now()\n  return {\n    record(info, now() - start)\n  }\n}\n\ndefer { remove() }\n```","author":{"url":"https://github.com/kateinoigakukun","@type":"Person","name":"kateinoigakukun"},"datePublished":"2026-01-29T05:09:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/547/JavaScriptKit/issues/547"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:81e2086d-130e-377a-582e-6ef26d35f4fb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBDE8:2E134A:734C6F6:95824C3:697E5896
html-safe-nonceb1622b8631928c0eea4961088f98e5c2abb03ae53d50318f07e3a485938bd6dc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREU4OjJFMTM0QTo3MzRDNkY2Ojk1ODI0QzM6Njk3RTU4OTYiLCJ2aXNpdG9yX2lkIjoiMTQzODk0MDA4NjA0MDE1NjMxMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace968102dd877fe1bf40938b25985e7019828cef178cef4ec168305dbbf248d22
hovercard-subject-tagissue:3868859346
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/swiftwasm/JavaScriptKit/547/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8468fecf0cb568c8f8f2eca26b5707c9b85e93d75bc8fa652e2e3acb816d12e9/swiftwasm/JavaScriptKit/issues/547
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8468fecf0cb568c8f8f2eca26b5707c9b85e93d75bc8fa652e2e3acb816d12e9/swiftwasm/JavaScriptKit/issues/547
og:image:altMotivation Crossing the Swift <-> JavaScript bridge is expensive, but today JavaScriptKit users have almost no visibility into how the bridge is actually used at runtime. As a result, performance i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekateinoigakukun
hostnamegithub.com
expected-hostnamegithub.com
None60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7c85641c598ad130c74f7bcc27f58575cac69551
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/swiftwasm/JavaScriptKit/issues/547#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fswiftwasm%2FJavaScriptKit%2Fissues%2F547
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%2Fissues%2F547
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=swiftwasm%2FJavaScriptKit
Reloadhttps://github.com/swiftwasm/JavaScriptKit/issues/547
Reloadhttps://github.com/swiftwasm/JavaScriptKit/issues/547
Reloadhttps://github.com/swiftwasm/JavaScriptKit/issues/547
swiftwasm https://github.com/swiftwasm
JavaScriptKithttps://github.com/swiftwasm/JavaScriptKit
Please reload this pagehttps://github.com/swiftwasm/JavaScriptKit/issues/547
Notifications https://github.com/login?return_to=%2Fswiftwasm%2FJavaScriptKit
Fork 62 https://github.com/login?return_to=%2Fswiftwasm%2FJavaScriptKit
Star 835 https://github.com/login?return_to=%2Fswiftwasm%2FJavaScriptKit
Code https://github.com/swiftwasm/JavaScriptKit
Issues 33 https://github.com/swiftwasm/JavaScriptKit/issues
Pull requests 9 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
New issuehttps://github.com/login?return_to=https://github.com/swiftwasm/JavaScriptKit/issues/547
New issuehttps://github.com/login?return_to=https://github.com/swiftwasm/JavaScriptKit/issues/547
Featurehttps://github.com/swiftwasm/JavaScriptKit/issues?q=type:"Feature"
Opt-in Call Tracing Modehttps://github.com/swiftwasm/JavaScriptKit/issues/547#top
https://github.com/kateinoigakukun
https://github.com/kateinoigakukun
kateinoigakukunhttps://github.com/kateinoigakukun
on Jan 29, 2026https://github.com/swiftwasm/JavaScriptKit/issues/547#issue-3868859346
Featurehttps://github.com/swiftwasm/JavaScriptKit/issues?q=type:"Feature"
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.