Migration

Migration guide for migrating from Version 3 to Version 4

Changes in v4.0.0

Quebec v4.0.0 features a completely new way of dependency injection via Roblox's vanilla require. In combination to that, a lot of organizing has been done. It's expected that this version will be a lot easier to update and built on.

Migrating from v3.1.0

Migration should be simple, as the layout barely changed. However, the way singletons and dependencies are defined are changed as well as the way you run the Quebec module.

You can't migrate the lifecycle events that handled player joins and leaves. See Modding for more information.

Migrating the "Bootstrapper"

For this section, I'd like to link you to the Getting Started page, as it pretty much contains all the information needed. You just have to replace the old content of your bootstrapper with the new content.

Migrating Singletons

This should also be fairly easy, but might cause a lot of work especially if you have a lot of distributed services.

As you might have read already, we switched over to using Roblox's vanilla require function for dependency injection, instead of the old resolver method. So:

-- instead of:

function Service:init(resolver)
    self.otherService = resolver("@services/otherService")
end

-- you now just do:

local OtherService = require(script.Parent.OtherService)

-- note: all requires must be done before creating your service.

Now, to create a service, you just do this:

-- instead of

local Service = {
    lifecycles = { "start" }
}

function Service:start() end

return Service

-- you do this:

local Quebec = require(QuebecMainModule)

--[[ requires would be done here ]]

local Service = Quebec.singleton({
    lifecycles = { "start" }
})

function Service:start() end

return Service

Yeah, it is a little bit more boilerplate code, but it's worth it. You get better autocomplete and overall this is a better and more flexible approach than we had before.

Last updated