Skip to content

TS custom component code files ignored #69

Open
@ludwiktrammer

Description

@ludwiktrammer

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:

  • CLI: 5.0.0
  • Cross-platform modules: 5.0.1
  • Runtime(s): 5.0.0 (android)
  • Plugin(s):
    • nativescript-dev-sass: 1.6.0
    • nativescript-dev-typescript: 0.7.4
    • nativescript-dev-webpack: 0.17.0

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".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions