Skip to content

Commit

Permalink
fix JSX compiler initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenberger committed Oct 15, 2015
1 parent d88ea86 commit d2fcbba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
description = "Use React together with Tapestry"

group = "de.eddyson"
version = "0.2.0"
version = "0.2.1"

apply plugin: 'groovy'
apply plugin: 'maven'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import org.apache.commons.io.IOUtils;
import org.apache.tapestry5.ContentType;
import org.apache.tapestry5.annotations.Path;
import org.apache.tapestry5.internal.InternalConstants;
import org.apache.tapestry5.internal.webresources.RhinoExecutor;
import org.apache.tapestry5.internal.webresources.RhinoExecutorPool;
Expand All @@ -30,8 +29,8 @@ public ContentType getTransformedContentType() {
return InternalConstants.JAVASCRIPT_CONTENT_TYPE;
}

public JSXCompiler(@Path("browser.js") final Resource mainCompiler, final OperationTracker tracker) {

public JSXCompiler(final OperationTracker tracker) {
Resource mainCompiler = new ClasspathResource("de/eddyson/tapestry/react/services/browser.js");
executorPool = new RhinoExecutorPool(tracker, Arrays.<Resource> asList(mainCompiler,
new ClasspathResource("de/eddyson/tapestry/react/services/jsx-compiler-wrapper.js")));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ class JSXCompilerSpec extends Specification {
Logger logger = LoggerFactory.getLogger(OperationTracker)
OperationTracker operationTracker = new OperationTrackerImpl(logger)


Resource compiler = new ClasspathResource("de/eddyson/tapestry/react/services/browser.js")

JSXCompiler jsxCompiler = new JSXCompiler(compiler, operationTracker)
JSXCompiler jsxCompiler = new JSXCompiler( operationTracker)
def resource = new ClasspathResource("de/eddyson/tapestry/react/template.jsx")

expect:
compiler.exists()
resource.exists()

when:
Expand Down

0 comments on commit d2fcbba

Please sign in to comment.