ballerina-lang icon indicating copy to clipboard operation
ballerina-lang copied to clipboard

Add chain invocation for `$moduleInit()`, `$moduleStart()`, and `$configureInit()` methods

Open Thushara-Piyasekara opened this issue 11 months ago • 2 comments

Purpose

During the codegen phase we generate a set of functions for initializing modules and their ballerina constructs. As of now, these initializations are done using a flattened dependency list for each ballerina module.

Fixes #42367

Approach

Changed the $moduleInit() and $moduleStart() BIRFunction generation boilerplate to generate a invocations of $moduleInit() functions instead of <.init>() functions. The new method generation will be as follows,

image

Did the same change for generated $configureInit() methods inside $configurationMapper class.

Samples

Full change samples can be found in this document.

Previous New

image image
image image
image image
image image

Remarks

List any other known issues, related PRs, TODO items, or any other notes related to the PR.

Check List

  • [x] Read the Contributing Guide
  • [ ] Updated Change Log
  • [ ] Checked Tooling Support (#<Issue Number>)
  • [ ] Added necessary tests
    • [ ] Unit Tests
    • [ ] Spec Conformance Tests
    • [ ] Integration Tests
    • [ ] Ballerina By Example Tests
  • [ ] Increased Test Coverage
  • [ ] Added necessary documentation
    • [ ] API documentation
    • [ ] Module documentation in Module.md files
    • [ ] Ballerina By Examples

Thushara-Piyasekara avatar Mar 22 '24 09:03 Thushara-Piyasekara