Skip to content

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

Closed

Description

@pavelsavara

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.

Activity

  1. added this to the 7.0.0 milestone on Nov 6, 2021
  2. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Nov 6, 2021
  3. removed
    untriagedNew issue has not been triaged by the area owner
    on Nov 6, 2021
  4. pavelsavara commented on Nov 8, 2021

    @pavelsavara
    MemberAuthor

    @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"

  5. ilonatommy commented on Jun 21, 2022

    @ilonatommy
    Member

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

  6. pavelsavara commented on Jun 21, 2022

    @pavelsavara
    MemberAuthor

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

  7. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 11, 2022
  8. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jul 11, 2022
  9. ghost locked as resolved and limited conversation to collaborators on Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions