Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixin support #990

Merged
merged 17 commits into from Mar 21, 2019
Merged

Mixin support #990

merged 17 commits into from Mar 21, 2019

Conversation

canonic-epicure
Copy link
Contributor

This PR adds support for mixins, as per https://www.bryntum.com/blog/the-mixin-pattern-in-typescript-all-you-need-to-know/

The most important changes:

  • When doing "inheritance" in class and interface converters, consider the possibility for the base type to be intersection type: Type1 & Type2. In such case, "inherit" from every component of such type
  • When doing reflections merge, do not merge the reflections for type with reflections for values. This is because TypeScript has different namespaces for values and types and its perfectly valid to have different things with the same name:
export type Some = number
export const Some = () => {}
  • bumped TypeScript dependency to 3.3.x

@aciccarello
Copy link
Collaborator

Awesome! I wonder if this will help with any other reflection mergin issues we have.

@aciccarello
Copy link
Collaborator

So the build passed on Node 10 but not node 6 because of a tslint error. That seems strange...

ERROR: /home/travis/build/TypeStrong/typedoc/src/lib/converter/components.ts:9:9 - missing whitespace
ERROR: /home/travis/build/TypeStrong/typedoc/src/lib/converter/components.ts:9:18 - missing whitespace
ERROR: /home/travis/build/TypeStrong/typedoc/src/lib/output/components.ts:8:9 - missing whitespace
ERROR: /home/travis/build/TypeStrong/typedoc/src/lib/output/components.ts:8:18 - missing whitespace

Sorry it's so grouchy. 👿

@canonic-epicure
Copy link
Contributor Author

I was not changing those files, but added whitespace anyway, hopefully build will pass this time :)

Copy link
Collaborator

@aciccarello aciccarello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! This looks great. Only remaining issue is that I would like to have render tests though so we make sure this doesn't break in the future. The example is helpful but won't alert us if things change.

src/lib/converter/factories/declaration.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@aciccarello aciccarello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Work!

@aciccarello aciccarello merged commit 49602d9 into TypeStrong:master Mar 21, 2019
@canonic-epicure
Copy link
Contributor Author

@aciccarello Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants