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

[wasm] avoid eval, design better API for InvokeJS #61287

Closed
pavelsavara opened this issue Nov 6, 2021 · 4 comments · Fixed by #71932
Closed

[wasm] avoid eval, design better API for InvokeJS #61287

pavelsavara opened this issue Nov 6, 2021 · 4 comments · Fixed by #71932
Assignees
Milestone

Comments

@pavelsavara
Copy link
Member

After change #61212 Rollup started producing warning about eval.

(!) Use of eval is strongly discouraged
  https://rollupjs.org/guide/en/#avoiding-eval
  method-calls.ts

We could suppress it globally, but it's not ideal.

{
  onwarn(warning, warn) {
    if (warning.code === 'EVAL') return
    warn(warning)
  }
}

As @lewing suggested, we should consider deprecating the method, since it's only internal API.

@pavelsavara pavelsavara added this to the 7.0.0 milestone Nov 6, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 6, 2021
@ghost
Copy link

ghost commented Nov 6, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

After change #61212 Rollup started producing warning about eval.

(!) Use of eval is strongly discouraged
  https://rollupjs.org/guide/en/#avoiding-eval
  method-calls.ts

We could suppress it globally, but it's not ideal.

{
  onwarn(warning, warn) {
    if (warning.code === 'EVAL') return
    warn(warning)
  }
}

As @lewing suggested, we should consider deprecating the method, since it's only internal API.

Author: pavelsavara
Assignees: pavelsavara, maraf
Labels:

arch-wasm, area-System.Runtime.InteropServices.JavaScript

Milestone: 7.0.0

@pavelsavara pavelsavara removed the untriaged New issue has not been triaged by the area owner label Nov 6, 2021
@pavelsavara
Copy link
Member Author

@kg said in chat:
"maybe we solve it with source generators and then you can invoke that with the new invoke api
use an icall to register each invokejs blob at startup
and then those have unique ids you use to invoke them
that would let us use new Function since it's once"

@ilonatommy
Copy link
Member

@pavelsavara, @maraf, have you tried using the idea with new API? Any thought on that?

@pavelsavara
Copy link
Member Author

This is related to CSP and I think we would be able to at least reduce it.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 11, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 11, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants