core.contracts

Does clojurescript support work for core.contracts?

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Clojurescript

Description

I have a pedestal app I am working on. I have made some really helpful (at least to me) use of core.contracts in testing my clojure/clojurescript shared code (in clojure) using test.generative. When I open my code in the browser though and try to bring a namespace that makes use of core.contracts into clojurescript, I get the following error. None of the constraints I wrote actually make use of any native java types (at least I don't think). I am mostly just checking that the values of things align with what I expect in the inputs and outputs.

In my behavior.clj I have

(ns ^:shared com.samedhi.contracts.app.behavior
(:require [clojure.string :as string]
[io.pedestal.app.messages :as msg]
[clojure.zip :as z])
(:use [clojure.core.contracts :only [contract with-constraints]]
[clojure.core.contracts.constraints :only [defconstrainedfn]]
[clojure.test :only [is]]))

which compiles into cljs as
...
goog.require('clojure.core.contracts.constraints');
goog.require('com.samedhi.quizry.app.quiz');
goog.require('clojure.core.contracts');
goog.require('clojure.test');
...

which throws a javascript exception at goog.require('clojure.core.contracts.constraints') when I look in the data-ui view, saying:

errorMessage: "goog.require could not find: clojure.core.contracts.constraints"
name: "clojure.core.contracts.constraints"

Is there some sort of special way I need to import things within clojurescript to use core.contracts?

BTW, I really appreciate core contracts, it is really neato. Thanks for you work.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: