Fork me on GitHub
#shadow-cljs
<
2018-06-09
>
lilactown15:06:30

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

lilactown16:06:41

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

thheller16:06:11

only the initial one counts

lilactown16:06:25

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?

lilactown16:06:41

would reloading at the REPL work?

thheller16:06:09

use the REPL. literally the only reason to restart is changing dependencies, nothing else requires a restart

thheller16:06:58

won't have much time to work on anything shadow-cljs related the next few weeks

richiardiandrea16:06:56

@lilactown (require-macros ns : reload) or :reload-all should work. It usually reads the source on disk and loads it

richiardiandrea16:06:50

So does that mean that shadow cannot compile vanilla cljs code? I am asking because I wanted to use it in an existing project

thheller16:06:59

(require-macros ..) iis a REPL only thing

thheller16:06:00

:require-macros is fully supported

thheller16:06:42

yes ... it will cause the compiler to load the macro ns. in that sense they achieve the same thing

thheller16:06:47

:require-macros does nothing until the compiler is actually ready to do something

thheller16:06:51

the only reason require-macros isn't supported is because I have never needed it

👍 4
thheller16:06:52

feel free to open a ticket if you want it

thheller16:06:28

to me macros are clojure code so I develop them at a clojure REPL. might just be me though

mj_langford17:06:51

How many people are using shadow-cljs for backend node based servers?

Jeff Friesen23:06:57

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')
);

Jeff Friesen23:06:39

I get the table rendering with rows and columns, but the columns empty

Jeff Friesen23:06:10

Anyone have luck with this? All examples online (for most npm components) use cljsjs like this one: https://gist.github.com/crankyadmin/cd2a22ecfe4068a94e6800f5a9349811