apache / apache/grails-core

Hot Swapping for Domains and their views doesn't work - restart required

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

Description

So I've noticed that when I have a .gson file which renders a domain instance and then i add new properties to that domain during development, the rest of the application handles it pretty well, but from the gson i get exceptions when trying to access those new properties, for example

```
jobLayoutTemplate_gson: 19: [Static type checking] - No such property: ldBackgroundImage for class: JobLayoutTemplate
@ line 19, column 21.
ldBackgroundImage jobLayoutTemplate.ldBackgroundImage?.getSimpleInstance()
```

At that point, i gotta restart the app.

This is not a very urgent issue, as restart usually doesnt take too long, but I wanted to point out to you that hot-swapping new domain properties seems to work well otherwise, its usually the gsons that have trouble with it.

*Grails version:* 3.1.10
*Grails views:*: 1.2.6

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the problem with a .gson view such as jobLayoutTemplate_gson after adding a property to its domain instance. Check whether the static type-checking exception persists in Grails 3.1.10 with Grails views 1.2.6. Done means newly added domain properties can be accessed from the .gson view without restarting the application.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.