You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.
Motivation
Our types setup is so weird, we sometimes run into weird issues. For example, because many packages use a handwritten d.ts file as the types entry point, TS doesn't realize there's a default export at all! This problem is not huge, because most of the time people don't directly import plugin packages, but it can be absurdly problematic if you write an enhancement plugin.
For declaration files with ambient modules, I've kept them ambient for now, but we should figure out a way to use tsconfig paths option so we don't need to hand-write module declarations; for those without any ambient modules, I simply pointed the types entry point to the compiled output. This is how any sane TS package is supposed to be structured anyways.
It's not perfect because I still didn't hand-write declarations for named exports like validateOptions, but that should be used much less frequently than the default export. This change would unblock me from writing my enhancement plugins.
These types being in the main entry point should not make them public API, though: we still retain the right to break them and change our internal data structures.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-flight checklist
Motivation
Our types setup is so weird, we sometimes run into weird issues. For example, because many packages use a handwritten d.ts file as the types entry point, TS doesn't realize there's a default export at all! This problem is not huge, because most of the time people don't directly import plugin packages, but it can be absurdly problematic if you write an enhancement plugin.
For declaration files with ambient modules, I've kept them ambient for now, but we should figure out a way to use tsconfig
paths
option so we don't need to hand-write module declarations; for those without any ambient modules, I simply pointed the types entry point to the compiled output. This is how any sane TS package is supposed to be structured anyways.It's not perfect because I still didn't hand-write declarations for named exports like
validateOptions
, but that should be used much less frequently than the default export. This change would unblock me from writing my enhancement plugins.These types being in the main entry point should not make them public API, though: we still retain the right to break them and change our internal data structures.