Roblox - Kernel Framework v1.0.1

GithubLink - link
RobloxModel - link

version - 1.0.1

How To Use

  • Server Side Runtime
--Server Runtime
local Kernel = require(game:GetService("ReplicatedStorage").Kernel)

Kernel.SetServiceFolder(script.Services) --where will the services be taken from

Kernel.AddMiddleware(function(context, ...)
	print(string.format("[middleware] %s: %s.%s", context.Player.Name, context.Service, context.Method))
	return true
end)

Kernel.Start()
  • Client Side Runtime
--Client Runtime
local Kernel = require(game:GetService("ReplicatedStorage").Kernel)

Kernel.SetControllerFolder(script.Controllers) --where will the controllers be taken from
Kernel.Start()
  • Service & Controller Sides
--Test Service
local Kernel = require(game.ReplicatedStorage.Kernel)

local TestService = Kernel.CreateService({
	Name = "TestService",
	Client = {
		ping = Kernel.RemoteSignal(),

		hi = function(self, player: Player)
			return "hello: "..player.Name
		end,
	},
})

function TestService:KernelInit()
	print("im first started in server")
	
	self.Client.ping:Connect(function(player)
		print("ping", player.Name)
		self.Client.ping:Fire(player, "pong!")
	end)
end

function TestService:KernelStart()
	print("im second started")
end

return TestService
--Test Controller
local Kernel = require(game.ReplicatedStorage.Kernel)

local TestController = Kernel.CreateController({
	Name = "TestController",
})

function TestController:KernelInit()
	print("im first started in client")
	local TestService = Kernel.GetService("TestService")

	TestService.ping:Connect(function(msg)
		print("msg:", msg)
	end)
end

function TestController:KernelStart()
	print("im second started in client")
	local TestService = Kernel.GetService("TestService")
	print("Test controller server said:", TestService:hi())

	TestService.ping:Fire()
end

return TestController

why is it better than the Knit Framework:

  • Knit is an archived Framework
  • Knit has poor networking
  • Knit is quite old and needs to be updated

Contributors

- my first job
4 Likes

if someone tested this it would be grateful and compare it to knit

1 Like

I would be happy if someone checked it out

still no intellisense like knit right?

what?
Knit has a bad networking habit, which is why I made this module. I’ve heard this from many of my acquaintances.

Not bad, but not great. Clearly better than Knit, I don’t think anyone can argue with that

1 Like

Yes, but as Sleitnick stated,

Nothing is better than just using modules as provided by roblox, you get intellisense, you can use your own networking module if you wanted, and you’re not forced to a pattern

1 Like

what do you lack? what would you like to see in this module? maybe I will like this idea and I will think and add

Intellisense is the auto complete for variables and such. For example, Tween: , a dropdown pops up with options such as :Play(), :Create(), :Cancel() and such.

well, what is it for in the framework?

For one,

There is no intellisense on the kernel module itself

For two,
image
Services don’t get autocomplete.

Where as if you just use normal modules:
image
There is intellisense

Okay, I’ll add that and a bunch of other things, but did you like the module?

So its just Knit with better networking that’s it?

no it’s not a Knit rework, it’s completely different code and a different idea, just taken from Knit

and even more so, Knit is an archival framework, which means that it will not be updated, but I will update my framework to make it perfect.

I added type checking for return. You can check the pull requests on Kernel Github.

even if you added type checking, every time you make a new “service” or “controller” or anything that is loaded dynamically you won’t have intellisense. it’s one of many reasons why it’s discontinued

it seems like op just saw Knit was archived and wanted to make his own rendition of it without understanding why Knit was archived in the first place