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

Use transform directly rather than shelling out #2

Merged
merged 2 commits into from
Jul 1, 2013

Conversation

petehunt
Copy link
Contributor

The shell command does a lot more than just desugaring; this makes the transform much, much simpler and saves you extra processes.

@ericclemmons
Copy link
Owner

Thanks Pete! This looks similar to the browserify code in the library, which makes me feel much better about how I solved that :)

I'll dig into why the test is failing & update accordingly...

@petehunt
Copy link
Contributor Author

@ericclemmons So I think that Node changed the spec of readFileSync() at some point, so the local version of Node I was running is different than the one in Travis. I've updated the branch with a workaround.

@ericclemmons
Copy link
Owner

I'm guessing it had something to do with readFileSync returning a buffer? It looks like you force-pushed over the previous commit, so I can't readily tell what the difference was (that sounds like something important to know) :(

@petehunt
Copy link
Contributor Author

Oh sorry! I thought you would want a single commit. I changed readFileSync(..., {encoding: 'utf8'}) to readFileSync(...).toString()

Now there is a new problem with jenkins, but it doesn't look related to this change. I think it is because react-tools expects to be installed globally? Maybe? I don't know npm that well.

@petehunt
Copy link
Contributor Author

Fixed! This was a bug in node v0.8 which prevented react-tools from installing correctly: https://github.com/isaacs/npm/issues/2907

@ericclemmons
Copy link
Owner

I did have one last question, since I've normally supported v0.8 with my plugins since that's the base version supported by gruntjs: Do you mind if I amend to your BR to make it BC compatible with ~v0.8 as well as ~v0.10?

@petehunt
Copy link
Contributor Author

petehunt commented Jul 1, 2013

Sure, but keep in mind that react-tools had issues installing itself on older versions of node. See facebook/react#132

@ericclemmons
Copy link
Owner

Ooh, then that's fair enough. I guess we have to support the maximum between react & grunt, which is v0.10.0

Makes sense to me!

Eric Clemmons

On Sunday, June 30, 2013 at 8:19 PM, petehunt wrote:

Sure, but keep in mind that react-tools had issues installing itself on older versions of node. See facebook/react#132 (facebook/react#132)


Reply to this email directly or view it on GitHub (#2 (comment)).

@petehunt
Copy link
Contributor Author

petehunt commented Jul 1, 2013

To be clear, the code in React and my changes to grunt-react itself doesn't do anything specific to v0.10, it's just how react-tools specifies dependencies (so npm install fails on some earlier versions of Node). So the change to .travis.yml without changes to package.json is the right way to go, IMO.

Anything else I can do or address to get this landed? I am basing the Rendr+React integration (https://github.com/petehunt/rendr-react-template/) on this project and I think this pull is required to get it working.

Thanks for your hard work!

@ericclemmons
Copy link
Owner

I was just merging this down now, but thought about how to test the ignoreMTime. I'll merge down, but would like to keep the issue open so I can create a test for it.

Let me know what the best strategy is & I'll get it done!

@ericclemmons ericclemmons merged commit 57d4186 into ericclemmons:master Jul 1, 2013
@ericclemmons
Copy link
Owner

v0.3.0 has been tagged, so you're good to go!

@petehunt
Copy link
Contributor Author

petehunt commented Jul 1, 2013

Thanks Eric! I had just done manual testing for ignoreMtime, with the way fixtures are set up currently I think it's kind of hard to test. Maybe integrating a way to generate fixtures programmatically would be easiest?

This project rocks :)

@ericclemmons
Copy link
Owner

Glad you like it! If you can tell me how you manually tested, I can setup the fixture.

And yea, I'm not quite a fan of testing in grunt, and everytime i write new tests its a crapshoot :)

@petehunt
Copy link
Contributor Author

petehunt commented Jul 1, 2013

I basically ran it on multiple files, changed one file, and looked at the file mtimes to be sure only the changed file was updated.

@ericclemmons
Copy link
Owner

Oh, I can build a test around that!

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 57d4186 on petehunt:use-transform into * on ericclemmons:master*.

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 this pull request may close these issues.

3 participants