René's URL Explorer Experiment


Title: SystemJS and `default` import with `export =` proposal · Issue #5285 · microsoft/TypeScript · GitHub

Open Graph Title: SystemJS and `default` import with `export =` proposal · Issue #5285 · microsoft/TypeScript

X Title: SystemJS and `default` import with `export =` proposal · Issue #5285 · microsoft/TypeScript

Description: I was recently running into some trouble with getting SystemJS to load jQuery using the ES6-style syntax. import * as $ from 'jquery'; The above code worked fine with RequireJS and AMD format, and when using SystemJS as the loader when m...

Open Graph Description: I was recently running into some trouble with getting SystemJS to load jQuery using the ES6-style syntax. import * as $ from 'jquery'; The above code worked fine with RequireJS and AMD format, and ...

X Description: I was recently running into some trouble with getting SystemJS to load jQuery using the ES6-style syntax. import * as $ from 'jquery'; The above code worked fine with RequireJS and AMD form...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/5285

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SystemJS and `default` import with `export =` proposal","articleBody":"I was recently running into some trouble with getting SystemJS to load jQuery using the ES6-style syntax.\n\n``` typescript\nimport * as $ from 'jquery';\n```\n\nThe above code worked fine with RequireJS and AMD format, and when using SystemJS as the loader when my code was emitted by TypeScript in AMD format.\n\nHowever I noticed odd behavior when emitting this code using the system format and using SystemJS.  I was getting all of the static functions of `$`, but `$` _itself_ was an inert object (not a function).  So at runtime, `$.isArray([]);` would work, but `$('#myDiv')` would throw \"$ is not a function\".\n\nHere's my original issue on the SystemJS repo: https://github.com/systemjs/systemjs/issues/844\n\nI kept digging around in the SystemJS documentation and eventually noticed that it referenced using a _default_ ES6 import with jQuery:\n\n``` typescript\nimport $ from 'jquery';\n```\n\nSure enough when I tried this, it worked, even though jQuery itself **does not** export a property `default`.\n\nAfter more research, I found this on the SystemJS site:\n\nhttps://github.com/systemjs/systemjs/blob/master/docs/module-formats.md#inter-format-dependencies\n\n> When loading CommonJS, AMD or Global modules from within ES6, the full module is available at the  default  export which can be loaded with the default import syntax.\n\nSo when using SystemJS, the \"is a\" is made available through a _virtual_ default export.\n\nHowever, this is a problem since there's not currently a way to model this in TypeScript without breaking existing code using `import $ = require('jquery')` syntax.\n\nCurrent jQuery definition on Definitely Typed:\n\n``` typescript\ndeclare module \"jquery\" {\n  export = $;\n}\n```\n## Proposal\n\nIn light of the documented behavior of SystemJS, I'd like to propose a change to TypeScript to allow ES6-style default import syntax to work with an ambient external module declaration that uses `export =` syntax, as long as the module format is \"system\".\n\nWith this change, this code would compile cleanly if TypeScript is set to \"system\", but would still error using \"amd\", \"commonjs\" or \"umd\" with \"Module 'my-module' has no default export\":\n\n**my-module.d.ts**\n\n``` typescript\ndeclare module \"my-module\" {\n  var doStuff : () => void;\n  export = doStuff;\n}\n```\n\n**test.ts**\n\n``` typescript\nimport ds from \"my-module\";\nds();\n```\n\nRelated:\nhttps://github.com/Microsoft/TypeScript/issues/4337\nhttps://github.com/Microsoft/TypeScript/issues/2719\nCC: @vvakame @basarat @johnnyreilly @jbrantly @guybedford\n","author":{"url":"https://github.com/nycdotnet","@type":"Person","name":"nycdotnet"},"datePublished":"2015-10-16T16:22:21Z","url":"https://github.com/microsoft/TypeScript/issues/5285"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:163638bb-cb9f-719f-bd01-953ebdf1a06b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idAEA8:A99C2:19644C6:205C1B5:6B01327D
html-safe-nonce57e6b918565c7f127909fe94a13d2ad93af93cb6a7e5c20d48a76a8a5c7d7eba
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUE4OkE5OUMyOjE5NjQ0QzY6MjA1QzFCNTo2QjAxMzI3RCIsInZpc2l0b3JfaWQiOiI3MDc5MDQ1NjI5Njk5MjQwNTczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac83ebce72b95e10e59165914e305eba2574b82898ca09490c5f88f2a52d403f22
hovercard-subject-tagissue:111864080
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/microsoft/TypeScript/5285/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6173334fc79cba6bb77580fa1ea77300bde535d811a86ffa20eda70e39d07be6/microsoft/TypeScript/issues/5285
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6173334fc79cba6bb77580fa1ea77300bde535d811a86ffa20eda70e39d07be6/microsoft/TypeScript/issues/5285
og:image:altI was recently running into some trouble with getting SystemJS to load jQuery using the ES6-style syntax. import * as $ from 'jquery'; The above code worked fine with RequireJS and AMD format, and ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenycdotnet
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/5285#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F5285
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%2Fmicrosoft%2FTypeScript%2Fissues%2F5285
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=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/5285
Reloadhttps://github.com/microsoft/TypeScript/issues/5285
Reloadhttps://github.com/microsoft/TypeScript/issues/5285
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests310 (310)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/5285
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/5285
SystemJS and default import with export = proposalhttps://github.com/microsoft/TypeScript/issues/5285#top
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 1.8https://github.com/microsoft/TypeScript/milestone/15
https://github.com/nycdotnet
Steve Ognibene (nycdotnet)https://github.com/nycdotnet
on Oct 16, 2015https://github.com/microsoft/TypeScript/issues/5285#issue-111864080
systemjs/systemjs#844https://github.com/systemjs/systemjs/issues/844
https://github.com/systemjs/systemjs/blob/master/docs/module-formats.md#inter-format-dependencieshttps://github.com/systemjs/systemjs/blob/master/docs/module-formats.md#inter-format-dependencies
#4337https://github.com/microsoft/TypeScript/issues/4337
#2719https://github.com/microsoft/TypeScript/issues/2719
Masahiro Wakame (@vvakame)https://github.com/vvakame
Basarat Ali Syed (@basarat)https://github.com/basarat
John Reilly (@johnnyreilly)https://github.com/johnnyreilly
James Brantly (@jbrantly)https://github.com/jbrantly
Guy Bedford (@guybedford)https://github.com/guybedford
Nexthttps://github.com/microsoft/TypeScript/issues/5285?timeline_page=1
https://github.com/myitcv
Paul Jolly (myitcv)https://github.com/myitcv
on Oct 16, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-148764421
herehttps://github.com/Microsoft/TypeScript/issues/4665
#4665https://github.com/microsoft/TypeScript/issues/4665
https://github.com/nycdotnet
Steve Ognibene (nycdotnet)https://github.com/nycdotnet
on Oct 16, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-148783461
Paul Jolly (@myitcv)https://github.com/myitcv
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Oct 16, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-148788971
https://github.com/myitcv
Paul Jolly (myitcv)https://github.com/myitcv
on Oct 17, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-148908593
Steve Ognibene (@nycdotnet)https://github.com/nycdotnet
similar problemhttps://github.com/systemjs/systemjs/issues/775
https://github.com/nycdotnet
Steve Ognibene (nycdotnet)https://github.com/nycdotnet
on Oct 17, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-148916268
https://github.com/bryanforbes
Bryan Forbes (bryanforbes)https://github.com/bryanforbes
on Oct 19, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149235579
https://github.com/kitsonk
Kitson Kelly (kitsonk)https://github.com/kitsonk
on Oct 19, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149236379
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Oct 19, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149239478
https://github.com/bryanforbes
Bryan Forbes (bryanforbes)https://github.com/bryanforbes
on Oct 19, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149261792
Steve Ognibene (@nycdotnet)https://github.com/nycdotnet
CJS never supported module.exports =http://wiki.commonjs.org/wiki/Modules/1.1
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Oct 19, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149285098
Bryan Forbes (@bryanforbes)https://github.com/bryanforbes
supported this reality with its definitionshttps://github.com/Microsoft/TypeScript/issues/4337
https://github.com/bryanforbes
Bryan Forbes (bryanforbes)https://github.com/bryanforbes
on Oct 19, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149292911
James Brantly (@jbrantly)https://github.com/jbrantly
https://github.com/jbrantly
James Brantly (jbrantly)https://github.com/jbrantly
on Oct 19, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149295793
Bryan Forbes (@bryanforbes)https://github.com/bryanforbes
https://github.com/nycdotnet
Steve Ognibene (nycdotnet)https://github.com/nycdotnet
on Oct 19, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149296096
https://github.com/guybedford
Guy Bedford (guybedford)https://github.com/guybedford
on Oct 20, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149584991
https://github.com/nycdotnet
Steve Ognibene (nycdotnet)https://github.com/nycdotnet
on Oct 20, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149595133
https://github.com/bryanforbes
Bryan Forbes (bryanforbes)https://github.com/bryanforbes
on Oct 21, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-149908938
Guy Bedford (@guybedford)https://github.com/guybedford
Guy Bedford (@guybedford)https://github.com/guybedford
Steve Ognibene (@nycdotnet)https://github.com/nycdotnet
James Brantly (@jbrantly)https://github.com/jbrantly
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on Oct 22, 2015https://github.com/microsoft/TypeScript/issues/5285#event-442126836
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Nov 3, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-153207020
Steve Ognibene (@nycdotnet)https://github.com/nycdotnet
https://github.com/nycdotnet
Steve Ognibene (nycdotnet)https://github.com/nycdotnet
on Nov 3, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-153236776
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
on Nov 7, 2015https://github.com/microsoft/TypeScript/issues/5285#event-457979558
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
Wesley Wigham (weswigham)https://github.com/weswigham
on Nov 7, 2015https://github.com/microsoft/TypeScript/issues/5285#event-457979564
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
TypeScript 1.8https://github.com/microsoft/TypeScript/milestone/15
on Nov 7, 2015https://github.com/microsoft/TypeScript/issues/5285#event-457979568
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Nov 7, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-154744571
Wesley Wigham (@weswigham)https://github.com/weswigham
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
on Dec 1, 2015https://github.com/microsoft/TypeScript/issues/5285#event-478638661
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Dec 1, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-160885125
#5577https://github.com/microsoft/TypeScript/pull/5577
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Dec 1, 2015https://github.com/microsoft/TypeScript/issues/5285#event-478639035
https://github.com/myitcv
Paul Jolly (myitcv)https://github.com/myitcv
on Dec 1, 2015https://github.com/microsoft/TypeScript/issues/5285#issuecomment-161040037
Wesley Wigham (@weswigham)https://github.com/weswigham
Mohamed Hegazy (@mhegazy)https://github.com/mhegazy
Candice Wright (capfei)https://github.com/capfei
Wesley Wigham (weswigham)https://github.com/weswigham
on Jan 20, 2016https://github.com/microsoft/TypeScript/issues/5285#event-520610091
Michael Nigh (micnigh)https://github.com/micnigh
on Feb 4, 2016https://github.com/microsoft/TypeScript/issues/5285#event-539820775
fix - errors due to typescript `default` changeshttps://github.com/micnigh/boilerplate-isomorphic-typescript/commit/f8e0f2f566e7fa3d72a10fd77d1cf3faded002f8
f8e0f2fhttps://github.com/micnigh/boilerplate-isomorphic-typescript/commit/f8e0f2f566e7fa3d72a10fd77d1cf3faded002f8
microsofthttps://github.com/microsoft
on Jun 19, 2018https://github.com/microsoft/TypeScript/issues/5285#event-1689620186
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/5285
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/5285
CommittedThe team has roadmapped this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Committed%22
FixedA PR has been merged for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fixed%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
TypeScript 1.8https://github.com/microsoft/TypeScript/milestone/15
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.