Open gossi opened 1 year ago
I'm thinking for apps and v1 addons, we should generate a .npmrc
with resolution-mode=highest
... or make glimmer v1.
this is mostly a problem pre v1 where every version is a breaking change, and we don't want to install the "lowest in-range version for maximum compatibility testing" (which is why the behavior exists).
For those running in to this right now though, you can work around the issue by setting overrides/resolutions for @glimmer/validator
(and any other @glimmer package you see pre v0.84), and pin it to ~ v84 (or whatever the latest is)
example: https://github.com/NullVoxPopuli/limber/blob/main/package.json#L47-L52
"pnpm": {
"overrides": {
"@glimmer/compiler": "^0.84.3",
"@glimmer/syntax": "^0.84.3",
"@glimmer/validator": "^0.84.3",
"@glimmer/reference": "^0.84.3",
"@glimmer/manager": "^0.84.3",
"@glimmer/interfaces": "^0.84.3",
@NullVoxPopuli there's also @glimmer/util
which also is duplicated with an old version because of @glimmer/component
.
I was diagnosing a type checking issue that happens when using ember-source
based types with a fresh application generated from ember-cli@5.1.0 (read more here). The type checking error happened because older versions of @glimmer/validator
were installed by default.
I updated my .npmrc
with resolution-mode=highest
, deleted my pnpm lock file/node modules, and re-ran pnpm install
to try to fix the issue. The older versions of @glimmer/validator
were still installed -- so the type checking error persisted.
I then updated my package.json
with the pnpm overrides suggested above and ran pnpm install
. This does resolve the type checking issue.
A separate troubleshooting step I took was to install ember-cli@5.2.0-beta.0, generate a new application from that, and test. After generating the application, I updated global.d.ts
to import the ember-source
types, and removed the appropriate @types/ember*
packages. This worked without encountering any type checking issues.
Heyo,
I was updating my OSS packages the past days and was happy to see the typescript changes in action, this is amazing 🎉👏
Typescript support was delievered out of the box, after I upgraded those packages. Except, I had to pull in an updated dependency of
@glimmer/validator
- which my guess is one of these packages needs to declare this as dependency itself - I dunno which one though (which I'm opening the ticket for)Here is the main packages I upgraded to make this work. This is an ember (test) app (with
ember-cli-typescript
) (usually as part of an addon v2), so pretty basic and "empty". Here are the relevant dependencies:Here is
types/index.d.t.s
for completeness (link for repo at the end):so, these are the
@types/*
packages left, that are still needed (for me). When I runtsc --noEmit
, I'm down to this error:This is trying to consume
@glimmer/validator@v0.44.0
but at the time of writing this,@glimmer/validator
is available in versionv0.84.2
- almost quite doubled the version. When I add this as dev dependency:@glimmer/validator@v0.84.2
- then checking for types does not complain anything.Reference repo: https://github.com/gossi/frontend-configs/tree/main/testing/ember-app
Ref: #20162