Skip to content

Instantly share code, notes, and snippets.

@niloc132
niloc132 / 1 Test.java
Created October 5, 2012 14:52
GWT 2.4.0 optimizations on JSNI source
/**
* Run with -Dgwt.jjs.traceMethods=Test.* to see optimization progress, then view
* compiled JS to see what other rewriting happens
* @author colin
*
*/
public class Test implements EntryPoint {
public native void onModuleLoad() /*-{
//Strings appearing multiple times will be interned
var a = {test:true};
@niloc132
niloc132 / Sample.gwt.xml
Created October 17, 2012 16:22
Make more premutations for both small builds and bigger builds with full stack traces. Just add debug=true to the querystring of app's url, reproduce the issue, and read the trace!
<set-property name="compiler.emulatedStack" value="true, false" />
<property-provider name="compiler.emulatedStack">
<![CDATA[return (location.search.indexOf("debug=true") != -1) ? "true" : "false";]]>
</property-provider>
<set-configuration-property name="compiler.emulatedStack.recordFileNames" value="true" />
<set-configuration-property name="compiler.emulatedStack.recordLineNumbers" value="true" />
@niloc132
niloc132 / example failure log.log
Created October 26, 2012 22:33
ImageResourceGenerator fd leaks in GWT 2.4 - same behavior observed in 2.5. These end up being cleaned up later in the build, but during that part of the build it may bump into the OS limits on open files
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez4'
[INFO] Preparing method rez40
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez40'
[INFO] Preparing method rez400
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez400'
[INFO] Preparing method rez401
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez401'
[INFO] Preparing method rez402
[INFO] Adding image 'com.sencha.gxt.examples.test.client.Test.MonsterBundle.rez402'
[INFO] Preparing method rez403
@niloc132
niloc132 / gist:4702630
Created February 3, 2013 17:10
running gwt precompile from within your pom
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>verify-modules</id>
<phase>test</phase>
<goals><goal>exec</goal></goals>
<configuration>
@niloc132
niloc132 / gist:4702659
Last active December 12, 2015 02:58
Run GWT compiler from maven without any gwt-m-p restrictions. This can be useful for two main reasons: * Running the compiler during test (i.e. switch phase to process-test-classes, and set classpathScope to test) to allow the test phase to have compiled JS to work on * Running without skipping built-in entrypoints to completely verify that the …
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>compile-js</id>
<phase>prepare-package</phase>
<goals>
<goal>exec</goal>
public class Test implements EntryPoint {
public void onModuleLoad() {
Widget label = new Label();
Window.alert("HasText? " + (label instanceof HasText));
}
}
@niloc132
niloc132 / Snippet.java
Last active December 15, 2015 10:49 — forked from icfantv/Snippet.java
String xml = "<root><elt>sum stuff</elt><elt anAttribute=\"attr_value\">more stuff</elt></root>";
XmlXhtmlRenderer renderer = new XmlXhtmlRenderer();
try
{
result = renderer.highlight("some-text-can-be-anything", xml, "UTF-8", true);
LOGGER.trace("added syntax highlighting to XML: {}", result);
}
catch (IOException ex)
{
LOGGER.error("unable to syntax hightlight adi xml for asset: {}", assetKey, ex);
Compiling module com.sencha.gxt.test.TestRunner
---------------------------
JAVA INITIAL:
---------------------------
public void display(Splittable result){
Window.alert("boolean value? " + result.asBoolean() + "\n" + "is null? " + (result == null));
}
---------------------------
FinalizeVisitor:
---------------------------
@niloc132
niloc132 / gxt230.patch
Created April 26, 2013 15:57
Quick draft at bringing Sigma-h up to GXT 2.3.0-gwt22
Index: pom.xml
===================================================================
--- pom.xml (revision 1297)
+++ pom.xml (working copy)
@@ -139,7 +139,7 @@
<dependency>
<groupId>com.extjs</groupId>
<artifactId>gxt</artifactId>
- <version>2.2.5-gwt22</version>
+ <version>2.3.0-gwt22</version>
public class Sample implements IsWidget {
private final Binder binder = GWT.create(Binder.class);
private Widget root;
@UiField(provided=true) MyBundle bundle = GWT.create(MyBundle.class);
public Sample() {
//first, provided items
bundle.myCss().ensureInjected();