This introduces a new PreloadInsertingStream class which takes care of
writing assets into the React stream.
The stream class has a bunch of callback methods that can be used by
other code to add assets into the stream. This replaces a shared object
that was used before and relied on how shared object references work in
JavaScript which can be a bit more finicky. An added benefit is that our
callbacks rely on function signatures rather than object shapes so their
API is better defined.
This introduces a new PreloadInsertingStream class which takes care of writing assets into the React stream.
The stream class has a bunch of callback methods that can be used by other code to add assets into the stream. This replaces a shared object that was used before and relied on how shared object references work in JavaScript which can be a bit more finicky. An added benefit is that our callbacks rely on function signatures rather than object shapes so their API is better defined.