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

Support Fields #2

Merged
merged 3 commits into from
Nov 5, 2015
Merged

Support Fields #2

merged 3 commits into from
Nov 5, 2015

Conversation

mprobst
Copy link
Contributor

@mprobst mprobst commented Nov 2, 2015

No description provided.

@mprobst
Copy link
Contributor Author

mprobst commented Nov 2, 2015

Note that this is based on #1.

@rkirov
Copy link
Contributor

rkirov commented Nov 4, 2015

no diffbase :( I will take a look again tomorrow after you submit #1

@mprobst mprobst force-pushed the fields branch 3 times, most recently from a69706d to ffdde64 Compare November 4, 2015 12:20
@mprobst
Copy link
Contributor Author

mprobst commented Nov 4, 2015

Should be more reviewable now.

}
// Emit a synthetic ctor.
// TODO(martinprobst): Handle inherited parent ctors.
this.writeTextBetween(classNode, classNode.getFullStart(), classNode.getLastToken());
Copy link
Contributor

Choose a reason for hiding this comment

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

every single call in this cl passes writeTextBetween(node, node.getFullStart(), child) maybe create a helped writeTextUntilChild(node, child)

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, I'm not happy with these functions. There are users that pass a write offset; I split it into two functions.

@rkirov
Copy link
Contributor

rkirov commented Nov 5, 2015

I think you have a few features that have no tests, otherwise LGTM.

Closure Compiler interprets accesses in the constructor as field declarations.
When the code has no side effects, in particular no assignment, this is called
a stub declaration.

This change prints such a stub declaration, including a type annotations, for
each field of each class.
- Properly print file names
- Print the source that failed to parse
- Check generated sources in Closure Compiler strict mode.
  This makes sure we don't forget to generate some field or variable.
- start `gulp watch`ing without testing first.
  This allows to start up gulp watch with failing tests.
@mprobst mprobst merged commit ce40815 into master Nov 5, 2015
@mprobst mprobst deleted the fields branch November 6, 2015 05:55
hess-g added a commit to hess-g/tsickle that referenced this pull request Sep 20, 2016
angular#180
- Minor cleanup comments I missed in the first update.
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