These are chat archives for chandu0101/scalajs-react-components

22nd
Sep 2015
TP Diffenbach
@tpdi
Sep 22 2015 19:47
@chandu0101 Help me with one thing: where does sjs-react-compoents get the material-ui.js from?
Marius B. Kotsbak
@mkotsbak
Sep 22 2015 19:48
I suppose you must include it yourself, possibly using webjars
Like with React.js
TP Diffenbach
@tpdi
Sep 22 2015 19:50
Ok. So sbt reads package.json? And downloads the webjar to where?
fastOptJS really wants all my CPU and more.
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 19:55
no i am not using webjars
i am using webpack(different bundling tool) and npm
Marius B. Kotsbak
@mkotsbak
Sep 22 2015 19:57
Webjars are put in the generated dependencies JS file
It does not read the JS tool files
Otto Chrons
@ochrons
Sep 22 2015 19:57
@tpdi give SBT more memory
TP Diffenbach
@tpdi
Sep 22 2015 19:58
It's got 2G
Ok, so I don't understand webpack then. I installed material-ui as per your instructions (which reference their instructions). But npm list doesn't actually show it a installed. So I'm guessing it's a webpack thing, not an npm thing. Gah!
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:02
you’re trying to upgrade material-ui ? are you trying this in demo project or on u r personal project.. ?
TP Diffenbach
@tpdi
Sep 22 2015 20:03
Good guess! Yes, I want to see if demo will work with material-ui 0.11
I want to see if the error with the TimePicker goes away, and the other problem I'm having with it, which is the defaultDate prop doesn't update when I think it should. Though that may be my error.
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:05
ok then update version in package.json to 0.11
npm update
npm start
TP Diffenbach
@tpdi
Sep 22 2015 20:08
I'm still confused. Where in the build process does the build include material-ui.js in the output (built) js?
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:10
npm start spins a webpack bundle task and creates final bundle file with material-ui
TP Diffenbach
@tpdi
Sep 22 2015 20:11
Ah! Ok. So the Build.sbt doesn't fully build, a full build requires sbt PLUS npm start!!!!
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:11
yeah
sbt for only fastest/fullopt output
webpack all other js stuff
TP Diffenbach
@tpdi
Sep 22 2015 20:13
That's weird, because I can see my changes with only fastOptJS. I haven't run npm start in a while.
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:14
unless u upgraded js dependencies you don’t need web pack , propably u using previous bundled files all the time
TP Diffenbach
@tpdi
Sep 22 2015 20:15
right. ok, demo code is in one .js, supporting js in other .js files
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:15
if you’re not using web-packdev server , then don’t worry about npm start , just run webpack in demo folder to rebundle files with latest updates ( ofc you must update deps using npm update)
TP Diffenbach
@tpdi
Sep 22 2015 20:17
Yes, as I mentioned, webpack doesn't work as a server for me. Some investigation suggets it's because node-gyp doesn't work under MS-Windows. As I mentioned, I'm just using python -m SimpleHttpServer
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:19
from our chat history
Okay got it. npm start just plain doesn't work, but if I run webpack-dev-server by itself it works. Might have something to do with cygwin, idk
let me know if that works on your windows ..
TP Diffenbach
@tpdi
Sep 22 2015 20:22
weird:
$ npm list
scalajs-react-template-webpack@0.1.0 C:\Users\tpd\workspace\scala\scala-js\scalajs-react-components\demo
├── UNMET DEPENDENCY material-ui@^0.9.0
├── UNMET DEPENDENCY react@^0.13.3
├── UNMET DEPENDENCY react-geomicons@^2.0.4
├── UNMET DEPENDENCY react-infinite@^0.4.1
├── UNMET DEPENDENCY react-select@^0.5.1
├── UNMET DEPENDENCY react-spinner@^0.2.2
├── UNMET DEPENDENCY react-tagsinput@^1.3.5
├── UNMET DEPENDENCY react-tap-event-plugin@^0.1.7
└── UNMET DEPENDENCY svg-loader@0.0.2
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:27
hmm change version from ^0.9.0 to ^0.11.1 in package.json
TP Diffenbach
@tpdi
Sep 22 2015 20:32
No, not that, it's that it suggests that npm doesn't have those dependencies. I haven't tried to use material-ui 0.11 yet, I'm working on generic error message handling for components.
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:33
did you ran npm install ?
TP Diffenbach
@tpdi
Sep 22 2015 20:34
Generic error handling: in a component with user input, we have to validate those inputs. This will involve generating error messages and potentially updating state to correct errors.
I think I ran it a few days ago. I will re-run it.
Chandra Sekhar Kode
@chandu0101
Sep 22 2015 20:42

I'm working on generic error message handling for components.

cool :+1:

TP Diffenbach
@tpdi
Sep 22 2015 20:45
  val errors: Seq[DetectError] = Seq(
      s => if (isWeekend(s.startDate)) Some(<.span(^.color.blue, "Departure date is on a weekend")) else None,
      s => if (isWeekend(s.endDate)) Some("Return date is on a weekend") else None,
      s => Some("Debug: " + s.toString)
)
TP Diffenbach
@tpdi
Sep 22 2015 20:51
Hmm, npm install worked. Could have sworn I did it previously though.
TP Diffenbach
@tpdi
Sep 22 2015 20:58
Ok npm start does package, but it doesn't serve. So that apparent failure is necessary for building.