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

use TypeScript #40

Merged
merged 5 commits into from
Nov 4, 2022
Merged

use TypeScript #40

merged 5 commits into from
Nov 4, 2022

Conversation

turadg
Copy link
Member

@turadg turadg commented Nov 3, 2022

Builds on recent work in Agoric/agoric-sdk#6500 to export types.

Where I'd like to get to is no need to manually define here any types here that come from agoric-sdk. There's more work to do but this at least drops ertp.d.ts and makes imports easier by using .ts syntax.

@turadg turadg requested a review from samsiegart November 3, 2022 22:21
import { useAtomValue } from 'jotai';

import AssetListItem from 'components/AssetListItem';
import ListItem from 'components/ListItem';
import SkeletonListItem from 'components/SkeletonListItem';
import { displayFunctionsAtom } from 'store/app';

// Ambient
import '@agoric/ertp/src/types.js';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it appropriate to use import type here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally but the problem is the types needed are defined ambiently instead of in a module. We'll get there eventually but it's a lot more work Agoric/agoric-sdk#4560

src/store/app.ts Outdated
import '@agoric/ertp/src/types';
import '@agoric/zoe/src/contractSupport';
import '@agoric/wallet-backend/src/types';
import { PursesJSONState } from '@agoric/wallet-backend';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this have to be imported after the types?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure how line 11 got there. Maybe It should go back up to where it was as import type { PursesJSONState } from '@agoric/wallet-backend';

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 3, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1bba84e
Status: ✅  Deploy successful!
Preview URL: https://a4544a82.dapp-psm.pages.dev
Branch Preview URL: https://ta-import-types.dapp-psm.pages.dev

View logs

@samsiegart samsiegart self-requested a review November 3, 2022 22:52
@turadg turadg merged commit 83a0fc8 into main Nov 4, 2022
@turadg turadg deleted the ta/import-types branch November 4, 2022 14:38
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