Skip to content

v1.0.1-dev

Choose a tag to compare

@vq9o vq9o released this 02 Apr 18:52
· 42 commits to main since this release

Major Changes

  • Added proper self-binding through metatables for all services
  • Improved service method calls to preserve context
  • Improved lazy loading for service modules

Metatable Improvements

  • Service methods now properly receive self when called
  • Added automatic function wrapping to preserve context
  • Services can access Knight framework methods directly
  • Better error handling for method calls

Developer Experience

  • No changes required to existing services

Technical Details

  • Added __index metamethod to handle method lookups
  • Implemented function wrapping to preserve self reference
  • Added support for accessing Knight framework methods from services
  • Improved module loading performance through lazy evaluation

Example Usage

local MyService = {}

function MyService:Start()
    -- self is now properly set
    print(self)  -- Prints service table
    
    -- Can access Knight methods directly
    self:GetService("OtherService")
end

return MyService

Breaking Changes

None - All changes are backward compatible

For more information, see the documentation.

Knight Framework VS Code Extension Release! 🎉

We're excited to announce the official Visual Studio Code extension for the Knight Framework!

Installation / Usage

  1. Install the extension (https://marketplace.visualstudio.com/items?itemName=MetaGames.vsc-knight)
  2. Open a Knight framework project
  3. Create a new file with Ctrl + Alt + K or manually create one and auto-fill with Knight service template with Ctrl + K.

Feedback

Report issues and suggest features on our GitHub repository.