Skip to content

Conversation

vlaaad
Copy link
Contributor

@vlaaad vlaaad commented Sep 2, 2025

Now, it's possible to set properties in the game.project file using editor scripts:

editor.transact({
    editor.tx.set("/game.project", "project.dependencies", {
        "https://github.com/defold/extension-spine/archive/refs/tags/3.10.0.zip"
    })
})

🚨 Breaking change 🚨 for extensions that are based on extension-simpledata: Now, the editor expects the code that is invoked when form values are set/cleared to return transaction steps instead of performing a transaction. See this PR for the changes you need to make.

Fixes #11163

Now, it's possible to set properties in `game.project` file using editor scripts:
```lua
editor.transact({
    editor.tx.set("/game.project", "project.dependencies", {
        "https://github.com/defold/extension-spine/archive/refs/tags/3.10.0.zip"
    })
})
```

Fixes #11163
@vlaaad vlaaad requested a review from matgis September 2, 2025 09:07
matgis
matgis previously approved these changes Sep 3, 2025
Copy link
Contributor

@matgis matgis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

I like that :form-ops now return transaction steps. However, I think you'll need to also update the behavior in extension-simpledata: https://github.com/defold/extension-simpledata/blob/ca1dbf55d2ad7ae9324206806141d474ee9893eb/defold-simpledata/editor/src/simpledata-ext.clj#L90

We also need to explicitly provide migration instructions in release notes, since game projects might have added Clojure code based on extension-simpledata to their projects.

@vlaaad
Copy link
Contributor Author

vlaaad commented Sep 3, 2025

Simpledata PR: defold/extension-simpledata#19

@vlaaad vlaaad requested a review from matgis September 3, 2025 07:58
Copy link
Contributor

@matgis matgis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

(defn- ensure-does-not-transact [ret f]
(when (g/tx-result? ret)
(throw
(IllegalStateException.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct exception type to throw? Would UnsupportedOperationException be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think exception type doesn't matter here as much as the message...

@vlaaad vlaaad merged commit a51be3e into dev Sep 3, 2025
24 checks passed
@vlaaad vlaaad deleted the issue-11163-set-game-project-properties branch September 3, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ability to set game.project properties using editor scripts

2 participants