Title: Enable transpilers support in NativeScript projects · Issue #493 · NativeScript/nativescript-cli · GitHub
Open Graph Title: Enable transpilers support in NativeScript projects · Issue #493 · NativeScript/nativescript-cli
X Title: Enable transpilers support in NativeScript projects · Issue #493 · NativeScript/nativescript-cli
Description: A common request we have received in the last couple of months is the ability to enable (or start with) JavaScript transpilers for a given NativeScript project. The usual suspects are TypeScript and Babel which recently became quite popu...
Open Graph Description: A common request we have received in the last couple of months is the ability to enable (or start with) JavaScript transpilers for a given NativeScript project. The usual suspects are TypeScript an...
X Description: A common request we have received in the last couple of months is the ability to enable (or start with) JavaScript transpilers for a given NativeScript project. The usual suspects are TypeScript an...
Opengraph URL: https://github.com/NativeScript/nativescript-cli/issues/493
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Enable transpilers support in NativeScript projects","articleBody":"A common request we have received in the last couple of months is the ability to enable (or start with) JavaScript transpilers for a given NativeScript project. The usual suspects are TypeScript and Babel which recently became quite popular with the approaching ratification of ES6.\n### Guiding principles\n\nThere a couple of guiding principles we want to follow when we enable this functionality.\n#### Making it generic\n\nWe want to design this feature so we can accommodate any transpiler, not just ones for JavaScript. What if you want to use LESS or Sass instead of CSS? Fan of Jade instead of XML we should have you covered. \n#### Per project configuration\n\nThis feature should allow usage of different version of the transpiler in different projects. For example you can use TypeScript 1.4 for your production app but switch to the cutting edge TypeScript 1.5 in your new project.\n#### Ability to to start with transpiler or enable it on the go\n\nWe believe that the barrier to entry for NativeScript should be as low as the one of the Web. We shouldn't force the users to learn all the cool ES6 features or TypeScript's types system. Users should be able to enable a transpiler for an already existing project or start a new project with given transpiler if this is what they want.\n### The Command\n\nThe support will boil down to a single command that users will have to execute:\n\n``` sh\n$ tns install typescript\n```\n\nor\n\n``` sh\n$ tns install babel\n```\n\n~~As you can see we have not settled on the command name :smile: We did a little brainstorming sessions internally and we come up with `enable` (ex. `$ tns enable babel`) however this sounds too broad and we are not totally sold on it. If you have ideas how we can better name this command please file them in the comments.~~\n### Implementation details\n\nHere are some internal and more technical implementation details:\n- We plan to add the transpilation code itself in a form of project level hooks. The given transpiler hooks will come in the form of a separate npm package that will be \"hooked\" in the current NativeScript project. \n- All transpilation tools will be added as `devDependencies` to the project's `package.json`.\n# Work breakdown\n### v1.5\n#### TypeScript support\n- [x] `tns install typescript` command. The compiler should be added as `devDependency`.\n- [x] Consume TypeScript declarations from the `tns-core-modules` package.\n- [x] Generate `tsconfig.json` if not present.\n- [x] Add a project level hook that will do the actual transpilation.\n#### Babel support\n### Future ideas\n#### TypeScript support for NativeScript plugins\n\n\u003c!---\n@huboard:{\"custom_state\":\"archived\"}\n-->\n","author":{"url":"https://github.com/ligaz","@type":"Person","name":"ligaz"},"datePublished":"2015-05-21T15:24:21Z","url":"https://github.com/NativeScript/nativescript-cli/issues/493"}
| 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:f9b96418-9141-ef55-fd9e-ae3ddeca56a3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C214:4BB79:1AFABF8:2265E0F:6B015681 |
| html-safe-nonce | 5bb21969e7c35480afdf74e88bf33425935756c749f3887efe11ae9770326f64 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjE0OjRCQjc5OjFBRkFCRjg6MjI2NUUwRjo2QjAxNTY4MSIsInZpc2l0b3JfaWQiOiI0MTE5NDQ3MjkwNjQ4NTUxNzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2afb8ed01fc9e8ddb958b68d7e9feb2694adf2f0b1d8a5caba5b48bdb00b925e |
| hovercard-subject-tag | issue:79043290 |
| 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/NativeScript/nativescript-cli/493/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b6353c8838f3db1a49437c7412988e4122a1040d1c3d964fc437436aadeca168/NativeScript/nativescript-cli/issues/493 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b6353c8838f3db1a49437c7412988e4122a1040d1c3d964fc437436aadeca168/NativeScript/nativescript-cli/issues/493 |
| og:image:alt | A common request we have received in the last couple of months is the ability to enable (or start with) JavaScript transpilers for a given NativeScript project. The usual suspects are TypeScript an... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ligaz |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 21347346 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21347346 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-cli |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width