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
Closed
fix: do not return empty struct if there is no compile action#326devversion wants to merge 1 commit intobazelbuild:masterfrom
devversion wants to merge 1 commit intobazelbuild:masterfrom
Conversation
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' ```
alexeagle
approved these changes
Nov 20, 2018
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.
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
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Currently if there is no action for a
ts_librarythat just declares.d.tsfiles, thereplay_paramswill 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.