Fix reference to deprecated handlebars type #1022
Merged
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.
from
handlebars.d.ts
:turns out it's not actually backwards compatible because
they haven't declared it as an ambient global typeof subtle differences in type acquisition (see below). but anyway, typedoc should use the new namespaced type. I've gone ahead and done that in this PR.unblocks palantir/documentalist#86
cc @styu
edit: more info
Another way to solve this would be with an
import "handlebars";
statement in any typedoc module which references a global handlebars symbol likeHandlebarsTemplateDelegate
. But adding import statements just for type acquisition side effects is bad.When handlebars switched to publishing its own types, they did a straight port of
@types/handlebars
. However, the semantics for acquiring types fromnode_modules/@types/handlebars
is a little different fromnode_modules/handlebars
. TypeScript will automatically pull in all ambient types fromnode_modules/@types
and make symbols likeHandlebarsTemplateDelegate
available, but the same is not true for types bundled in a regular npm package.Related to this (but external to this repo), there's no need for
declare module
statements in handlebars' types anymore. The type system will acquire types from the same location as the module system, sodeclare module "handlebars"
is unnecessary.