encore icon indicating copy to clipboard operation
encore copied to clipboard

Force Runtime DI setup before use.

Open DomBlack opened this issue 2 years ago • 1 comments

We recently refactored the runtime to use a DI setup with singletons routing the package level function calls into the runtime instance.

There's a bug where if a package uses one of these package level functions in an init() function, but the package doesn't import any other part of the Encore runtime or expose an API, it would result in a nil pointer deference, as the singletons had not be initialised yet.

This commit adds an import to the appinit package, which initialises the singletons.

To prevent a cicrular depdency I've had to move parts of appinit back into the app package and link into it with linkname.

DomBlack avatar Aug 08 '22 16:08 DomBlack

All committers have signed the CLA.

encore-cla[bot] avatar Aug 08 '22 16:08 encore-cla[bot]