Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsx not able to watch subdirs #60

Closed
hojberg opened this issue Jun 5, 2013 · 12 comments · Fixed by #150
Closed

jsx not able to watch subdirs #60

hojberg opened this issue Jun 5, 2013 · 12 comments · Fixed by #150
Assignees

Comments

@hojberg
Copy link
Contributor

hojberg commented Jun 5, 2013

Trying to run jsx to build into a subdir seems to just exit with no error message:
jsx -w src/ public/js (public/js does exist)

However, if run in directly in public it works without a hitch:
jsx -w src/ public

@ghost ghost assigned benjamn Jun 5, 2013
@benjamn
Copy link
Contributor

benjamn commented Jun 5, 2013

Are there any .js files in src/ yet?

Also potentially useful: what node --version are you running, and what OS?

@hojberg
Copy link
Contributor Author

hojberg commented Jun 5, 2013

There is a file in src which builds when not using a subdir in the public dir.

node version is 0.8.23 and im on OS X Mountain Lion

@benjamn
Copy link
Contributor

benjamn commented Jun 5, 2013

Installed 0.8.23 but no luck reproducing. Will try on a Mountain Lion machine tomorrow. Thanks for the report.

Do you see this failure with an empty .js file? If using an empty file makes the failure go away, perhaps you can try cutting out different parts of the file to figure out the minimal contents that trigger the failure?

It could be a problem with fs.watch on Mountain Lion, though. That's my hunch.

@benjamn
Copy link
Contributor

benjamn commented Jun 5, 2013

One more idea: the module cache might have gotten into a bad state somehow. Try clearing it by deleting the directory ~/.commoner/module-cache?

@hojberg
Copy link
Contributor Author

hojberg commented Jun 5, 2013

The same file builds fine if I use jsx -w src/ public (note the lack of public/js).

Deleting that directory didn't work for me.

@benjamn
Copy link
Contributor

benjamn commented Jun 11, 2013

I know this is still broken. Still working on a fix.

@hojberg
Copy link
Contributor Author

hojberg commented Jun 12, 2013

❤️

@hieu
Copy link

hieu commented Jun 14, 2013

I had same problem on ubuntu. Yesterday "jsx --watch" worked just fine for me. Today when I ssh-ed again and ran "jsx --watch reactjs/ js/" it just silently does nothing.

@jeffreylin
Copy link
Contributor

@hojberg @hieu - I was having issues w/ vim file writes not being caught so I hacked together https://github.com/jeffreylin/jsx_transformer_fun - Feel free to try it and let me know if it works (Haven't had the time to test on Ubuntu yet...) - We might use the file watcher in that repo in Commoner / JSX in the future.

@hieu
Copy link

hieu commented Jun 14, 2013

@jeffreylin 👍 Work like a charm. Thank you very much!

@hojberg
Copy link
Contributor Author

hojberg commented Jun 17, 2013

Ok. I think I now know what the issue is.

jsx created a .lock.pid file in the output directory. If that file is still there when running jsx again it will quick silently.

benjamn added a commit to benjamn/react that referenced this issue Jul 2, 2013
This behavior is new in Commoner v0.8.3, following the incorporation of
@jeffreylin's `DirWatcher` implementation:
https://github.com/jeffreylin/jsx_transformer_fun/blob/master/dirWatcher.js

Watching directories instead of files reduces the total number of open
files, and copes better with editors that save files by deleting and then
immediately recreating them.

Closes facebook#60.
Closes facebook#71.
@zpao zpao closed this as completed in #150 Jul 3, 2013
@hieu
Copy link

hieu commented Jul 3, 2013

Awesome!

taneliang referenced this issue in MLH-Fellowship/react Aug 17, 2020
* Decrease lane height, add note to react_gutter_size
* Rename REACT_PRIORITY_BORDER_SIZE to REACT_WORK_BORDER_SIZE

Co-authored-by: E-Liang Tan <eliang@eliangtan.com>
taneliang referenced this issue in MLH-Fellowship/react Aug 19, 2020
* Decrease lane height, add note to react_gutter_size
* Rename REACT_PRIORITY_BORDER_SIZE to REACT_WORK_BORDER_SIZE

Co-authored-by: E-Liang Tan <eliang@eliangtan.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants