peh / react-grails-asset-pipeline Goto Github PK
View Code? Open in Web Editor NEWGrails React Asset Pipeline plugin
Grails React Asset Pipeline plugin
Thank you for writing this plugin.
Would you consider supporting CoffeeScript JSX components (CJSX) as specified by this transformer?
I found out about it because it's supported by React's official Sublime Text support package and I'm a big fan of CoffeeScript, so I'd love to use that as a language for JSX. It really cuts down on verbosity.
This line in ReactTagLib:
def debugMode = (conf.allowDebugParam && debugParameter) ||
(Environment.current == Environment.DEVELOPMENT &&
!grailsApplication.warDeployed && conf.bundle != true)
does not take into consideration custom environments.
Medium- to large-size Grails apps have many environments, used for various development purposes, testing, QA, demos, or different kinds of production deployments.
The standard plugins are aware of this and only use the three default environments to set the default values of their configuration variables, never directly their behaviour.
In this case I suggest removing the environment check and leaving the others, which should suffice:
def debugMode = (conf.allowDebugParam && debugParameter) ||
(!grailsApplication.warDeployed && conf.bundle != true)
It seems to me that when building the war file, JSX resources are not minimized, while JS ones are.
Right now I'm writing my components as *.jsx files, having one of them (called Main) include the others with asset pipeline include comments, and referencing it from the GSP page with:
<asset:reactTemplate src="Main.jsx"/>
This works both in run-app and war, but the compiled version in the war is not minimized.
Should I organize or include my JSX files differently? Or is this feature not here yet? Can you piggyback on the regular asset pipeline minimization procedure?
Hi. Your plugin worked on fine on development. But when I exported test war and deployed it, it seems that jsx files are not complied.
For example, I had this file editor.js with just these two lines:
//= require jsx/title.jsx
//= require jsx/root.jsx
That worked on development, and I would get separated compiled js files. Now, on test war, I expected they should be packed in editor.js and minified, but this is how my editor.js looks:
//# sourceMappingURL=editor.js.map
I would expect bunch of minifed code below this first line (like application.js).
It's a very useful plugin, Thank you.
Also, why does :react-asset-pipeline:1.1.1
depend on another plugin net.errbuddy.plugins:react-asset-pipeline:1.0.7
with a different version that is taken from a custom MVN repo?
That's a bit convoluted. Wouldn't it be easier to just package all the classes you need in this plugin?
I tried using the following line in a JSX file, to include all files from a folder of components, but it doesn't work:
// =require_tree widgets
The same line in a .js
file works fine.
any grails3 support planned?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.