Skip to content

fix: explictly declare types for mixin base classes #12876

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

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

jelbourn
Copy link
Member

As of TypeScript 2.9, tsc will inline imports for inferred types with
the import("...") syntax. However, this inlining happens after
paths are resolved. This means that in places where we import from
@angular/material/core in source end up having relative paths (e.g.
../core/common-behaviors/index) in the generated d.ts files. These
relative import paths become incorrect when moved into our package
structure, breaking downstream apps.

cc @IgorMinar, @devversion FYI

@jelbourn jelbourn added the target: major This PR is targeted for the next major release label Aug 28, 2018
@jelbourn jelbourn requested review from crisbeto and mmalerba August 28, 2018 23:43
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 28, 2018
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM


export const _MatButtonMixinBase:
Copy link
Member

Choose a reason for hiding this comment

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

These mixins are getting more and more inconvenient to consume :/

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to file an issue with TypeScript to see if they can be smarter about keeping the original import paths

Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

LGTM. (sample of the generated import() statements for later reference: here)

We could probably also fix this by moving the typings/ directories on directory up (in the release output). But this is not really that predictable than just being explicit.

@@ -39,7 +39,7 @@ export class SelectionModel<T> {
/**
* Event emitted when the value has changed.
* @deprecated Use `changed` instead.
* @breaking-change 8.0.0 To be changed to `changed`
* @deletion-target 8.0.0 To be changed to `changed`
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this stay as @breaking-change?

As of TypeScript 2.9, tsc will inline imports for inferred types with
the `import("...")` syntax. However, this inlining happens *after*
`paths` are resolved. This means that in places where we import from
`@angular/material/core` in source end up having relative paths (e.g.
`../core/common-behaviors/index`) in the generated d.ts files. These
relative import paths become incorrect when moved into our package
structure, breaking downstream apps.
@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Aug 29, 2018
@jelbourn jelbourn merged commit 515912b into angular:master Aug 29, 2018
crisbeto added a commit to crisbeto/material2 that referenced this pull request Aug 30, 2018
Removes a workaround that was initially introduced to get angular#12182 through. The root issue has been resolved in angular#12876.
jelbourn pushed a commit that referenced this pull request Aug 30, 2018
Removes a workaround that was initially introduced to get #12182 through. The root issue has been resolved in #12876.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants