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

AERIE-2041 - TS convert functional programing UNIT to {} #311

Merged

Conversation

goetzrrGit
Copy link
Contributor

  • Tickets addressed: AERIE-2041
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

In the mission model, the activity's effect model that doesn't return a computed attribute (aka void run() method of the activity) uses UNIT which represents a non-null empty value. This is used internally by AERIE

https://en.wikipedia.org/wiki/Unit_type

This UNIT value will be exposed to our users when command authoring. Our users are not functional programmers so this causes confusion.

This will change the computed attribute to {} which makes more sense to the user.

Verification

Ran the command expansion test locally without any issues

Documentation

None

Future work

None

@goetzrrGit goetzrrGit requested a review from a team as a code owner September 1, 2022 23:28
@goetzrrGit goetzrrGit temporarily deployed to e2e-test September 1, 2022 23:28 Inactive
@goetzrrGit goetzrrGit force-pushed the AERIE-2041--TS-library-Computed-attributes-UNIT-TO-EMPTY branch from 32f6dd3 to eb5b35e Compare September 6, 2022 18:04
@goetzrrGit goetzrrGit force-pushed the AERIE-2041--TS-library-Computed-attributes-UNIT-TO-EMPTY branch from eb5b35e to 3d164c8 Compare September 6, 2022 18:06
@goetzrrGit goetzrrGit force-pushed the AERIE-2041--TS-library-Computed-attributes-UNIT-TO-EMPTY branch from 3d164c8 to f8998f7 Compare September 6, 2022 19:12
@goetzrrGit goetzrrGit temporarily deployed to e2e-test September 6, 2022 19:13 Inactive
Copy link
Contributor

@Twisol Twisol left a comment

Choose a reason for hiding this comment

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

(I might be jumping the gun a bit on this review; sorry if so.)

@goetzrrGit
Copy link
Contributor Author

I learned a lot from this ticket. Now I found the code-gen part of Merlin. This gets propagated down to the command expansion part now and will show up as:

declare global {
	interface ThrowBanana {
		readonly type: 'ThrowBanana';
		readonly duration: Temporal.Duration;
		readonly startOffset: Temporal.Duration;
		readonly startTime: Temporal.Instant;
		readonly endTime: Temporal.Instant;
		readonly attributes: {
			readonly arguments: {
				readonly speed: number;
			}
			readonly computed: {
			};
		}
	}
	type ActivityType = ThrowBanana;
}

export {};

@goetzrrGit goetzrrGit force-pushed the AERIE-2041--TS-library-Computed-attributes-UNIT-TO-EMPTY branch from f8998f7 to 5addc85 Compare September 7, 2022 01:07
@goetzrrGit goetzrrGit temporarily deployed to e2e-test September 7, 2022 01:07 Inactive
Add a Unit Value Mapper to map the UNIT value to an empty JAVA Map. This will be interpreted by the TS library generator as {}

-- Summary --
In the mission model, the activity's effect model that doesn't return a computed attribute (aka void run() method of the activity) uses UNIT which represents a non-null empty value. This is used internally by AERIE

https://en.wikipedia.org/wiki/Unit_type

This UNIT value will be exposed to our users when command authoring. Our users are not functional programmers so this causes confusion.

This will change the computed attribute to {} which makes more sense to the user.

[AERIE-2041]
@goetzrrGit goetzrrGit force-pushed the AERIE-2041--TS-library-Computed-attributes-UNIT-TO-EMPTY branch from 5addc85 to fc43ce9 Compare September 7, 2022 21:14
@goetzrrGit goetzrrGit temporarily deployed to e2e-test September 7, 2022 21:14 Inactive
@goetzrrGit goetzrrGit merged commit 5867a90 into develop Sep 7, 2022
@goetzrrGit goetzrrGit deleted the AERIE-2041--TS-library-Computed-attributes-UNIT-TO-EMPTY branch September 7, 2022 21:27
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.

4 participants