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

No export for EventImpl #7642

Open
1 task done
justin-hackin opened this issue Mar 29, 2024 · 2 comments
Open
1 task done

No export for EventImpl #7642

justin-hackin opened this issue Mar 29, 2024 · 2 comments

Comments

@justin-hackin
Copy link

justin-hackin commented Mar 29, 2024

Reduced Test Case

https://stackblitz.com/edit/github-ebfzwk?file=src%2Findex.jsx

Do you understand that if a reduced test case is not provided, we will intentionally delay triaging of your ticket?

  • I understand

Which connector are you using (React/Angular/etc)?

No connector (vanilla JS)

Bug Description

When you look up the TS type of the event object and import EventImpl as a type, because it is not exposed in the package, you end up with an import to @fullcalendar/core/internal. This is problematic because it causes tsc to look inside the package and it is littered with some TS errors which break one's project and there's no way to prevent this with tsconfig exclude ( reference ).

This type is important when designing, for example, a modal that will render event details. It should be importable from @fullcalendar/core along with any other types in the API surface of both the core and React library.

If you are looking for a workaround, what I did was create a file called ts-ignored.ts, added it to tsconfig exclude, and then I imported and then exported the fullcalendar type from there.

@justin-hackin
Copy link
Author

When a developer uses the workaround to import types, I believe it results in the unfortunate consequence that automatic react imports in IDEs are ambiguous and need a select dialog which contains preact and react imports 😖

@justin-hackin justin-hackin changed the title Inadequate TS support No export for EventImpl Mar 31, 2024
@justin-hackin
Copy link
Author

Here's a sneaky way to introspect the type without dragging this project's code into tsc checks:

import type { CalendarApi } from '@fullcalendar/core';
type EventImpl = Parameters<CalendarApi['addEvent']>[0];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants