I'm trying to port this to the new code and using this:
gantt.taskStore.rootNode
but it does not seem to have a percentDone anymore, I've checked the ProjectModel and it does not include the PercentDoneMixin, is there any way to retrieve the project progress based on the tasks?
It seems you're right. There is no public way to do this. We will discuss the possibility to create a field or a function to get the value out of the box. Meanwhile you can apply some manual calculation. Just need to calc average of percentDone field of top nodes. For example:
const topNodes = gantt.taskStore.rootNode.children;
const projectPercentDone = topNodes.length > 0 ? topNodes.reduce((acc, task) => acc + task.percentDone, 0) / topNodes.length : 100; // fallback to any if no tasks