Skip to content

[gen-ts-declarations] Transitive mixins from external packages are not discovered #3505

Description

@web-padawan

The following code results in a warning and does not produce correct output.

import { DirMixin } from '@vaadin/vaadin-element-mixin/vaadin-dir-mixin.js';

/**
 * @polymerMixin
 * @mixes DirMixin
 */
export const ItemMixin = superClass => class VaadinItemMixin extends DirMixin(superClass) {
  // mixin contents
}

Warning

export const ItemMixin = superClass => class VaadinItemMixin extends DirMixin(superClass) {
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

warning [GEN_TYPESCRIPT_DECLARATIONS_WARNING] - Found 0 features for mixin DirMixin, expected 1.

Expected Output

declare function ItemMixin<T extends new (...args: any[]) => {}>(base: T): T & ItemMixinConstructor & DirMixinConstructor;

interface ItemMixin extends DirMixin {
  // mixin contents
}

Actual Output

declare function ItemMixin<T extends new (...args: any[]) => {}>(base: T): T & ItemMixinConstructor;

interface ItemMixin {
  // mixin contents
}

Note

I was able to track this down to this method call:

And now I feel like 3rd party mixins are not picked up by analyzePackage() 🤔

@aomarks any suggestions?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions