René's URL Explorer Experiment


Title: [BridgeJS] Support @JS var declarations for global scope imports · Issue #466 · swiftwasm/JavaScriptKit · GitHub

Open Graph Title: [BridgeJS] Support @JS var declarations for global scope imports · Issue #466 · swiftwasm/JavaScriptKit

X Title: [BridgeJS] Support @JS var declarations for global scope imports · Issue #466 · swiftwasm/JavaScriptKit

Description: Motivation Currently, importing JavaScript APIs from the global scope requires users to write TypeScript declaration files and import APIs through the standard BridgeJS workflow. For simple use cases where users only need to access a few...

Open Graph Description: Motivation Currently, importing JavaScript APIs from the global scope requires users to write TypeScript declaration files and import APIs through the standard BridgeJS workflow. For simple use cas...

X Description: Motivation Currently, importing JavaScript APIs from the global scope requires users to write TypeScript declaration files and import APIs through the standard BridgeJS workflow. For simple use cas...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BridgeJS] Support @JS var declarations for global scope imports","articleBody":"## Motivation\n\nCurrently, importing JavaScript APIs from the global scope requires users to write TypeScript declaration files and import APIs through the standard BridgeJS workflow. For simple use cases where users only need to access a few well-known global APIs like `console.log()` or `document.getElementById()`, this approach can feel heavyweight and requires additional setup steps.\n\n## Proposed Solution\n\nAllow users to declare global scope imports directly in Swift using `@JS var` declarations with protocol interfaces, eliminating the need for separate `.d.ts` files for simple global API access.\n\n## High-level API\n\n```swift\n@JS protocol JSConsole {\n    func log(_ message: String) throws(JSException)\n    func error(_ message: String) throws(JSException)\n}\n\n@JSGetter(from: .global) var console: JSConsole\n\n@JS class JSElement {\n    var innerHTML: String { get set }\n    func addEventListener(_ event: String, _ handler: @escaping () -\u003e Void) throws(JSException)\n}\n\n@JS protocol JSDocument {\n    func getElementById(_ id: String) throws(JSException) -\u003e JSElement?\n}\n\n@JS(from: .global, jsName: \"document\") var jsDocument: JSDocument\n\n@JSImport(from: .module(\"uuid\"), jsName: \"v4\")\nfunc uuidv4() throws(JSException) -\u003e String\n\n@JSImport(from: .module(\"./custom-component.js\"), jsName: \"defineCustomComponents\")\nfunc jsDefineCustomComponents() throws(JSException)\n\n@JS func run() {\n    print(uuidv4())\n    jsDefineCustomComponents()\n}\n\n```\n\n## Implementation\n\nThis feature would require adding a macro plugin to support `@JS var [name]: [Type]` declarations that generates getter/setter accessors interacting with the code generated by `@JS protocol`\n\nIf it works well, we might be able to make ImportTS just to generate `@JS` annotated Swift code and centralize ABI-facing code in ExportSwift","author":{"url":"https://github.com/kateinoigakukun","@type":"Person","name":"kateinoigakukun"},"datePublished":"2025-11-09T07:36:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/466/JavaScriptKit/issues/466"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9df9d6d9-bca6-19b0-8944-fc68dfc61d5a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDDC4:3CF7C2:42E6485:5A2AF4F:697B1C64
html-safe-nonce7786dda5ff58d3518df3a236a882b900357311ae68d84daeaf6da8c934c45fa9
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEREM0OjNDRjdDMjo0MkU2NDg1OjVBMkFGNEY6Njk3QjFDNjQiLCJ2aXNpdG9yX2lkIjoiMzI5Mjk5MjIwNDAzMjM4NDEwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac021c3c14429c1aac5d56b398838d39c72cc38147e93c18a6d7fe7118ce4b0e87
hovercard-subject-tagissue:3604564880
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/466/issue_layout
twitter:imagehttps://opengraph.githubassets.com/b8f178f8fd9eddf9f3550ba37d93a3598517067f25be93954ecd221a506c2dcc/swiftwasm/JavaScriptKit/issues/466
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/b8f178f8fd9eddf9f3550ba37d93a3598517067f25be93954ecd221a506c2dcc/swiftwasm/JavaScriptKit/issues/466
og:image:altMotivation Currently, importing JavaScript APIs from the global scope requires users to write TypeScript declaration files and import APIs through the standard BridgeJS workflow. For simple use cas...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekateinoigakukun
hostnamegithub.com
expected-hostnamegithub.com
None7ce8ed0a54c4730aeca4e6abacfc6490365fc42e25480b86883054df3f9181c8
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
released7bfc78137af9a4828305e52ab993fce981d7085
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/swiftwasm/JavaScriptKit/issues/466#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fswiftwasm%2FJavaScriptKit%2Fissues%2F466
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%2F466
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/466
Reloadhttps://github.com/swiftwasm/JavaScriptKit/issues/466
Reloadhttps://github.com/swiftwasm/JavaScriptKit/issues/466
swiftwasm https://github.com/swiftwasm
JavaScriptKithttps://github.com/swiftwasm/JavaScriptKit
Please reload this pagehttps://github.com/swiftwasm/JavaScriptKit/issues/466
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 34 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/466
New issuehttps://github.com/login?return_to=https://github.com/swiftwasm/JavaScriptKit/issues/466
[BridgeJS] Support @JS var declarations for global scope importshttps://github.com/swiftwasm/JavaScriptKit/issues/466#top
https://github.com/kateinoigakukun
https://github.com/kateinoigakukun
kateinoigakukunhttps://github.com/kateinoigakukun
on Nov 9, 2025https://github.com/swiftwasm/JavaScriptKit/issues/466#issue-3604564880
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.