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

Update nodejs SDK to use optional chaining in constructor #959

Merged
merged 3 commits into from
Jan 23, 2020

Conversation

lblackstone
Copy link
Member

Proposed changes

Related issues (optional)

Copy link
Member

@lukehoban lukehoban left a comment

Choose a reason for hiding this comment

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

Are we okay taking a dependency on TypeScript 3.7 features? I'm not positive we have any strict dependency on 3.7 yet. We recently bumped the typescript version we bring along in @pulumi/pulumi, and may have bumped to a version that supports this - inn which case we should ensure that @pulumi/kubernetes requires a new enough version to ensure it gets this version of TypeScript.

Also - I assume these get erased back down to && by the TypeScript compiler? I believe Node itself does not yet support ?. natively.

@lblackstone
Copy link
Member Author

Are we okay taking a dependency on TypeScript 3.7 features? I'm not positive we have any strict dependency on 3.7 yet. We recently bumped the typescript version we bring along in @pulumi/pulumi, and may have bumped to a version that supports this - inn which case we should ensure that @pulumi/kubernetes requires a new enough version to ensure it gets this version of TypeScript.

It got pulled in from @pulumi/pulumi, so I assumed it was safe to rely on 3.7 features. LMK if that's not the case.

Also - I assume these get erased back down to && by the TypeScript compiler? I believe Node itself does not yet support ?. natively.

Here's what the resulting JS looks like:

        props["data"] = (_a = args) === null || _a === void 0 ? void 0 : _a.data;

from this TS:

          props["data"] = args?.data;

@lukehoban
Copy link
Member

Here's what the resulting JS looks like:

Kind of humorous that we are making one layer of code generation "nicer", which leads the next layer of code generation to be net less nice :-).

@lblackstone lblackstone merged commit bcdbc9e into master Jan 23, 2020
@pulumi-bot pulumi-bot deleted the lblackstone/optional-chaining branch January 23, 2020 18:16
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

3 participants