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

fix: all resources have name type param #357

Merged
merged 1 commit into from
May 21, 2023

Conversation

thantos
Copy link
Contributor

@thantos thantos commented May 20, 2023

No description provided.

@thantos thantos requested a review from sam-goodwin May 20, 2023 06:57
export function workflow<Input = any, Output = any>(
): Workflow<Name, Input, Output>;
export function workflow<
Name extends string = string,
Copy link
Owner

Choose a reason for hiding this comment

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

Do we need it on workflow? Does it have a representation on the cdk side? Maybe monitoring?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should be consistent. A workflow may be addressable if it supported overrides to the destination of task, injection of env variables, permission to invoke it, or analytics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same argument for transactions

sam-goodwin
sam-goodwin previously approved these changes May 20, 2023
@sam-goodwin sam-goodwin dismissed their stale review May 20, 2023 16:28

Forgot something

Copy link
Owner

@sam-goodwin sam-goodwin left a comment

Choose a reason for hiding this comment

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

I don't see the changes to the way we extract the types on the cdk side? Is it still using the export name instead of the string literal? We have code to check if the export name is the same as the string name and favor it to maintain the ide connection when it's the same.

@thantos
Copy link
Contributor Author

thantos commented May 20, 2023

They were all using the types with logic to check for "same as export name" and "different from export name".

When the Resource["name"] resolved to a string, it is always considered to be the same as the export name. (exportName extends string). Now that a type parameter is used for name in the interfaces/specs, the export name is compared to the string literal type and not string (exportName extends Name).

These all work the same as commands, tasks, and subscriptions.

For:

image

Before change:

image

After change:

image

@thantos thantos requested a review from sam-goodwin May 20, 2023 21:46
@thantos thantos merged commit 97bcdb9 into main May 21, 2023
@thantos thantos deleted the sussman/fix/all_resource_have_name branch May 21, 2023 04:24
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.

2 participants