This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-21
Channels
- # 100-days-of-code (1)
- # announcements (2)
- # beginners (164)
- # cider (23)
- # cljs-dev (30)
- # cljsjs (11)
- # cljsrn (7)
- # clojure (116)
- # clojure-boston (1)
- # clojure-dev (20)
- # clojure-finland (2)
- # clojure-italy (4)
- # clojure-nl (1)
- # clojure-uk (10)
- # clojurescript (39)
- # core-async (19)
- # cursive (43)
- # data-science (2)
- # datomic (24)
- # emacs (10)
- # figwheel-main (20)
- # fulcro (63)
- # hoplon (7)
- # hyperfiddle (7)
- # instaparse (3)
- # kaocha (1)
- # nrepl (3)
- # off-topic (170)
- # onyx (13)
- # other-languages (3)
- # parinfer (13)
- # re-frame (39)
- # reagent (5)
- # reitit (22)
- # ring-swagger (4)
- # shadow-cljs (284)
- # spacemacs (2)
- # sql (27)
- # testing (28)
- # unrepl (2)
shadow-cljs is full of treasures. Just discovered the proxy option. Works really well (except for POSTs).
for example, when running in dev, I'm talking to an API that runs on a different port number
I didn't look deeper into it, but POST requests didn't make it through the proxy. In that case I was talking to a sente endpoint which would like to upgrade the connection to a websocket.
use https://shadow-cljs.github.io/docs/UsersGuide.html#closure-defines for build specific options js/goog.DEBUG
is one of them
hi, @thheller. Today I have a clean machine build and have update the version of re-frame
. shadow-cljs
gives me so many warnings, but I think things such as Use of undeclared Var re-frame.events/java
re-frame.events/java
are not exist in the source code. The error messages are:
@cmal yeah this is due to a new check in 2.7.x. already reported here https://github.com/Day8/re-frame-10x/issues/219
[re-frame "0.10.6"]
[day8.re-frame/undo "0.3.2"]
[day8.re-frame/http-fx "0.1.7"]
[com.smxemail/re-frame-cookie-fx "0.0.2" ]
reported here for re-frame too https://github.com/Day8/re-frame/issues/514
it was actually fixed in https://github.com/Day8/re-frame/commit/3de2ff8ff3403af2fcf29f287462a36f58c7bbb0#diff-87c1083a777fb7472aa850b82f8c2def
run shadow-cljs clj-repl
and (
to check which file is actually getting used
it is 0.10.2
. I removed .shadow-cljs
and compiled again. Another question, @thheller. https://github.com/funcool/cats/blob/master/project.clj project like this uses (defproject funcool/cats ...)
, how should I require this? I use [cats.core :as m]
but shadow-cljs
tells me The required namespace "cats.core" is not available, it was required by "doumi/helper.cljs".
, while [funcool/cats.core :as m]
just syntax error
.
@cmal the defproject
name is only relevant for the dependency itself. it has nothing to do with the namespaces you use in CLJS
[cats.core :as m]
will get the error The required namespace "cats.core" is not available, it was required by "doumi/helper.cljs"
{:dependencies
[[cljs-ajax "0.7.2"]
[reagent "0.8.0-alpha2"]
[reagent-utils "0.3.1"]
[re-frame "0.10.6"]
[day8.re-frame/undo "0.3.2"]
[day8.re-frame/http-fx "0.1.7"]
[secretary "1.2.3"]
[garden "1.3.3"]
[funcool/cats "2.3.1"] ;; <- just added this line
[com.andrewmcveigh/cljs-time "0.5.2"]
[com.smxemail/re-frame-cookie-fx "0.0.2" ]
[com.taoensso/timbre "4.10.0"]
[hiccups "0.3.0"]
[thheller/shadow-cljsjs "0.0.16"]
[org.clojure/core.async "0.4.474"]]
shadow-cljs.ednshadow-cljs watch doumi
shadow-cljs - config: /Users/yuzhao/gits/mobile/cljs/shadow-cljs.edn cli version: 2.7.4 node: v10.13.0
shadow-cljs - starting ...
11月 21, 2018 6:28:38 下午 org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
11月 21, 2018 6:28:38 下午 org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/Users/yuzhao/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.KQueueSelectorProvider()
WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
shadow-cljs - server version: 2.7.4
shadow-cljs - server running at
shadow-cljs - socket REPL running on port 53798
shadow-cljs - nREPL server started on port 53800
shadow-cljs - watching build :doumi
[:doumi] Configuring build.
[:doumi] Compiling ...
^[[:doumi] Build failure:
The required namespace "cats.core" is not available, it was required by "doumi/helper.cljs".
shadow-cljs watch doumi [2h0m] ✹ ✭
shadow-cljs - config: /Users/yuzhao/gits/mobile/cljs/shadow-cljs.edn cli version: 2.7.4 node: v10.13.0
shadow-cljs - starting ...
11月 21, 2018 6:30:21 下午 org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
11月 21, 2018 6:30:21 下午 org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/Users/yuzhao/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.KQueueSelectorProvider()
WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
shadow-cljs - server version: 2.7.4
shadow-cljs - server running at
shadow-cljs - socket REPL running on port 53912
shadow-cljs - nREPL server started on port 53914
shadow-cljs - watching build :doumi
[:doumi] Configuring build.
[:doumi] Compiling ...
[:doumi] Build failure:
The required namespace "cats.core" is not available, it was required by "doumi/helper.cljs".
I'm trying to use different configurations based on whether i'm in the dev environment, or in release mode
In leiningen I would have the same configuration namespace in two different environment paths, and add them to :source-paths
conditionally
I tried this with shadow-cljs but I' getting the error ":source-paths is only valid globally and cannot be configured in build :app."
I haven't found a way of getting different things to happen in dev vs release. Help, please?
see https://shadow-cljs.github.io/docs/UsersGuide.html#_release_specific_vs_development_configuration and https://shadow-cljs.github.io/docs/UsersGuide.html#closure-defines
I consider this :source-paths
hack an anti-pattern and its not supported by shadow-cljs itself. you can still use it when using deps.edn
or lein
if you really want to
I don't understand the question. I have one s3 bucket that I want to use while developing, and another one that I want to use in the released app
I want to choose this bucket based on the run environment, so I don't forget to un/comment things
and the init function then reads that and initializes for re-frame state or whatever you are using
that way your HTML can control the stuff which makes it easy to change and doesn't require recompiling your CLJS when those things change
But I still need to figure out either which runtime environment I am in, or use different HTML files depending on that, right?
since the config I assign is typically dependent on some server-side stuff where recompiling the CLJS would be overkill
to the point where I used to hem and haw a lot about starting a new project for fear of the fiddly configuration
Hi, i’m running into an issue where dev/watch builds work just fine. But a release build is failing with
Uncaught ReferenceError: __webpack_require__ is not defined
at eval (index.js:1)
at Object../components/index.js (app.js:330)
at c (app.js:234)
at ./components/Button/Button.jsx (app.js:236)
at Object.shadow$provide.module$node_modules$$grantsolutions$grant_solutions_ui$dist$index (app.js:236)
at oI (app.js:1362)
at app.js:2070
at app.js:2164
Fortunately, this is a react lib that’s being developed by another group, so if I can figure out what the problem is I can have them tweak the build to fix this.
Any offhand ideas re: what might cause this. In poking around in the code, so far haven’t seen some of the other stuff that’s caused issueslooks like ES5 and JSX. here’s a bit of it unpacked
...
;; example of how we're pulling it in
["@grantsolutions/grant-solutions-ui" :as gsui]
(def Button (uc/component-factory gsui/Button))
__webpack_require__
is defined in the index.js
function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
maybe it’s getting munged away in the release build?it’s weird. any problems I’ve seen before have been consistent. because of whatever lib weirdness
module.exports = {
entry: "./components",
output: {
path: path.resolve(__dirname, "dist"),
filename: "index.js",
library: "",
libraryTarget: "commonjs"
},
plugins: [new MiniCssExtractPlugin(), new StyleLintPlugin()],
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ["babel-loader", "eslint-loader"]
},
{
test: /\.(sa|sc|c)ss$/,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"postcss-loader",
"sass-loader"
]
},
{
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
use: "file-loader"
}
]
},
resolve: {
extensions: [".js", ".jsx"]
}
};
---
{
"presets": ["@babel/env", "@babel/flow", "@babel/react"],
"plugins": [
"@babel/proposal-class-properties",
"@babel/proposal-object-rest-spread",
"flow-react-proptypes"
]
}
this is ‘raw’ one
// @flow
// $FlowFixMe
import "../styles/main.scss";
export * from "./Button";
export * from "./Icon";
export * from "./Notification";
export * from "./Form";
export * from "./Modal";
export * from "./Popover";
export * from "./Search";
export * from "./List";
export * from "./Table";
export * from "./utils";
export * from "./Progress";
Uncaught TypeError: Cannot set property 'Error' of undefined
at app.js:768
at app.js:11615
And it looks like it’s goog.debug.Error
that’s missingI think the docs may be out of date :optimizations supports :advanced, :simple or :whitespace
gotcha 🙂 ok, this is weird. I went to simple. same issue. But webpack.require__ is called before it’s defined
lol ok, yeah this is from another group, i have the source so I can muck aroiund with it
but since it evals a string clojure just probably thought that the __webpack__require
function was unused and removed it
"compile": "run-s compile:*",
"compile:storybook": "build-storybook -o dist/storybook",
"compile:webpack": "webpack --mode=development",
"format": "run-s format:*",
"format:icons": "eslint components/Icon/glyphs/*.jsx --fix",
"prepack": "run-s clean:build test compile",
ok this is another team. We’re ultimately their consumer, so I can make them do whatever I wish lol
yeah just figuring out the best, least disruptive way to tell them they have to do this lol
they have all the usual jest, lint, etc stuff. That should be fine.. and separate ones to build and run storybook
So potentially, everything can remain the same
"start": "start-storybook --port 1999",
"prepack": "run-s clean:build test compile",
"clean": "yarn clean:build && yarn clean:modules",
"clean:build": "rm -rf dist",
"clean:modules": "rm -rf node_modules",
"test": "run-s test:*",
"test:flow": "flow",
"test:eslint": "eslint components --ext .js --ext .jsx",
"test:stylelint": "stylelint styles",
"test:jest": "jest",
"compile": "run-s compile:*",
"compile:storybook": "build-storybook -o dist/storybook",
"compile:webpack": "webpack --mode=development",
"verify:eslint": "eslint --print-config .eslintrc | eslint-config-prettier-check",
"format": "run-s format:*",
"format:icons": "eslint components/Icon/glyphs/*.jsx --fix"
aside from the complie:webpack
/["@grantsolutions/grant-solutions-ui/out/index.js" :as gsui]
should then maybe work?
'''1. Unhandled java.lang.IllegalStateException Can't change/establish root binding of: nrepl-cljs with set'''
@neural.works.com sounds like the nrepl middleware was not loaded properly https://shadow-cljs.github.io/docs/UsersGuide.html#_embedded_nrepl_server
i started a cider-jack-in then that repl i run the server/start! and shadow/watch.... then i tried the cider-connect-siblings-cljs
maybe thats the problem... i started a regular cider-jack-in then when i started the shadow-cljs server inside that nrepl and it started a new repl!
my cider-jack-in-cljs-nrepl-middlewares is ("cider.piggieback/wrap-cljs-repl" "shadow.cljs.devtools.server.nrepl/cljs-load-file" "shadow.cljs.devtools.server.nrepl/cljs-eval" "shadow.cljs.devtools.server.nrepl/cljs-select")
I have no idea what cider-jack-in-cljs-nrepl-middlewares
is or means so I can't say if that is correct or not
shadow-cljs starts its own nrepl server yes. you do not have to use that one if the nrepl server you are talking to has the middleware properly loaded
ok.. but i need the oposite... i started a cider-connect with an already started server...
...then if i want shadow-cljs to run... i run embedeed in that server... but it always started its own server...
its all about the middelware, you can connect to any nrepl server that has that middleware loaded
but then how i started a shadow-cljs repl on that embeede server? its not the server from shadow-cljs
this shows how to set everything up for lein
. I just can't tell you how to do it for deps.edn
+ emacs