test: add test for optimized output#373
Merged
bcoe merged 4 commits intoyargs:masterfrom Jun 20, 2021
Merged
Conversation
e28d7b0 to
3109d97
Compare
3109d97 to
f4830db
Compare
hybrist
commented
Apr 9, 2021
| 'guessed boolean negation') | ||
|
|
||
| // Default values for types: | ||
| deepEqual( |
f4830db to
5e46c91
Compare
hybrist
commented
Apr 9, 2021
| @@ -0,0 +1 @@ | |||
| ../../lib No newline at end of file | |||
Contributor
Author
There was a problem hiding this comment.
I needed to add a symlink so that we both get a fresh project root and not have generated closure namespaces with .. in them.
hybrist
commented
Apr 9, 2021
test/tscc/package.json
Outdated
| "name": "optimized-test", | ||
| "version": "0.0.0", | ||
| "dependencies": { | ||
| "@tscc/tscc": "^0.6.4" |
Contributor
Author
There was a problem hiding this comment.
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
Member
|
@jkrems awesome, thank you for adding this test 👍 |
Contributor
Author
|
Would you want to combine the two PRs into one? Or is there anything missing on my end to enable landing this? |
bcoe
approved these changes
Jun 20, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a test that optimizes the TypeScript using
@tscc/tsccwhich 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.