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

Implement draft RPC API. #95

Merged
merged 7 commits into from
Mar 4, 2021
Merged

Implement draft RPC API. #95

merged 7 commits into from
Mar 4, 2021

Commits on Mar 3, 2021

  1. Implement draft RPC API.

    Remove old Callback mechanism.
    
    * Remove obsolete Callback API
    * Remove FuncCall and RPC
    * Update README
    * Rename set_rpc_handler() to set_handler()
    * Use shared rpc_proxy() function for platform consistency
    * Improve handling of promise cleanup
    * Update README with RPC API info.
    * Panic if webview handler is set after window creation.
    * Improve rpc_proxy() logic, try to ensure any corresponding promise is always removed.
    * Remove FuncCall wrapper.
    tmpfs committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    87d337e View commit details
    Browse the repository at this point in the history
  2. Remove set_handler().

    Use second argument to add_window_with_configs() to set an RpcHandler.
    tmpfs committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    180caa6 View commit details
    Browse the repository at this point in the history
  3. Fix windows type signature.

    tmpfs committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    d88cd8e View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2021

  1. Configuration menu
    Copy the full SHA
    46e1b03 View commit details
    Browse the repository at this point in the history
  2. Remove promise fallback clean up code.

    So that rust rpc handlers can perform asynchronous tasks and defer
    promise evaluation until later.
    
    If an rpc handler returns None then the handler takes responsibility for
    ensuring the corresponding promise is resolved or rejected. If the
    request contains an `id` then the handler *must* ensure it evaluates
    either `RpcResponse::into_result_script()` or
    `RpcResponse::into_error_script()`.
    tmpfs committed Mar 4, 2021
    Configuration menu
    Copy the full SHA
    6490bf4 View commit details
    Browse the repository at this point in the history
  3. Remove Sync bound from RpcHandler.

    Update multiwindow example so it is slightly more illustrative of
    a real-world use case. Now it launches a window when a button is clicked
    in the main webview. Multiple windows can be launched and the URL for
    the new window is passed from the Javascript code.
    tmpfs committed Mar 4, 2021
    Configuration menu
    Copy the full SHA
    c63cc79 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1dfce3a View commit details
    Browse the repository at this point in the history