Skip to content

chore(dialog): add generic param for config data - #7447

Merged
andrewseguin merged 1 commit into
angular:masterfrom
crisbeto:4398/dialog-generic
Oct 12, 2017
Merged

chore(dialog): add generic param for config data#7447
andrewseguin merged 1 commit into
angular:masterfrom
crisbeto:4398/dialog-generic

Conversation

@crisbeto

@crisbetocrisbeto commented Sep 30, 2017

Copy link
Copy Markdown
Member

Adds a generic parameter to the MatDialogConfig that indicates the type of its data.

BREAKING CHANGE: Material now requires at least TypeScript 2.4.

Fixes#4398.

@googlebotgooglebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Sep 30, 2017
* Configuration for opening a modal dialog with the MatDialog service.
*/
export class MatDialogConfig {
export class MatDialogConfig<D = any> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't this require TS 2.3 or 2.4?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

We're at ~2.4.2.

@jelbournjelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@jelbournjelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Oct 11, 2017
@jelbourn

jelbourn commented Oct 11, 2017

Copy link
Copy Markdown
Contributor

We may use 2.4, but I don't think we ever officially said that we require greater than 2.2. Can you add a BREAKING CHANGE message for that?

Adds a generic parameter to the `MatDialogConfig` that indicates the type of its `data`.
BREAKING CHANGE: Material now requires at least TypeScript 2.4.
Fixesangular#4398.
@crisbeto

Copy link
Copy Markdown
MemberAuthor

Updated.

@rafaelss95

rafaelss95 commented Oct 11, 2017

Copy link
Copy Markdown
Contributor

According to this comment, the core team recommends the use of typescript@'>=2.1.0 <2.4.0' for Angular 4x. Also, you get a warning in a CLI project if you try to use typescript greater than 2.4.

More precisely:

@angular/compiler-cli@4.4.4 requires typescript@'>=2.1.0 <2.4.0' but 2.4.2 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@'>=2.1.0 <2.4.0'

@andrewseguin
andrewseguin merged commit b29ac45 into angular:masterOct 12, 2017
@angular-automatic-lock-bot

Copy link
Copy Markdown

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-botangular-automatic-lock-botBot locked and limited conversation to collaborators Sep 7, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: mergeThe PR is ready for merge by the caretakercla: yesPR author has agreed to Google's Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Make MdDialogConfig generic and use type for data property

5 participants

@crisbeto@jelbourn@rafaelss95@googlebot@andrewseguin