Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract RecordTransformBuffer interface #868

Merged
merged 1 commit into from
Jul 18, 2021
Merged

Conversation

dgeb
Copy link
Member

@dgeb dgeb commented Jul 18, 2021

By extracting the RecordTransformBuffer from the class that implements it, now called SimpleRecordTransformBuffer, we do the following:

  • Unlock experimentation with other implementations of RecordTransformBuffer.
  • Remove the circular dependency between sync-record-cache and record-transform-buffer. This cycle, while still "legal", highlighted an issue in esbuild.
  • Require that an instance of a RecordTransformBuffer be passed into record caches on construction, which simplifies the settings.

Note: To keep behavior consistent, all the standard derived cache classes now override _getTransformBuffer to construct a SimpleRecordTransformBuffer if a transformBuffer hasn't been provided in settings.

By extracting the `RecordTransformBuffer` from the class that implements it, now called `SimpleRecordTransformBuffer`, we do the following:

* Unlock experimentation with other implementations of `RecordTransformBuffer`.
* Remove the circular dependency between `sync-record-cache` and `record-transform-buffer`. This cycle, while still "legal", highlighted an issue in esbuild.
* Require that an _instance_ of a `RecordTransformBuffer` be passed into record caches on construction, which simplifies the settings.

Note: To keep behavior consistent, all the standard derived cache classes now override `_getTransformBuffer` to construct a `SimpleRecordTransformBuffer` if a `transformBuffer` hasn't been provided in settings.
@dgeb dgeb merged commit b57cfcb into main Jul 18, 2021
@dgeb dgeb deleted the record-transform-buffer-refactor branch July 18, 2021 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant