Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

fix: do not return empty struct if there is no compile action#326

Closed
devversion wants to merge 1 commit intobazelbuild:masterfrom
devversion:fix/replay-params-empty-struct
Closed

fix: do not return empty struct if there is no compile action#326
devversion wants to merge 1 commit intobazelbuild:masterfrom
devversion:fix/replay-params-empty-struct

Conversation

@devversion
Copy link
Contributor

Currently if there is no action for a ts_library that just declares .d.ts files, the replay_params will be set to an empty struct. Design-wise this does not make any sense because there is nothing to be "replayed".

This fixes an issue where the Angular Bazel rules throw an exception if there are "replay_params", but are referring to a struct that does not include the "outputs" property.

  target.typescript.replay_params.outputs
struct' object has no attribute 'outputs'

Currently if there is no action for a `ts_library` that just declares
`.d.ts` files, the `replay_params` will be set to an empty struct.
Design-wise this does not make any sense because there is nothing to be
"replayed".

This fixes an issue where the Angular Bazel rules throw an exception if
there are "replay_params", but are referring to a struct that does not
include the "outputs" property.

```
  target.typescript.replay_params.outputs
struct' object has no attribute 'outputs'
```
devversion added a commit to devversion/angular that referenced this pull request Dec 2, 2018
…tputs

In some applications, developers define a `ts_library` that just consists of `d.ts` files (e.g. to type `module.id`; see: https://github.com/angular/material2/blob/master/src/module-typings.d.ts), and expect the `esm5.bzl` file to not throw an error like:

```
  target.typescript.replay_params.outputs
struct' object has no attribute 'outputs'
```

The "replay_parameters" property will exist in that case, but is set to "None" because there is no action that should be replayed in favor of producing ES5 outputs. See: bazelbuild/rules_typescript#326. Notice that this right now breaks similarly because an empty `struct()` is returned that does not have a property called `outputs`. [angular#326](bazelbuild/rules_typescript#326) fixes that by being explicit that there is no _action_ at all.
@alexeagle alexeagle closed this in f9d6edb Dec 4, 2018
IgorMinar pushed a commit to angular/angular that referenced this pull request Dec 5, 2018
…tputs (#27401)

In some applications, developers define a `ts_library` that just consists of `d.ts` files (e.g. to type `module.id`; see: https://github.com/angular/material2/blob/master/src/module-typings.d.ts), and expect the `esm5.bzl` file to not throw an error like:

```
  target.typescript.replay_params.outputs
struct' object has no attribute 'outputs'
```

The "replay_parameters" property will exist in that case, but is set to "None" because there is no action that should be replayed in favor of producing ES5 outputs. See: bazelbuild/rules_typescript#326. Notice that this right now breaks similarly because an empty `struct()` is returned that does not have a property called `outputs`. [#326](bazelbuild/rules_typescript#326) fixes that by being explicit that there is no _action_ at all.

PR Close #27401
IgorMinar pushed a commit to angular/angular that referenced this pull request Dec 5, 2018
…tputs (#27401)

In some applications, developers define a `ts_library` that just consists of `d.ts` files (e.g. to type `module.id`; see: https://github.com/angular/material2/blob/master/src/module-typings.d.ts), and expect the `esm5.bzl` file to not throw an error like:

```
  target.typescript.replay_params.outputs
struct' object has no attribute 'outputs'
```

The "replay_parameters" property will exist in that case, but is set to "None" because there is no action that should be replayed in favor of producing ES5 outputs. See: bazelbuild/rules_typescript#326. Notice that this right now breaks similarly because an empty `struct()` is returned that does not have a property called `outputs`. [#326](bazelbuild/rules_typescript#326) fixes that by being explicit that there is no _action_ at all.

PR Close #27401
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants