René's URL Explorer Experiment


Title: BridgeJS: Declarative JS interop · Issue #290 · swiftwasm/JavaScriptKit · GitHub

Open Graph Title: BridgeJS: Declarative JS interop · Issue #290 · swiftwasm/JavaScriptKit

X Title: BridgeJS: Declarative JS interop · Issue #290 · swiftwasm/JavaScriptKit

Description: Motivation Current JS interop system, JavaScriptKit, has two main issues: It's based on dynamic, string-based method calls and properties access. It's not type-safe and can easily lead to runtime errors even if the JS side is written wit...

Open Graph Description: Motivation Current JS interop system, JavaScriptKit, has two main issues: It's based on dynamic, string-based method calls and properties access. It's not type-safe and can easily lead to runtime e...

X Description: Motivation Current JS interop system, JavaScriptKit, has two main issues: It's based on dynamic, string-based method calls and properties access. It's not type-safe and can easily lead to r...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BridgeJS: Declarative JS interop","articleBody":"## Motivation\n\nCurrent JS interop system, [JavaScriptKit](https://github.com/swiftwasm/JavaScriptKit), has two main issues:\n\n* It's based on dynamic, string-based method calls and properties access.\n    * It's not type-safe and can easily lead to runtime errors even if the JS side is written with types (like TypeScript).\n    * There are non-trivial performance penalties due to the dynamism.\n* There is no easy way to expose Swift functionalities to JS side.\n    * Developer productivity\n    * We need to write so many boilerplates to set up closures and type conversions for each exposed function.\n    * Has some performance penalties too.\n\n## Current Status\n\nTry on our playground https://swiftwasm.org/JavaScriptKit/PlayBridgeJS/\n\n## High-level API\n\nGiven the following interface:\n\n```\n// bridge.d.ts\nexport interface CanvasContext {\n  drawRect(x: number, y: number, width: number, height: number) =\u003e void;\n}\n\n// App.swift\npublic struct App {\n    let context: CanvasContext\n    @ExposeToJS\n    init(context: CanvasContext) {\n        self.context = context\n    }\n\n    struct PointerEvent {\n        let x: Int\n        let y: Int\n        let pointerId: Int\n    }\n\n    @ExposeToJS\n    func feedPointerEvents(_ events: [PointerEvent]) {\n        ...\n        context.drawRect(...)\n    }\n}\n```\n\nThen SwiftPM Build Plugin or standalone CLI tool should generate:\n1. Swift and JS bridging glue code to expose `CanvasContext` to Swift\n2. Swift and JS/TS bridging glue code to expose `App` methods to JS/TS\n\n\n## Breakdown\n\n- [x] Produce ES Module package with some instantiation JS code and .wasm\n  - [x] Check if the current SwiftPM Plugin API has enough capability to produce a JS package\n  - [x] https://github.com/swiftwasm/JavaScriptKit/pull/288\n- [x] Prototype a tool to expose Swift interface to TS/JS\n  - [x] Check if we can process it without swift-syntax dependency (to avoid longer build time)\n  - [x] Performance benchmark\n- [x] Prototype a tool to import TS interface to Swift\n  - [x] Check if TypeScript Compiler API can handle third-party JS packages\n  - [x] Performance benchmark\n\n## Other Languages\n\n* https://learn.microsoft.com/en-us/aspnet/core/client-side/dotnet-interop?view=aspnetcore-9.0\n* https://kotlinlang.org/docs/js-to-kotlin-interop.html\n* https://rescript-lang.org/docs/manual/v11.0.0/interop-cheatsheet\n* https://github.com/rustwasm/wasm-bindgen/\n* https://github.com/siefkenj/tsify\n* https://github.com/ocsigen/ts2ocaml\n\n\n","author":{"url":"https://github.com/kateinoigakukun","@type":"Person","name":"kateinoigakukun"},"datePublished":"2025-03-10T08:23:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/290/JavaScriptKit/issues/290"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b6ab85ee-1aec-0846-1182-8537f21078a2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCFFE:F5406:1B5DBE6:26C6B69:6978DA0B
html-safe-nonce547e399a90b631d87b0da9c9a4c76ce1d77e2d49abc25c7c14ece19d862bb200
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRkZFOkY1NDA2OjFCNURCRTY6MjZDNkI2OTo2OTc4REEwQiIsInZpc2l0b3JfaWQiOiI2MzExNzY3MzQ3NTM0NzkxNzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7aec4d5c816a3468c9c385de261e4a473ccdc6d91f0244fae9084a01493b0521
hovercard-subject-tagissue:2906447874
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/290/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b554cdc5667c8d54e613a1110d685ce3bb4e3ccbebc15de019cf7a4f17f6401f/swiftwasm/JavaScriptKit/issues/290
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b554cdc5667c8d54e613a1110d685ce3bb4e3ccbebc15de019cf7a4f17f6401f/swiftwasm/JavaScriptKit/issues/290
og:image:altMotivation Current JS interop system, JavaScriptKit, has two main issues: It's based on dynamic, string-based method calls and properties access. It's not type-safe and can easily lead to runtime e...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekateinoigakukun
hostnamegithub.com
expected-hostnamegithub.com
None8a71ca1f7ab5436216e1df86f398ef7a51ed3152c90e3f7332fc70cf97fcb9d6
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
releaseeaed570eead52a9920afef75dc3eb6d826fdc5ef
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/swiftwasm/JavaScriptKit/issues/290#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fswiftwasm%2FJavaScriptKit%2Fissues%2F290
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%2F290
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/290
Reloadhttps://github.com/swiftwasm/JavaScriptKit/issues/290
Reloadhttps://github.com/swiftwasm/JavaScriptKit/issues/290
swiftwasm https://github.com/swiftwasm
JavaScriptKithttps://github.com/swiftwasm/JavaScriptKit
Please reload this pagehttps://github.com/swiftwasm/JavaScriptKit/issues/290
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 26 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
New issuehttps://github.com/login?return_to=https://github.com/swiftwasm/JavaScriptKit/issues/290
New issuehttps://github.com/login?return_to=https://github.com/swiftwasm/JavaScriptKit/issues/290
BridgeJS: Declarative JS interophttps://github.com/swiftwasm/JavaScriptKit/issues/290#top
https://github.com/kateinoigakukun
https://github.com/kateinoigakukun
kateinoigakukunhttps://github.com/kateinoigakukun
on Mar 10, 2025https://github.com/swiftwasm/JavaScriptKit/issues/290#issue-2906447874
JavaScriptKithttps://github.com/swiftwasm/JavaScriptKit
https://swiftwasm.org/JavaScriptKit/PlayBridgeJS/https://swiftwasm.org/JavaScriptKit/PlayBridgeJS/
Packaging Plugin #288https://github.com/swiftwasm/JavaScriptKit/pull/288
https://learn.microsoft.com/en-us/aspnet/core/client-side/dotnet-interop?view=aspnetcore-9.0https://learn.microsoft.com/en-us/aspnet/core/client-side/dotnet-interop?view=aspnetcore-9.0
https://kotlinlang.org/docs/js-to-kotlin-interop.htmlhttps://kotlinlang.org/docs/js-to-kotlin-interop.html
https://rescript-lang.org/docs/manual/v11.0.0/interop-cheatsheethttps://rescript-lang.org/docs/manual/v11.0.0/interop-cheatsheet
https://github.com/rustwasm/wasm-bindgen/https://github.com/rustwasm/wasm-bindgen/
https://github.com/siefkenj/tsifyhttps://github.com/siefkenj/tsify
https://github.com/ocsigen/ts2ocamlhttps://github.com/ocsigen/ts2ocaml
Yuta's projecthttps://github.com/orgs/swiftwasm/projects/5
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.