Title: Allow passing additional SupportedExtensions to support React Native .android and .ios module loading · Issue #8328 · microsoft/TypeScript · GitHub
Open Graph Title: Allow passing additional SupportedExtensions to support React Native .android and .ios module loading · Issue #8328 · microsoft/TypeScript
X Title: Allow passing additional SupportedExtensions to support React Native .android and .ios module loading · Issue #8328 · microsoft/TypeScript
Description: We are using TypeScript to write our React Native application and encountered an issue with platform specific extensions provided by RN. React Native will detect when a file has a .ios. or .android. extension and load the right file for ...
Open Graph Description: We are using TypeScript to write our React Native application and encountered an issue with platform specific extensions provided by RN. React Native will detect when a file has a .ios. or .android...
X Description: We are using TypeScript to write our React Native application and encountered an issue with platform specific extensions provided by RN. React Native will detect when a file has a .ios. or .android...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/8328
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow passing additional SupportedExtensions to support React Native .android and .ios module loading","articleBody":"We are using TypeScript to write our React Native application and encountered an issue with [platform specific extensions](https://facebook.github.io/react-native/docs/platform-specific-code.html#platform-specific-extensions) provided by RN.\n\nReact Native will detect when a file has a .ios. or .android. extension and load the right file for each platform when requiring them from other components.\n\nFor example, you can have these files in your project:\n\n```\nBigButton.ios.js\nBigButton.android.js\n```\n\nWith this setup, you can just require the files from a different component without paying attention to the platform in which the app will run.\n\n```\nimport BigButton from './components/BigButton';\n```\n\nWhen we use tsc to compile our code, it won't recognize the android or ios platform extension. What about have a `customPlatform` option that's similar to `allowJs` that auto prepend the platform name to `supportedTypeScriptExtensions`?\n\n```\nfunction getSupportedExtensions(options) {\n if (options && options.customPlatform) {\n return ts.supportedTypeScriptExtensions.concat(ts.supportedTypeScriptExtensions.map((ext) => `.${options.customPlatform}${ext}`))\n }\n return options && options.allowJs ? allSupportedExtensions : ts.supportedTypeScriptExtensions;\n }\n```\n","author":{"url":"https://github.com/dfguo","@type":"Person","name":"dfguo"},"datePublished":"2016-04-27T07:38:17Z","url":"https://github.com/microsoft/TypeScript/issues/8328"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ab994ceb-5d79-d46b-76e8-64af745d14cd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC20:27D3AD:ABA71F:DB6DCE:6B00F4D4 |
| html-safe-nonce | af26014af4bc88e7676fcf012125619c41c927b00a481ae94fa14ee008aeea1c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzIwOjI3RDNBRDpBQkE3MUY6REI2RENFOjZCMDBGNEQ0IiwidmlzaXRvcl9pZCI6IjU2MDQyMjk0MDAxMzc2MjY4MzYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ea562d3d1aad56949b10f87dc9fa9e3a01b9781b34fa24f8b0f510aca6bfc0b3 |
| hovercard-subject-tag | issue:151318410 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/8328/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e9da239880cefc89841f436fcc158b342918efbd4247dc805571f28cd9cc2b95/microsoft/TypeScript/issues/8328 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e9da239880cefc89841f436fcc158b342918efbd4247dc805571f28cd9cc2b95/microsoft/TypeScript/issues/8328 |
| og:image:alt | We are using TypeScript to write our React Native application and encountered an issue with platform specific extensions provided by RN. React Native will detect when a file has a .ios. or .android... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dfguo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width