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

Unknown port types handled with unknown instead of Present #1857

Merged
merged 9 commits into from
Jul 2, 2023

Conversation

lhstrh
Copy link
Member

@lhstrh lhstrh commented Jun 19, 2023

The type constraint extends Present (with Present being the type that included all types but undefined) was inconvenient and non-standard from the perspective of TypeScript. Removing this awkwardness will probably also make it more straightforward to offer support for generic reactors in LF. See lf-lang/reactor-ts#168 for related changes made in the runtime.

Copy link
Member Author

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

Looks good, modulo suggested changes (to be applied after merging lf-lang/reactor-ts#168)

.github/workflows/ts-tests.yml Outdated Show resolved Hide resolved
core/src/main/resources/lib/ts/package.json Outdated Show resolved Hide resolved
axmmisaka added a commit to lf-lang/reactor-ts that referenced this pull request Jul 1, 2023
…and use TS Tuple (#168)

This is a squashed commit.

This commit:
1. Removed `Present` and replaced with `unknown`.
2. Removed `Args` and `Trigger` in reaction and replaced them with TypeScript Tuples.

Also see lf-lang/lingua-franca#1857 
---------

Co-authored-by: Marten Lohstroh <marten@berkeley.edu>
@lhstrh lhstrh changed the title Stop using Present type Unknown port types handled with unknown instead of Present Jul 1, 2023
@lhstrh lhstrh added the typescript Related to TypeScript target label Jul 1, 2023
@lhstrh lhstrh marked this pull request as ready for review July 1, 2023 21:05
@lhstrh lhstrh requested a review from axmmisaka July 1, 2023 21:44
@lhstrh lhstrh enabled auto-merge July 1, 2023 22:46
Copy link
Collaborator

@axmmisaka axmmisaka left a comment

Choose a reason for hiding this comment

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

lgtm, especially considering it works :^)

@lhstrh lhstrh added this pull request to the merge queue Jul 2, 2023
Merged via the queue into master with commit 8c1dccd Jul 2, 2023
@lhstrh lhstrh deleted the present-unknown branch July 2, 2023 02:22
@petervdonovan petervdonovan added the refactoring Code quality enhancement label Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Code quality enhancement typescript Related to TypeScript target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants