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

Type dependencies should be pinnable and/or be from same build #292

Closed
jason0x43 opened this issue Mar 28, 2022 · 0 comments
Closed

Type dependencies should be pinnable and/or be from same build #292

jason0x43 opened this issue Mar 28, 2022 · 0 comments

Comments

@jason0x43
Copy link

Type dependencies are not always consistent within a build, and sometimes change over time for a given build of a package. I have mostly seen this problem with react and react-dom, which will sometimes use different type dependencies for the same packages, even when pinned.

This may be related to #234.

For example, in a current project I'm importing build 68 of react and react-dom:

{
  "imports": {
    "react": "https://esm.sh/react@17.0.2?pin=v68",
    "react-dom": "https://esm.sh/react-dom@17.0.2?pin=v68"
  }
}

If I run deno info mod.ts for my project, I see the following imports for react:

│ │ │ │ └─┬ https://esm.sh/react@17.0.2?pin=v68 (172B)
│ │ │ │   ├─┬ https://cdn.esm.sh/v68/@types/react@17.0.39/index.d.ts (148.34KB)
│ │ │ │   │ ├── https://cdn.esm.sh/v68/@types/react@17.0.39/global.d.ts (7.01KB)
│ │ │ │   │ ├── https://cdn.esm.sh/v68/@types/prop-types@15.7.4/index.d.ts (3.58KB)
│ │ │ │   │ ├── https://cdn.esm.sh/v68/@types/scheduler@0.16.2/tracing.d.ts (4.03KB)
│ │ │ │   │ └── https://cdn.esm.sh/v68/csstype@3.0.11/index.d.ts (850.38KB)

And for react-dom:

│ │ └─┬ https://esm.sh/react-dom@17.0.2/server?pin=v68 (193B)
│ │   ├─┬ https://cdn.esm.sh/v68/@types/react-dom@17.0.13/server~.d.ts (1.89KB)
│ │   │ └─┬ https://cdn.esm.sh/v73/@types/react@17.0.42/index.d.ts (148.44KB)
│ │   │   ├── https://cdn.esm.sh/v73/@types/react@17.0.42/global.d.ts (7.01KB)
│ │   │   ├── https://cdn.esm.sh/v73/csstype@3.0.11/index.d.ts (850.38KB)
│ │   │   ├── https://cdn.esm.sh/@types/prop-types@15.7.4/index.d.ts (3.58KB)
│ │   │   └── https://cdn.esm.sh/@types/scheduler@0.16.2/tracing.d.ts (4.03KB)

The versions for @types/react are different for the react and react-dom dependencies, causing errors while type checking. Type dependencies can also change when new builds are published, even when a project has pinned dependencies, meaning that a build that works on one machine may break when run on another due to different package versions being downloaded.

@ije ije closed this as completed in 6ab74c6 Apr 4, 2022
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

No branches or pull requests

1 participant