Skip to content

feat: Add a file data synchronizer with auto-update to the FDv2 data system - #2245

Draft
joker23 wants to merge 1 commit into
mainfrom
skz/sdk-3558/fdv2-file-auto-update
Draft

joker23 wants to merge 1 commit into
mainfrom
skz/sdk-3558/fdv2-file-auto-update

Conversation

@joker23

@joker23 joker23 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lets an FDv2 dataSystem client use local files as a synchronizer:

const client = init(sdkKey, {
  dataSystem: {
    dataSource: {
      dataSourceOptionsType: 'custom',
      initializers: [],
      synchronizers: [{ type: 'file', paths: ['flags.json'], autoUpdate: true }],
    },
  },
});
  • A file entry can now be a synchronizer. An initializer keeps its current load-once behavior and ignores autoUpdate.
  • With autoUpdate: true, the source watches the files and sends a new full payload when they change.
  • A reload that fails keeps the last good data. The source logs the failure and continues.
  • Custom data source validation checks file paths and the platform file system before the client creates the store.
  • The file payload logic is shared between the FDv2 file initializer and the new synchronizer.

Additional context

  • The file translation and auto-update behavior match the FDv1 JS FileDataSource.
  • The FDv2 synchronizer shape follows the Go ldfiledatav2 source: full payloads, no selector, and watcher-driven reloads.
  • This is layer 2 of the Node server SDK v10 work. Layer 1, TestData as an FDv2 data source, is already merged.

Related tickets

  • sdk-3558

Opened from termag

…system

A `file` entry can now be an FDv2 synchronizer. With `autoUpdate`, it
watches the files and sends the new data when they change, the same as
the FDv1 file data source. A reload that fails keeps the last good data.
Custom data source validation also checks file paths and the platform
file system before the client creates the store.

Generated-by: termag
@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 34686 bytes
Compressed size limit: 35500
Uncompressed size: 123763 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 19243 bytes
Compressed size limit: 33000
Uncompressed size: 106351 bytes

@github-actions

Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 26507 bytes
Compressed size limit: 44000
Uncompressed size: 172426 bytes

This branch has not been deployed

No deployments
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.

1 participant