Skip to content

Extract RecordTransformBuffer interface#868

Merged
dgeb merged 1 commit intomainfrom
record-transform-buffer-refactor
Jul 18, 2021
Merged

Extract RecordTransformBuffer interface#868
dgeb merged 1 commit intomainfrom
record-transform-buffer-refactor

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