Fork me on GitHub
#figwheel-main
<
2018-10-17
>
bhauman10:10:52

@pesterhazy I’m not sure, if you are pointing out a bug in figwheel or not

kwladyka10:10:03

@pesterhazy I can recommend to use node dependencies in that way: webpack.config.js

module.exports = {
  entry: './src/js/index.js',
  output: {
    filename: 'index_bundle.js'
  }
}
figwheel-main.edn {:npm {:bundles {"dist/index_bundle.js" "src/js/index.js"}}} src/js/index.js
window.React = require("react");
window.ReactDOM = require("react-dom");
window.Highlight = require("react-highlight").default;

// material-ui

import {createMuiTheme, MuiThemeProvider} from '@material-ui/core/styles';
window.MaterialUiStyles = {
    createMuiTheme: createMuiTheme,
    MuiThemeProvider: MuiThemeProvider
}

window.MaterialUiCore = {
    AppBar: require("@material-ui/core/AppBar").default,
    Button: require("@material-ui/core/Button").default,
    Drawer: require("@material-ui/core/Drawer").default,
    ExpansionPanel: require("@material-ui/core/ExpansionPanel").default,
    ExpansionPanelSummary: require("@material-ui/core/ExpansionPanelSummary").default,
    ExpansionPanelDetails: require("@material-ui/core/ExpansionPanelDetails").default,
    IconButton: require("@material-ui/core/IconButton").default,
    Grid: require("@material-ui/core/Grid").default,
    Paper: require("@material-ui/core/Paper").default,
    TextField: require("@material-ui/core/TextField").default,
    Toolbar: require("@material-ui/core/Toolbar").default,
    Typography: require("@material-ui/core/Typography").default
}
run yarn webpack --mode=development Then in cljs
(ns material-ui.core
  (:require [reagent.core :as r]
            [material-ui-styles :as mui-style]
            [material-ui-core :as mui-core]))

(def grid (r/adapt-react-class mui-core/Grid))

kwladyka10:10:20

BTW I will publish this example when I will find free time (next 14-30 days?). I have to finish my library before publish.

Toby14:10:35

@bhauman the websocket error turned out to be caused by a development proxy (adds service sub-domains) that doesn’t forward websockets correctly. If I can find the time, I’d like to figure out how to return a better error than “undefined” when the connection closes unexpectedly.

zalky20:10:31

Hi all: I had a wonderful little boot framework task that would watch certain important namespaces and restart the running web server if those namespaces changed, and then a downstream task to build web assets. It worked really well for a reloaded workflow, but some of the boot tasks in the pipeline were a bit slow. I'm now trying recreate this in lein (partly for learning, partly because it seems faster) and I'm wondering how folks would set this up along side something like figwheel-main? Is it preferable to use something like lein-cooper + lein-auto to launch a server restart task in parallel with figwheel-main? Or is it better to just launch a repl and then do every with the scripting api: both server restarts and the figwheel-main builds?