Summary: In order to support this the stream inceptor transform nodes now is able to return a list of new meta enties, since these are new attributes we try to mimic what would have happened if they were generated on the client. This makes the rest of the logic downstream simpler Introduced metadata register, same idea as on the clients. The attributes available are a mixed bag, will work with blok server to imporove Reviewed By: antonk52 Differential Revision: D45177781 fbshipit-source-id: 9d761b2f682e7e0fd4710f5b2e9d9d6ff26741fc
31 lines
687 B
TypeScript
31 lines
687 B
TypeScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @format
|
|
*/
|
|
|
|
import {Id, Metadata, StreamInterceptor, UINode} from '../types';
|
|
|
|
export function getStreamInterceptor(): StreamInterceptor {
|
|
return new NoOpStreamInterceptor();
|
|
}
|
|
|
|
class NoOpStreamInterceptor implements StreamInterceptor {
|
|
init() {
|
|
return null;
|
|
}
|
|
|
|
async transformNodes(
|
|
nodes: Map<Id, UINode>,
|
|
): Promise<[Map<Id, UINode>, Metadata[]]> {
|
|
return [nodes, []];
|
|
}
|
|
|
|
async transformMetadata(metadata: Metadata): Promise<Metadata> {
|
|
return metadata;
|
|
}
|
|
}
|