apache / apache/grails-core

Task: Document CompileStatic support in GSPs

Open
#14,265 0 comments 0 reactions 0 assignees View on GitHub
relates-to: grails-gsp
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

There is CompileStatic support in the code base, but it hasn't been documented.
The features have been tested in this test class:
https://github.com/grails/grails-gsp/blob/master/grails-gsp/src/test/groovy/org/grails/gsp/GspCompileStaticSpec.groovy

Features
- defining types for model attributes. this turns on CompileStatic mode for GSPs implicitly.
- model attributes can have default values
- possibility to turn off CompileStatic mode while keeping model type definitions
- tag library prefixes have to be defined with `taglibs` when it's not `g' or `tmpl`
- [`grails.views.gsp.compileStaticConfig.taglibs` config property for default](https://github.com/grails/grails-gsp/blob/master/grails-gsp/src/main/groovy/org/grails/gsp/compiler/GroovyPageParser.java#L258).

Contributor guide

Open the contributing guide

Research direction

Start by reading the behavior covered in grails-gsp/src/test/groovy/org/grails/gsp/GspCompileStaticSpec.groovy and the compileStaticConfig.taglibs reference in GroovyPageParser.java. Document the listed CompileStatic features, including typed model attributes, defaults, disabling CompileStatic, and taglib prefixes, in the appropriate GSP documentation location.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.