GithubHelp home page GithubHelp logo

Comments (7)

retog avatar retog commented on September 27, 2024 1

If methods could return async-iterators this would allow for things like live updated news or messaging feeds. Ideally, it would support both iterators of json-objects as well as iterators of Uint8Arrays for efficient binary applications.

from gentle_rpc.

retog avatar retog commented on September 27, 2024

It works using the file from client/dist/remote.js.

from gentle_rpc.

timonson avatar timonson commented on September 27, 2024

Thanks for reporting @retog . I will add a more browser compatible bundle in the next release. I will also minify it.

from gentle_rpc.

timonson avatar timonson commented on September 27, 2024

Just for the record, I run the deno bundle command with this tsconfig.json file:

{
  "compilerOptions": {
    "removeComments": true,
    "lib": ["esnext", "dom", "dom.iterable", "dom.asynciterable", "deno.ns"],
    "experimentalDecorators": true,
    "importsNotUsedAsValues": "preserve",
    "strict": true,
    "noFallthroughCasesInSwitch": false
  }
}

To make it compatible with older Safari versions I will run babel with the following babel.config.json. It transpiles classes and es-modules to compatible JavaScript.

{
  "presets": [
    [
      "@babel/env",
      {
        "modules": false
      }
    ]
  ],
  "plugins": ["@babel/plugin-proposal-class-properties"]
}

Then I will use terser to minify it.

The emitted JavaScript code will work in browsers going far back but I would welcome additional recommendations.

from gentle_rpc.

retog avatar retog commented on September 27, 2024

Thanks, @timonson!

I'm totally new to deno and haven't found out how client/dist/remote.js is generated. Using the pre-generated file the example seems to work.

Unrelated to this issue: do you plan on adding support for more type? Will a method like '() => { [Symbol.asyncIterator](): AsyncGenerator<{ hostname: string; addresses: string[]; }, void, unknown>; }'be supported?

from gentle_rpc.

timonson avatar timonson commented on September 27, 2024

Hi, I am definitely open to add abstractions. Unfortunately I am not sure if I understand your example/method correctly. Would you mind adding a little bit more context (what is the goal?) or an example to it? Thanks a lot!

from gentle_rpc.

timonson avatar timonson commented on September 27, 2024

In this folder are the compiled files. Only the http.js file supports legacy browsers. https://github.com/timonson/gentle_rpc/tree/master/client/dist

from gentle_rpc.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.