-
Notifications
You must be signed in to change notification settings - Fork 118
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
test: add test for optimized output #373
Conversation
e28d7b0
to
3109d97
Compare
3109d97
to
f4830db
Compare
'guessed boolean negation') | ||
|
||
// Default values for types: | ||
deepEqual( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion fails before #371.
f4830db
to
5e46c91
Compare
@@ -0,0 +1 @@ | |||
../../lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed to add a symlink so that we both get a fresh project root and not have generated closure namespaces with ..
in them.
test/tscc/package.json
Outdated
"name": "optimized-test", | ||
"version": "0.0.0", | ||
"dependencies": { | ||
"@tscc/tscc": "^0.6.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bad news here: It's using a slightly different version of TypeScript (3.9?) right now.
5e46c91
to
394d64e
Compare
394d64e
to
1cb035b
Compare
@jkrems awesome, thank you for adding this test 👍 |
Would you want to combine the two PRs into one? Or is there anything missing on my end to enable landing this? |
This adds a test that optimizes the TypeScript using
@tscc/tscc
which combines tsickle and closure compiler with advanced optimizations. The test acts as a rough validation that the library doesn't break when properties are renamed.Closure compiler will aggressively strip fields or rename them if it thinks they are unused or that it knows all possible use sites. The TypeScript types can already take care of most of the issues but a big exception is meta programming: Dynamic property lookups and -writes need to happen via quoted or bracketed access.