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

feat: Closure compile, golden file base tests. #1

Merged
merged 8 commits into from
Nov 4, 2015
Merged

feat: Closure compile, golden file base tests. #1

merged 8 commits into from
Nov 4, 2015

Conversation

mprobst
Copy link
Contributor

@mprobst mprobst commented Oct 18, 2015

Golden files are easier to author, and easier to
check for correctness with Closure compiler.

This also formulates tests in terms of the final
Closure style output, not the intermediate
annotated TypeScript program.

Golden files are easier to author, and easier to
check for correctness with Closure compiler.

This also formulates tests in terms of the final
Closure style output, not the intermediate
annotated TypeScript program.
@@ -73,7 +73,7 @@ gulp.task('test.unit', ['test.compile'], function(done) {
done();
return;
}
return gulp.src('build/test/**/*.js').pipe(mocha({timeout: 500}));
return gulp.src('build/test/**/*.js').pipe(mocha({timeout: 5000}));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Closure :-(

@mprobst mprobst force-pushed the golden branch 3 times, most recently from 9e8ba20 to 28d0148 Compare October 18, 2015 06:05
@mprobst
Copy link
Contributor Author

mprobst commented Oct 26, 2015

Friendly Ping @rkirov :-)

Golden files are easier to author, and easier to
check for correctness with Closure compiler.

This also formulates tests in terms of the final
Closure style output, not the intermediate
annotated TypeScript program.
The E2E tests running Closure are substantially
slower and mostly serve as only a sanity check.
... which apparently runs on rather slow machines.
Previously the test driver didn't pass the proper ES6 compiler options, which
caused the output to be down-transpiled, but also our standard-library caching
not to work.
@mprobst mprobst mentioned this pull request Nov 2, 2015
});

gulp.task('test', ['test.unit', 'test.check-format']);
gulp.task('test.e2e', ['test.compile'], function(done) {
if (hasError) {
Copy link
Contributor

Choose a reason for hiding this comment

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

interesting pattern, there has to be a better way to compose errors in tasks :) (no action required)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, gulp has no systematic way to deal with errors, and surprisingly it's still better than all the other tools in that regard...

@rkirov
Copy link
Contributor

rkirov commented Nov 4, 2015

LGTM.

This strategy of goldens works pretty well for clutz, so it is nice to have it here too.

@mprobst mprobst merged commit 36b8651 into master Nov 4, 2015
@mprobst mprobst deleted the golden branch November 4, 2015 11:46
hess-g added a commit to hess-g/tsickle that referenced this pull request Sep 22, 2016
- Cleaner determination of min/max param count.
- Use ES6 map for unique set of param and type name at each index.
- Add missing ctor tags bag for non-overloaded ctor path.
- Other minor cleanup.
mprobst added a commit that referenced this pull request Jul 11, 2018
mprobst added a commit that referenced this pull request Jul 13, 2018
copybara-service bot pushed a commit that referenced this pull request Jun 23, 2020
Imagine code like

```
import 'foo';  // #1
import * as foo from 'foo';  // #2
```

tsickle currently produces something like:

```
var tsickle_module_1_ = goog.require('foo');  // #1
var foo_1 = tsickle_module_1_;  // #2
```

Using this alias ends up confusing some JSCompiler optimization
(see bug).  We can avoid it by producing the simpler emit done
in this change, which looks instead like:

```
goog.require('foo');  // #1
var foo_1 = goog.require('foo');  // #2
```

PiperOrigin-RevId: 317391228
copybara-service bot pushed a commit that referenced this pull request Jun 23, 2020
Imagine code like

```
import 'foo';  // #1
import * as foo from 'foo';  // #2
```

tsickle currently produces something like:

```
var tsickle_module_1_ = goog.require('foo');  // #1
var foo_1 = tsickle_module_1_;  // #2
```

Using this alias ends up confusing some JSCompiler optimization
(see bug).  We can avoid it by producing the simpler emit done
in this change, which looks instead like:

```
goog.require('foo');  // #1
var foo_1 = goog.require('foo');  // #2
```

PiperOrigin-RevId: 317391228
copybara-service bot pushed a commit that referenced this pull request Jun 23, 2020
Imagine code like

```
import 'foo';  // #1
import * as foo from 'foo';  // #2
```

tsickle currently produces something like:

```
var tsickle_module_1_ = goog.require('foo');  // #1
var foo_1 = tsickle_module_1_;  // #2
```

Using this alias ends up confusing some JSCompiler optimization
(see bug).  We can avoid it by producing the simpler emit done
in this change, which looks instead like:

```
goog.require('foo');  // #1
var foo_1 = goog.require('foo');  // #2
```

PiperOrigin-RevId: 317391228
copybara-service bot pushed a commit that referenced this pull request Jun 23, 2020
Imagine code like

```
import 'foo';  // #1
import * as foo from 'foo';  // #2
```

tsickle currently produces something like:

```
var tsickle_module_1_ = goog.require('foo');  // #1
var foo_1 = tsickle_module_1_;  // #2
```

Using this alias ends up confusing some JSCompiler optimization
(see bug).  We can avoid it by producing the simpler emit done
in this change, which looks instead like:

```
goog.require('foo');  // #1
var foo_1 = goog.require('foo');  // #2
```

PiperOrigin-RevId: 317957124
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