Refactor Roam bootstrappers and service management#49
Conversation
Improves error handling and configuration in ClientBootstrapper and ServerBootstrapper, adds support for custom require options, and refactors service registration, initialization, and startup logic in Roam. Updates example setup and deprecates outdated test file. Adds VSCode and Stylua configuration files for consistent formatting.
There was a problem hiding this comment.
Pull request overview
This pull request refactors the Roam service framework to improve error handling, configuration management, and code organization. The refactor extracts inline logic into well-named helper functions, adds comprehensive validation, and enhances the bootstrapper configuration options.
Changes:
- Refactors service registration, initialization, and startup logic with improved validation and error messages
- Adds support for custom require options (
AllowYieldingRequires,StopOnFailedRequire) in bootstrappers - Updates return type of
requireModulesto include aSuccessfield and structured result object - Adds VSCode settings and Stylua configuration for consistent code formatting
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
lib/roam/src/init.luau |
Major refactoring of service management with improved validation, error handling, and code organization into logical sections |
lib/roam/src/init.spec.luau |
Adds deprecation notice to outdated test file |
lib/roam/src/Bootstrappers/ServerBootstrapper.luau |
Adds configurable require options and improved error handling with result checking |
lib/roam/src/Bootstrappers/ClientBootstrapper.luau |
Adds configurable require options and improved error handling with result checking |
lib/roam/src/Bootstrappers/_ExampleSetup.luau |
Updates examples to use registerService instead of deprecated createService |
.vscode/settings.json |
Adds VSCode configuration for Lua/Luau formatting |
stylua.toml |
Adds Stylua formatter configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Improves Roam documentation with detailed lifecycle diagrams and explanations, corrects typos, and adds advanced lifecycle hooks to the Roam.start method. Introduces service state tracking, dependency graph printing, and service state querying for debugging. Also updates DropletClientManager.luau for code style consistency and minor refactoring, and adds new static images for documentation.
Introduces the StartConfig type to Roam and updates ClientBootstrapper and ServerBootstrapper to accept and pass custom lifecycle hooks to Roam.start. Refactors config handling for module requiring and improves error handling. Updates example setup to use new requireModules options. Bumps wally.toml version to 0.2.0.
Replaced Roam.requireModules with direct iteration and require of ModuleScript descendants for both Server and Client folders. This simplifies module registration and removes dependency on Roam's module loading utility.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 12 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Expanded and clarified documentation in init.luau, including example service and startup usage, contracts, and lifecycle hook details. Added and refined type annotations for StartConfig and other internal properties. Minor spelling corrections in comments and warnings for better clarity.
Enhanced the Roam.printDependencyGraph function to display a full recursive dependency tree for each service using tree symbols. The output now shows circular references and sorts dependencies alphabetically for clarity. Updated documentation and code examples for better accuracy and consistency.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 12 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Added explicit type annotations and type assertions throughout the code to improve type safety. Fixed a typo in documentation, updated service state from 'ACTIVE' to 'STARTED', and enhanced checks for coroutine and Promise handling. Also clarified comments and variable naming for better readability.
Extracted Service, ServiceConfig, ServiceState, and StartConfig type definitions from init.luau into a new types.luau module. Updated ClientBootstrapper.luau, ServerBootstrapper.luau, and init.luau to import and use the new types module, improving code organization and maintainability.
Bumped the documented version of the Roam package from 0.1.6 to 0.2.0 in the README to reflect the latest release.
Improves error handling and configuration in ClientBootstrapper and ServerBootstrapper, adds support for custom require options, and refactors service registration, initialization, and startup logic in Roam. Updates example setup and deprecates outdated test file. Adds VSCode and Stylua configuration files for consistent formatting.