NativeScript / nativescript-dev-typescript

TypeScript support for NativeScript projects
Apache License 2.0
21 stars 10 forks source link

TS custom component code files ignored #69

Open ludwiktrammer opened 5 years ago

ludwiktrammer commented 5 years ago

Which platform(s) does your issue occur on?

I tested on Android 8 via emulator, with --bundle.

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

I'm not sure if I should add this ticket here or in the main NativeScript bug tracking system. Guidance will be appreciated.

NativeScript allows for the creation of custom components. It seems that with NativeScript 5 custom component's .ts files are ignored. They are present in the bundle, but they are not used when loading the component. If one ueses .js files instead, the problem disappears.

  1. Follow the steps from the official documentation's "XML-based Custom Component with a Code File" section to create and load a custom component - using the TypeScript version of code samples.
  2. Run the application tns run android --bundle.
  3. Observe that "Custom Component Loaded" is never printed to the console.
  4. Delete app/components/my-control.ts and add app/components/my-control.js with the JS version of the code sample.
  5. Run the code again and observe that now "Custom Component Loaded" got printed to the console.

Is there any code involved?

Official code samples from "XML-based Custom Component with a Code File".