This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-09
Channels
- # beginners (47)
- # boot (5)
- # cider (25)
- # cljs-dev (2)
- # clojars (2)
- # clojure (33)
- # clojure-dev (25)
- # clojure-italy (2)
- # clojure-uk (35)
- # clojurescript (27)
- # core-async (2)
- # datomic (5)
- # graphql (2)
- # immutant (3)
- # off-topic (3)
- # onyx (2)
- # pedestal (4)
- # portkey (52)
- # reagent (2)
- # shadow-cljs (55)
- # spacemacs (21)
- # sql (8)
- # tools-deps (22)
solved, opened a PR for the error
I’m working on a bunch of macro stuff right now in CLJ-land, and I’m having trouble getting shadow-cljs to pick up my changes
atm I have a dependency tree something like
workshop.cljs
|
-> react.cljs
|
-> react.clj
|
-> compiler/core.clj
|
-> compiler/parser.clj
|
-> compiler/analyzer.clj
|
-> compiler/generator.clj
changes to react.clj trigger a recompile/hot load, but changes to transitive dependencies (e.g. compiler/core.clj or beyond) do not trigger a recompile and seem to require a restart to pick up changes
I did initially just work in a CLJ repl on the compiler, but there’s some hairiness that I’m trying to diagnose that I’m not seeing in my REPL
yeah. I guess I was just wondering if there was a way that I could get it to reload without restarting the shadow-cljs process?
use the REPL. literally the only reason to restart is changing dependencies, nothing else requires a restart
@lilactown (require-macros ns : reload)
or :reload-all
should work. It usually reads the source on disk and loads it
Oh really
So does that mean that shadow cannot compile vanilla cljs code? I am asking because I wanted to use it in an existing project
Or not supported at the REPL only?
Well... implementation might be different...but they kind of do the same thing no?
How come?
From a user of the language perspective what is the difference?
if you want (require-macros 'the.macro :reload-all)
literally just open a CLJ REPL and (require 'the.macro :reload-all)
Of course
Metadata always does something or it wouldn't be there in the first place
yes ... it will cause the compiler to load the macro ns. in that sense they achieve the same thing
Ok got it
to me macros are clojure code so I develop them at a clojure REPL. might just be me though
How many people are using shadow-cljs for backend node based servers?
@mj_langford I have just started that
Some bumps with cider, but the rest is pretty good
Is this the "goto" page you use for imports from JS codebases? https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
Hi. Has anyone gotten a react virtualized component working with a direct npm import like shadow-cljs recommends? There’s the start of an example but it doesn’t quite go far enough… https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
I’m trying to get something rendering like this:
import React from 'react';
import ReactDOM from 'react-dom';
import { Column, Table } from 'react-virtualized';
import 'react-virtualized/styles.css'; // only needs to be imported once
// Table data as an array of objects
const list = [
{ name: 'Brian Vaughn', description: 'Software engineer' }
// And so on...
];
// Render your table
ReactDOM.render(
<Table
width={300}
height={300}
headerHeight={20}
rowHeight={30}
rowCount={list.length}
rowGetter={({ index }) => list[index]}
>
<Column
label='Name'
dataKey='name'
width={100}
/>
<Column
width={200}
label='Description'
dataKey='description'
/>
</Table>,
document.getElementById('example')
);
Here’s mine:
(ns simple.virtual-table
(:require ["react-virtualized" :refer (Table Column)]))
(enable-console-print!)
(def rows
[{:name "brian vaughn" :description "one"}
{:name "brian vaughn" :description "two"}
{:name "brian vaughn" :description "three"}
{:name "brian vaughn" :description "four"}
{:name "brian vaughn" :description "five"}
{:name "brian vaughn" :description "six"}])
(defn react-virtualized-table []
[:div
[:h3 "React Virtualized Table"]
[:> Table {:headerHeight 30
:height 300
:rowCount 5
:rowGetter (fn [m]
(get rows (aget m "index")))
:rowHeight 50
:width 400
}
[:> Column {:label "Name"
:dataKey "name"
:width 100}]
[:> Column {:label "Description"
:dataKey "description"
:width 100}]
]])
I get the table rendering with rows and columns, but the columns empty
<div class="ReactVirtualized__Table__rowColumn" role="gridcell" title="" style="flex: 0 1 100px; overflow: hidden;"></div>
Anyone have luck with this? All examples online (for most npm components) use cljsjs like this one: https://gist.github.com/crankyadmin/cd2a22ecfe4068a94e6800f5a9349811