React-tools JSX compile nested folder error - facebook

I'm trying to use the Node module react-tools provided by Facebook to compile my JSX files into their appropriate .js files.
jsx --extension jsx --no-cache-dir js/src js/build
However, using the supported command I'm not able to build files which are nested inside sub folders in my src folder.
I have js/src/module1/main.jsx
If I build this now, react-tools successfully builds
module("module1/main")
but then spews an error:
no such file of directory js/build/module1/main
However, if I make the directory js/build/module1 first, then I don't see any problems. It seems like react expects the output directory to already have the sub-directories in it. Am I doing something wrong here or is this a bug with react-tools at the moment?

Totally a bug in the main dependency of the jsx tool. :(
I filed https://github.com/reactjs/commoner/issues/67 to track.

Related

Buildroot Build Issue

I'm using Buildroot 2015.08.01. I have this "weird" issue. We use an "external tree" setup here. I modified the .mk file to add/remove some libraries for the application to fix some unresolved symbol issues. Changes are made in a /src directory. I do a -dirclean, verify the package is removed from the /output/build directory. Then I make the package: the modified sources are copied to the /output/build directory to do the build. However, it seems buildroot is NOT using the modified .mk file in the build directory, as the changes made are not present on the Linker output line (i.e. still using the "old" link file list). I recall that buildroot seems to remember various names/symbols. So how do I "flush" this so that buildroot will use the new link file list?
When I manually edit the console output with the updated list, and execute in this in the build directory, it works just fine.
Thank you for your insights into this "weird" issue.

How can I use folders in a Swift application compiled from the command line?

I'm building a simple webserver using Swift3 and the Swift Package Manager. Running swift build in your project folder will build all of the sources found in the Sources directory and output an executable. However, I've found that if I create folders within the Sources directory to organize my code, my builds fail. It looks to me like the presence of folders causes swift to treat the source as different modules. Is this the cause, and if so, how can I work around it?
Yes. Putting directories directly under Sources will cause SwiftPM to interpret those as modules. This is described in the package manager reference.
To work around this, use another level of indirection: put a directory for your module inside Sources and your additional directories inside that directory:
Sources/YourApp/Stuff/Source1.swift
Sources/YourApp/Stuff/Source2.swift
Sources/YourApp/MoreStuff/Source3.swift
Sources/YourApp/MoreStuff/Source4.swift

angular 2 seed, webstorm 2016.1 suddenly stop importing libraries

I'm using the newest Webstorm 2016.1 und angular 2 seed.
Somehow it doesn't auto import libraries from node modules any more (e.g. RouteConfig or OnInit)
any suggestions?
Thanks!
Go to Settings -> Language & Framework -> Javascript and add new library typed node-modules pointing to your node-modules directory.
In my case Idea was using wrong tsconfig.json (src/tsconfig.json) file. You can see which tsconfig.json is being used when the project is loaded to the IDE. After renaming src/tsconfig.json to src/tsconfig.json_disabled it started to use tsconfig.json from the root of the project. At this point, Idea didn't compile anything under src, because it was excluded in the tsconfig.json. I commented out the exclusion and everything started to work.
Although not perfect solution, the problems seems to be caused by wrong tsconfig.json. Unfortunately you cannot specify which tsconfig.json is used in project configuration.
I couldn't figure out what was the issue but I did this and it started working again
Make a copy of the app folder using finder/explorer
Delete .idea and node_modules folders from finder/explorer
Open the folder in webstorm and do npm install
Wait for webstorm to index all files.
It started working

Foundation 5 Production Environment Files

I've created a new foundation project using the foundation new myproject --libsass method.
Its just a simple static index.html (for the purpose of this question).
I've deployed it to a live server now, and I am wondering about the best way to structure this. I have omitted the node_modules & scss directories, and i'm left with the following:
bower_components/
css/
js/
index.html
bowerrc
bower.json
Gruntfile.js
humans.txt
package.json
README.md
bower_components is needed in its current form, unless I shuffle some files around, which is what I intend to do, but I'm checking if there is a better way of doing this, and that I haven't missed some magic terminal command to deploy to production.
As msturdy suggested in the comments, grunt is the way to go here. There are a lot of plugins out there, see a list on the official page.
If you want to have grunt "compile" your project into one specific folder which you can then for example push to a deployment server, you should do several things in grunt:
compile your scss
minify your javascript, that is making the files smaller, see jscompress for a demo of what it is. All your js-files from /bower_components which you include in your project should be in a vendor.js which is loaded first, and then a second js-file should contain your custom js from /js
save everything into a deployment folder.
(optional) automatically deploy to a server.
Take a look at these grunt tutorials for setting up your gruntfile.js, you'll want to have two tasks, one for just quickly compiling your scss, one for the whole deployment process:
grunt is not weird and hard
official tutorial
sitepoint tutorial
They show you how to do certain things and definitely how to write the gruntfile. Plugins you might want to use apart from your current libsass plugin are uglify and any plugin that lets you deploy your code via git, ftp or anything else. You can download all these plugins via npm by adding them to your package.json and doing npm install, refer to their websites for exact usage instruction.

Creating javadoc with gwt-user.jar through Gradle

I'm trying to compile the javadocs for my application, and for some reason it throws errors while compiling like this:
/Users/Sander/.gradle/caches/artifacts-23/filestore/com.google.gwt/gwt-user/2.4.0/jar/949dcb5d14cb0e2c8dec98efc0760be68753c124/gwt-user-2.4.0.jar(com/google/gwt/dom/client/CanvasElement.java):18: error: cannot access Context
import com.google.gwt.canvas.dom.client.Context;
All the errors thrown are found in gwt-user-2.4.0.jar. Basically, what (I think) it's trying to do is compile the .java source files the jar file contains, which it shouldn't do. Is there a way to make the javadoc command ignore java source files?
I've tried removing the source files from the jar manually, this way the build succeeds. However, since the jar is a gradle dependency, manually altering the file is not an option.
I finally got it to work. As it turned out, the javadoc command needed a sourcepath flag set, because otherwise it would start looking for the source files in the classpath, which contained some source files from the GWT jar file. Since the MinimalJavaDocOptions GWT class doesn't support this, I had to set it manually by adding the following line:
options.addStringOption("sourcepath", <path_to_source>)
This fixed the problem. Obviously it is not ideal, a topic in the Gradle Support Forums has already been created, see http://forums.gradle.org/gradle/topics/allow_javadoc_sourcepath_to_be_set_directly