Skip to content

Commit

Permalink
Merge branch 'release/v1.0-beta-4'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienbaron committed Nov 18, 2017
2 parents 1fd1d7f + 5639670 commit e13e251
Show file tree
Hide file tree
Showing 37 changed files with 79 additions and 47 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.axellience</groupId>
<artifactId>vue-gwt-parent</artifactId>
<version>1.0-beta-3</version>
<version>1.0-beta-4</version>
</parent>

<artifactId>vue-gwt-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.ClientBundle.Source;
import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ArrayTypeName;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.CodeBlock;
import com.squareup.javapoet.FieldSpec;
Expand All @@ -27,6 +28,8 @@
import java.io.IOException;
import java.io.Writer;
import java.lang.annotation.Annotation;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* @author Adrien Baron
Expand Down Expand Up @@ -172,6 +175,24 @@ public static TypeName stringTypeToTypeName(String type)
if (type.equals("Double") || type.equals("java.lang.Double"))
return TypeName.DOUBLE.box();

return ClassName.bestGuess(type);
// Manage array types
Pattern arrayEnding = Pattern.compile("\\[\\]");
Matcher matcher = arrayEnding.matcher(type);
int arrayCount = 0;
while (matcher.find())
arrayCount++;

if (arrayCount > 0)
{
type = type.substring(0, type.length() - arrayCount * 2);
}

TypeName typeName = ClassName.bestGuess(type);
for (int i = 0; i < arrayCount; i++)
{
typeName = ArrayTypeName.of(typeName);
}

return typeName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,25 @@ private void generateGetRenderFunction(Builder templateBuilder,
* @param result The result from compilation using vue-template-compiler
*/
private void generateGetStaticRenderFunctions(Builder templateBuilder,
VueTemplateCompilerResult result)
VueTemplateCompilerResult result)
{
MethodSpec.Builder getStaticRenderFunctionsBuilder = MethodSpec
.methodBuilder("getStaticRenderFunctions")
.addModifiers(Modifier.PUBLIC)
.returns(String[].class)
.addStatement("return new String[] { $L }",
String.join(", ", result.getStaticRenderFunctions()));
CodeBlock.Builder staticFunctions = CodeBlock.builder();

boolean isFirst = true;
for (String staticRenderFunction : result.getStaticRenderFunctions()) {
if (!isFirst) {
staticFunctions.add(", ");
} else {
isFirst = false;
}
staticFunctions.add("$S", staticRenderFunction);
}

MethodSpec.Builder getStaticRenderFunctionsBuilder =
MethodSpec.methodBuilder("getStaticRenderFunctions")
.addModifiers(Modifier.PUBLIC)
.returns(String[].class)
.addStatement("return new String[] { $L }", staticFunctions.build());

templateBuilder.addMethod(getStaticRenderFunctionsBuilder.build());
}
Expand Down
2 changes: 1 addition & 1 deletion docs-source/book/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ When you are ready, you can get started with by **[setting it up on your project
If you use it on a small project, please <a href="https://gitter.im/Axellience/vue-gwt" target="_blank">let us know how it goes</a>.
</p>

*This documentation was last updated for [Vue.js v2.4.3](https://github.com/vuejs/vue/releases/tag/v2.4.3) and Vue GWT 1.0-beta-3*
*This documentation was last updated for [Vue.js v2.4.3](https://github.com/vuejs/vue/releases/tag/v2.4.3) and Vue GWT 1.0-beta-4*

## Who made this?

Expand Down
4 changes: 2 additions & 2 deletions docs-source/book/project-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ To add Vue GWT to your Maven project, simply add the following to your `pom.xml`
<dependency>
<groupId>com.axellience</groupId>
<artifactId>vue-gwt</artifactId>
<version>1.0-beta-3</version>
<version>1.0-beta-4</version>
</dependency>
<!-- Annotation Processors for Vue GWT -->
<dependency>
<groupId>com.axellience</groupId>
<artifactId>vue-gwt-processors</artifactId>
<version>1.0-beta-3</version>
<version>1.0-beta-4</version>
<optional>true</optional>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion docs-source/examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>com.axellience</groupId>
<artifactId>vue-gwt-examples</artifactId>
<packaging>war</packaging>
<version>1.0-beta-3</version>
<version>1.0-beta-4</version>
<name>Vue GWT Examples</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/integrating-with-js-components.html
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Integrating With JS Components","level":"8.1","depth":1,"next":{"title":"Using JS Components in Java","level":"8.1.1","depth":2,"anchor":"#using-js-components-in-java","path":"advanced/integrating-with-js-components.md","ref":"advanced/integrating-with-js-components.md#using-js-components-in-java","articles":[]},"previous":{"title":"Routing","level":"7.1","depth":1,"path":"scaling-up/routing.md","ref":"scaling-up/routing.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["include","toggle-chapters"],"pluginsConfig":{"include":{},"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"advanced/integrating-with-js-components.md","mtime":"2017-11-18T09:24:57.571Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-18T11:51:52.642Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Integrating With JS Components","level":"8.1","depth":1,"next":{"title":"Using JS Components in Java","level":"8.1.1","depth":2,"anchor":"#using-js-components-in-java","path":"advanced/integrating-with-js-components.md","ref":"advanced/integrating-with-js-components.md#using-js-components-in-java","articles":[]},"previous":{"title":"Routing","level":"7.1","depth":1,"path":"scaling-up/routing.md","ref":"scaling-up/routing.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["include","toggle-chapters"],"pluginsConfig":{"include":{},"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"advanced/integrating-with-js-components.md","mtime":"2017-11-18T11:53:05.446Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-18T14:35:30.125Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/unsupported-features.html
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Unsupported Features","level":"8.2","depth":1,"previous":{"title":"Using our Java Components in JS","level":"8.1.2","depth":2,"anchor":"#using-java-components-in-js","path":"advanced/integrating-with-js-components.md","ref":"advanced/integrating-with-js-components.md#using-java-components-in-js","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["include","toggle-chapters"],"pluginsConfig":{"include":{},"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"advanced/unsupported-features.md","mtime":"2017-09-10T17:55:25.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-18T11:51:52.642Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Unsupported Features","level":"8.2","depth":1,"previous":{"title":"Using our Java Components in JS","level":"8.1.2","depth":2,"anchor":"#using-java-components-in-js","path":"advanced/integrating-with-js-components.md","ref":"advanced/integrating-with-js-components.md#using-java-components-in-js","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["include","toggle-chapters"],"pluginsConfig":{"include":{},"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"advanced/unsupported-features.md","mtime":"2017-09-10T17:55:25.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-18T14:35:30.125Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/composition/custom-directives.html
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ <h1 class="search-results-title">No results matching "<span class='search-query'
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"Custom Directives","level":"4.2","depth":1,"next":{"title":"Render Function","level":"4.3","depth":1,"path":"composition/render-function.md","ref":"composition/render-function.md","articles":[{"title":"Basics","level":"4.3.1","depth":2,"anchor":"#basics","path":"composition/render-function.md","ref":"composition/render-function.md#basics","articles":[]},{"title":"The VNodeBuilder Instance","level":"4.3.2","depth":2,"anchor":"#v-node-builder-instance","path":"composition/render-function.md","ref":"composition/render-function.md#v-node-builder-instance","articles":[]},{"title":"Replacing Template Features with Plain Java","level":"4.3.3","depth":2,"anchor":"#replacing-template-feature-in-java","path":"composition/render-function.md","ref":"composition/render-function.md#replacing-template-feature-in-java","articles":[]}]},"previous":{"title":"Extending JS Components","level":"4.1.2","depth":2,"anchor":"#extending-js-component","path":"composition/extending-components.md","ref":"composition/extending-components.md#extending-js-component","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["include","toggle-chapters"],"pluginsConfig":{"include":{},"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"composition/custom-directives.md","mtime":"2017-10-05T15:40:12.835Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-18T11:51:52.642Z"},"basePath":"..","book":{"language":""}});
gitbook.page.hasChanged({"page":{"title":"Custom Directives","level":"4.2","depth":1,"next":{"title":"Render Function","level":"4.3","depth":1,"path":"composition/render-function.md","ref":"composition/render-function.md","articles":[{"title":"Basics","level":"4.3.1","depth":2,"anchor":"#basics","path":"composition/render-function.md","ref":"composition/render-function.md#basics","articles":[]},{"title":"The VNodeBuilder Instance","level":"4.3.2","depth":2,"anchor":"#v-node-builder-instance","path":"composition/render-function.md","ref":"composition/render-function.md#v-node-builder-instance","articles":[]},{"title":"Replacing Template Features with Plain Java","level":"4.3.3","depth":2,"anchor":"#replacing-template-feature-in-java","path":"composition/render-function.md","ref":"composition/render-function.md#replacing-template-feature-in-java","articles":[]}]},"previous":{"title":"Extending JS Components","level":"4.1.2","depth":2,"anchor":"#extending-js-component","path":"composition/extending-components.md","ref":"composition/extending-components.md#extending-js-component","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["include","toggle-chapters"],"pluginsConfig":{"include":{},"toggle-chapters":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"composition/custom-directives.md","mtime":"2017-10-05T15:40:12.835Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-11-18T14:35:30.125Z"},"basePath":"..","book":{"language":""}});
});
</script>
</div>
Expand Down
Loading

0 comments on commit e13e251

Please sign in to comment.