Giter Site home page Giter Site logo

shoreleave-remote-ring's People

Contributors

abp avatar cemerick avatar ohpauleez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shoreleave-remote-ring's Issues

cemerick.shoreleave.rpc still used in documentation

The shoreleave.* namespaces are all preferred now, but the docs don't reflect that. The biggest impact is that cemerick.shoreleave.rpc has a default URI of /_fetch, whereas shoreleave.middleware.rpc uses /_shoreleave. This will cause 404's when the old namespaces are used in conjunction with the standard shoreleave remote stuffs.

getting error - Uncaught ReferenceError: shoreleave is not defined

Hi Paul,

I will appreciate if you can help me get this to work.

I have included the shoreleave dependencies in my project.clj -

             [shoreleave "0.3.0"]
             [com.cemerick/shoreleave-remote-ring "0.0.2"]
             [shoreleave/shoreleave-remote "0.3.0"]

Following is the code from my cljs file -

(ns mashup.core
(:use [webfui.framework :only [launch-app]]
[webfui.utilities :only [get-attribute clicked]])
(:use-macros [webfui.framework.macros :only [add-dom-watch add-mouse-watch]])
(:require [clojure.browser.repl :as repl])
(:require-macros [shoreleave.remotes.macros :as macros]))

(macros/letrpc data (fetch-data)
(js/alert data))

Below is the generated code from my cljs -

goog.provide("mashup.core");
goog.require("cljs.core");
goog.require("webfui.framework");
goog.require("webfui.utilities");
goog.require("clojure.browser.repl");
goog.require("webfui.utilities");
goog.require("webfui.framework");
shoreleave.remotes.http_rpc.remote_callback.call(null, "fetch-data", cljs.core.PersistentVector.EMPTY, function(data) {
alert("hello");
return alert(data)
});

And chrome gives me the following error - Uncaught ReferenceError: shoreleave is not defined

I am perplexed, I have included the shoreleave require, so also why doesnt it show up in the goog.require ?

conditional-map

defremote does not support, as fn and its derivatives (e.g. defn) do, the conditional-map that allows to validate input/output with assertion.

Sample:

(defremote calculate [quantity price tax discount]
    (-> (* quantity price)
          (* (+ 1 (/ tax 100)))
          (- discount)))
(defremote calculate [quantity price tax discount]
    {:pre [(>=  quantity 0)
              (>= price 0)
              (and (>= tax 0) (<= tax 100))
              (<= discount (* quantity price (+ 1 (/ tax 100))))]}
    (-> (* quantity price)
          (* (+ 1 (/ tax 100)))
          (- discount)))

It could be very useful for defremote to support conditional-map.

`wrap-rpc` should require an explicit map of remote fns

A global grab-bag of remotes makes it impossible to segregate them for various purposes; gh-3 w.r.t. arguments and returns, but plenty of other more common use cases (e.g. authorization, roles, etc) demand a tighter rein on what is callable.

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.