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

Define local types for @embroider/core, since we have no guarantees of the consuming test environment #1799

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

NullVoxPopuli
Copy link
Collaborator

This will help with ESM conversion because when our packages type check, they don't (and can't) know if they're going to be used in a Jest or QUnit test environment (or maybe an environment without either of those global types).

The approach here is that we define only what we use for when we receive args, and globals are accessed on globalThis, which we can cast to any, because we can't know what's on there.

If we want to generate all types for @embroider/addon-dev in #1766, we'll need to make sure no package that @embroider/addon-dev depends on (nor sub-packages) rely on globally provided types.

This has worked historically for us so far due to a global and single type-checking command with every set of types available at once (which is representative of how our packages can be used 😅 )

packages/core/src/messages.ts Outdated Show resolved Hide resolved
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.

None yet

2 participants