Skip to content

Configure typed/untyped converstion from the CLI and default to typed #157

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
Jun 14, 2016

Conversation

jjudd
Copy link
Contributor

@jjudd jjudd commented Jun 13, 2016

tsickle was defaulting to untyped conversions, i.e., every TypeScript type
was converted to the Closure {?} type. Now it defaults to typed and allows
the user to configure whether types should be converted to {?} or an actual
type.

@@ -19,6 +19,9 @@ const internalExternsFileName = 'tsickle_externs.js';
interface Settings {
/** If provided, path to save externs to. */
externsPath?: string;

/** If provided, convert every type to the Closure {?} type */
isTyped: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment seems to say the opposite of what the variable name indicates, maybe just a typo.

I think this would be better expressed as an optional "untyped" field, so that it can default to falsey (either unprovided or false). At least, that's how it works in the underlying tsickle library.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch. That's what I get for copy pasting. I'll change it to untyped to keep it the same as the tsickle library.

@evmar
Copy link
Contributor

evmar commented Jun 14, 2016

I'm still working on typed mode. It's maybe close to working but I think currently it produces code that doesn't compile. Did it work for you?

See e.g. #112 and #146 .

(Once it works, I intend to remove the untyped setting completely.)

@jjudd
Copy link
Contributor Author

jjudd commented Jun 14, 2016

Ah. So that's why that was there :) I prefer having a flag, so users can at least try to use typed mode without having to modify the source.

tsickle was defaulting to untyped conversions, i.e., every TypeScript type
was converted to the Closure {?} type. Now it defaults to typed and allows
the user to configure whether types should be converted to {?} or an actual
type.
@jjudd jjudd force-pushed the typed-configuration-cli branch from 972d283 to b58235a Compare June 14, 2016 15:42
@evmar
Copy link
Contributor

evmar commented Jun 14, 2016

Makes sense, thanks for the patch!

@evmar evmar merged commit 33931b8 into angular:master Jun 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants