google / closure-templates

A client- and server-side templating system that helps you dynamically build reusable HTML and UI elements
Apache License 2.0
640 stars 194 forks source link

SoyToJsSrcCompiler.jar is out of date #747

Open awdavis opened 2 years ago

awdavis commented 2 years ago

In the download at https://dl.google.com/closure-templates/closure-templates-for-javascript-latest.zip referenced in https://github.com/google/closure-templates/blob/master/documentation/codelabs/helloworlds/helloworld_js.md, the provided file for SoyToJsSrcCompiler.jar is out of date. It does not support the current syntax and has outdated flags. Please provide an updated version of the jar file and related resources. Also consider including these updates in future releases so this isn't continually out of date.

Example error:

Exception in thread "main" com.google.template.soy.base.SoySyntaxException: In file index.soy: Unsupported attribute 'visibility' in 'template' command text (visibility="private").
        at com.google.template.soy.base.SoySyntaxException.createWithoutMetaInfo(SoySyntaxException.java:52)
        at com.google.template.soy.soytree.CommandTextAttributesParser.parse(CommandTextAttributesParser.java:109)
        at com.google.template.soy.soytree.TemplateBasicNodeBuilder.setCmdText(TemplateBasicNodeBuilder.java:107)
        at com.google.template.soy.soytree.TemplateBasicNodeBuilder.setCmdText(TemplateBasicNodeBuilder.java:47)
        at com.google.template.soy.soyparse.SoyFileParser.Template(SoyFileParser.java:300)
        at com.google.template.soy.soyparse.SoyFileParser.SoyFile(SoyFileParser.java:277)
        at com.google.template.soy.soyparse.SoyFileParser.parseSoyFile(SoyFileParser.java:192)
        at com.google.template.soy.soyparse.SoyFileSetParser.parseSoyFileHelper(SoyFileSetParser.java:266)
        at com.google.template.soy.soyparse.SoyFileSetParser.parseWithVersions(SoyFileSetParser.java:213)
        at com.google.template.soy.soyparse.SoyFileSetParser.parse(SoyFileSetParser.java:173)
        at com.google.template.soy.SoyFileSet.compileToJsSrcFiles(SoyFileSet.java:921)
        at com.google.template.soy.SoyToJsSrcCompiler.execMain(SoyToJsSrcCompiler.java:303)
        at com.google.template.soy.SoyToJsSrcCompiler.main(SoyToJsSrcCompiler.java:243)
emspishak commented 2 years ago

You can find more recent builds of Soy releases at https://mvnrepository.com/artifact/com.google.template/soy . If you click the "View All" link in the "Files" row of the table for a release (for example, on https://mvnrepository.com/artifact/com.google.template/soy/2022-03-07 ) you can then download the runnable JAR for the Soy-to-JS compiler for the release (soy-2022-03-07-SoyToJsSrcCompiler.jar for this release).

That codelab is out-of-date though and needs updating...