-
Notifications
You must be signed in to change notification settings - Fork 8
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
Create a rave-start-react Starter? #26
Comments
Would the jsx compilation happen in the browser via a loader? |
more than interested also in the unidirectional data flow ! On Mon, Jun 2, 2014 at 8:58 PM, John Hann notifications@github.com wrote:
Best regards, ┏( ^◡^)┛ ┗(^◡^ )┓ I rock RaveJS! ┏( ^◡^)┛ ┗(^◡^ )┓ http://rivieragug.org/ |
I think my favorite pattern is to do the compilation (jsx or other kinds) inside the translate hook of the ES6 loader if the files aren't already pre-compiled. The pre-compile step would be performed by the build process, too, of course. In this case (pre-compiled), the translate step would be skipped in the browser. I'm putting together a proposed plan for the build process and will post it this week. |
Would you require such files with the extension? e.g. In general, in case of .jsx, .coffee, .less, etc. there are currently 3 ways of pulling such files in.
And to make those work, you can either
I'm just trying to figure out if there's the best way of doing these things - agreeing on one way of doing it would be good for interop? If we could agree on how these requires() should be written, and how the translation step could be described via package.json, suddenly all npm packages could be requiring in all these extra assets in a consistent way, so tools like webpack, browserify, rave, jspm, etc. could all load those packages and correctly resolve the requires (even if the implementations of the actual loaders are different). Or is this a pipe dream? I'm assuming the AMD style loader plugins are likely going away, so we can focus on the file extension based approach. For anything that's not javascript, we just always use an extension. The only question then is with compile-to-js files - you can either compile them to js pre publishing to npm and use extensionless requires, or require them with an extension (e.g. jsx, coffee) and translate in whatever tool you're using. Ok, I guess this is fairly simple. Anyways, sorry for such a long comment, don't mean to waste anyone's time, just trying to understand things.. Btw, the translate hook that can understand if something is precompiled sounds awesome, cause it means you can choose if you want to compile on the browser on the fly, or precompile on your server at serve time. How do you know if something has been precompiled? |
I've created a I couldn't get |
I want react to work with Rave, including transpiling JSX. The npm version should be a priority. |
The only reason react doesn't currently work in rave is the use of So currently to use react you can install it via bower, since that has the built browser version. Or you can put in How could we solve this better (whilst using npm for everything). Some options:
|
Require-by-extension seems closest to what the node folks have already done with .cs and .json files. It's also less redundant and less AMD-like. (Unfortunately, there are lots of AMD haters.) It's not clear to me how something could pretend to be js instead of jsx.
We've been leaning heavily towards a combo of compile-at-bundle + compile-at-browser wherein the dev can switch from one to the other.
Standardizing on the module name format would be ideal, of course. That's why we're following the precedent that node has established: using file extensions. In ES6, the translation step can be performed by the Loader, so I've been thinking that any solution should allow that pattern. webpack and browserify need to get on the ES6 bandwagon, imho. It hadn't occurred to me that the translation hook could be described in package.json. In the long term, this could be successful. In the short term, I feel that the discussion will be long and frustrating (like they are on bower) or short and frustrating (as they are on npm). The easiest way around standardization of loader hooks is to install rave extensions that do the config work, imho.
Image inlining seems like a feature that could be user-configurable.
My opinion atm: publish un-transformed code to npm/bower and use .jsx file extensions. I have no idea what the industry consensus is on this, though.
I don't think there's any reliable way to know in many situations. I've been thinking that the developer has to specify which "mode" they're in explicitly. Maybe that's a topic for a different discussion. :) |
So typical. Too many folks assume that npm implies a node run-time.
Until we have a better idea of the best long-term strategy, I like the "rave extension that injects process" option as a short-term solution. |
I've created a
Next, I want to publish A couple of interesting things:
|
Very nice. I'm a bit cautious of some of the process functions that they stubbed. Silent failures are sure to piss somebody off. Oh well, it's a start and we can deflect the issues onto that repo. :)
I see you worked around this pretty easily. :)
Does esprima-fb eventually get crawled/discovered? |
Looks like @shichme has taken the lead on this: https://www.npmjs.org/package/rave-react-start @snichme: is this ready to try? |
Hey @snichme, I think I gave you bad advice when I asked you to publish to npm/bower. The correct way to install a Starter is to clone it or unzip into a directory. Hmm... should we create a page or other mechanism to make it easier to discover Rave Starters? For instance, @fabricematrat also has a rave starter: https://github.com/fabricematrat/rave-start-cujo |
Sure, it's not much yet but please, try it out. Yeah, having it on npm feel wrong. How about a simple repo with a README that lists starters? |
Hey @snichme, I just tried it and it worked perfectly. I lolled when I saw your interpretation of a "Hello World" app! :) It may be a bit flashy, but it gives a really great demo, atm. Gonna close this issue since we have a rave-start-react! Thanks! |
A few folks at jsconf -- as well as a Pivotal person -- expressed interest in using rave with Facebook React. Thoughts?
The text was updated successfully, but these errors were encountered: