Skip to content

feat(lazy-loading): add Faker::Config.lazy_loading?#3226

Merged
stefannibrasil merged 1 commit intolazy-loading-betafrom
ta/configurable-lazy-loading
Mar 10, 2026
Merged

feat(lazy-loading): add Faker::Config.lazy_loading?#3226
stefannibrasil merged 1 commit intolazy-loading-betafrom
ta/configurable-lazy-loading

Conversation

@thdaraujo
Copy link
Copy Markdown
Contributor

@thdaraujo thdaraujo commented Mar 10, 2026

(Fixes #3225)

Adds configuration option to enable/disable lazy loading so it can be explicitly enabled during beta testing.

This flag will be used to enable lazy loading generators.

Adds configuration option to enable/disable lazy loading
so it can be explicitly enabled during beta testing.
@thdaraujo thdaraujo self-assigned this Mar 10, 2026
Copy link
Copy Markdown
Contributor

@stefannibrasil stefannibrasil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@stefannibrasil stefannibrasil merged commit bad5f5c into lazy-loading-beta Mar 10, 2026
@stefannibrasil stefannibrasil deleted the ta/configurable-lazy-loading branch March 10, 2026 22:43
stefannibrasil pushed a commit that referenced this pull request Apr 14, 2026
Adds configuration option to enable/disable lazy loading
so it can be explicitly enabled during beta testing.
stefannibrasil pushed a commit that referenced this pull request Apr 15, 2026
Adds configuration option to enable/disable lazy loading
so it can be explicitly enabled during beta testing.
stefannibrasil added a commit that referenced this pull request Apr 16, 2026
* feat(lazy-loading): add `Faker::Config.lazy_loading?` (#3226)

Adds configuration option to enable/disable lazy loading
so it can be explicitly enabled during beta testing.

* Introduce lazy loading as an optional config (#3228)

* Lazy load generators

To keep this change backwards compatible, we introduce
lazy loading as a config option.

We need to load main classes
first for nested generators such as 'music' and
when lazy loading is not enabled. 'internet/http'.

This will avoid the need for renaming these generators.

Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>

* Clean up skipped generators from determinism test

* Rename test file following conventions

* Run lazy loading smoke test in CI

* Check for true values when setting ENV['FAKER_LAZY_LOAD']

Covers the case of users setting the env using
truthy values.

* Better code for checking for ENV values

---------

Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>

---------

Co-authored-by: Thiago Araujo <707418+thdaraujo@users.noreply.github.com>
Co-authored-by: Thiago Araujo <thd.araujo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants