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

[feat] script.integrity and import map #286

Closed
loynoir opened this issue Sep 30, 2022 · 2 comments
Closed

[feat] script.integrity and import map #286

loynoir opened this issue Sep 30, 2022 · 2 comments

Comments

@loynoir
Copy link

loynoir commented Sep 30, 2022

Background

  • There is Subresource Integrity for old days javascript.
  • deno support import map, and invent own lock file.
  • node not yet support import map.

Feat

Now, there is ESM. I think there should have a concept update combine two, in flavor of each dependency manager reinvent different lock file.

  "imports": {},
  "scopes": {},
  "integrity": {} | ./lock/file/relative/path/to/import/map,

Additional

As ESM system differ from legacy system, I think, should iter into the inner most dependency, and update field integrity or file flatly.

Related

nodejs/node#44830

Thoughts

  • For relative path, should be compact for both filesystem and network.
  • Maybe allow .integrity as a url. Maybe user can store their import map in their dotfile repo?
  • Maybe design .integrity as an Array<Record<string,string>>, and when importId not uniq, throw error.

Security

Maybe split integrity outside import map ?

Like golang proxy.golang.org and sum.golang.org.

@jkrems
Copy link
Contributor

jkrems commented Sep 30, 2022

Is this the same as https://github.com/guybedford/import-maps-extensions#integrity? If so, maybe this existing issue might be interesting: #221

@loynoir
Copy link
Author

loynoir commented Sep 30, 2022

Kind of duplicate.

@loynoir loynoir closed this as completed Sep 30, 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

2 participants