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

Targeted shimming #37

Closed
dsherret opened this issue Nov 17, 2021 · 4 comments · Fixed by #72
Closed

Targeted shimming #37

dsherret opened this issue Nov 17, 2021 · 4 comments · Fixed by #72
Assignees
Labels
enhancement New feature or request

Comments

@dsherret
Copy link
Member

Right now the shim is too broad, for example #36 and the shim being injected for something like setTimeout and setInterval. It is also not ideal for any package that uses the shim to have to depend on undici because of deno.ns.

  1. We should probably only use deno.ns for the deno namespace shimming and everything else can be injected into the build output based on if it's used.
  2. Maybe instead of having deno.ns as a dependency of the output, we could analyze which parts of the Deno namespace are used and then bundle those parts in the final output.
@dsherret dsherret added the enhancement New feature or request label Nov 17, 2021
@bebraw
Copy link

bebraw commented Nov 17, 2021

Do you think it would make sense for the users to say target browser only? Then it might be simpler on your end (no need for analysis).

@zandaqo
Copy link

zandaqo commented Nov 17, 2021

Do you think it would make sense for the users to say target browser only? Then it might be simpler on your end (no need for analysis).

or simply opt out (in) of using shims in general.

@zandaqo
Copy link

zandaqo commented Nov 18, 2021

I've just tried 0.7.2, now it doesn't shim Response/Request in the resulting js files, but still uses it in declaration files. That is, type Response turns into denoShim.Response.

@dsherret
Copy link
Member Author

This is implemented and released now. See https://github.com/denoland/dnt#shims for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants