-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Started refactoring of sender/transport api
fixed few issues with publishers bundle Changed transports api Changed closure compilation logic commit_hash:d0216d9bd5e5011f515bcf0dc9e2dad06e689f28
- Loading branch information
1 parent
f4f2678
commit 3de0fb2
Showing
29 changed files
with
290 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/providers/consoleRenderer/__tests__/consoleRenderer.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { getProviderMiddlewares } from 'src/middleware'; | ||
import { MiddlewareWeightTuple } from 'src/middleware/types'; | ||
import { Provider } from 'src/providers/index'; | ||
import { getTransportList } from 'src/transport'; | ||
import { TransportId } from 'src/transport/transportsMap'; | ||
import { CounterOptions } from 'src/utils/counterOptions'; | ||
import { InternalSenderInfo, SenderInfo } from 'src/sender/SenderInfo'; | ||
import { mix } from 'src/utils/object'; | ||
import { useMiddlewareSender } from './middleware'; | ||
|
||
export const useManualMiddlewareSender = ( | ||
ctx: Window, | ||
counterOpt: CounterOptions, | ||
provider: Provider, | ||
transportIds?: TransportId[], | ||
middlewareList?: MiddlewareWeightTuple[], | ||
) => { | ||
const transports = getTransportList(ctx, provider, transportIds); | ||
const middlewares = getProviderMiddlewares( | ||
ctx, | ||
middlewareList || provider, | ||
counterOpt, | ||
); | ||
|
||
const sender = useMiddlewareSender(ctx, transports, middlewares); | ||
|
||
return (senderInfo: SenderInfo) => { | ||
const debugStack: (string | number)[] = [`mms.${provider}`]; | ||
const internalSenderInfo: InternalSenderInfo = mix( | ||
{ | ||
transportInfo: { | ||
debugStack, | ||
}, | ||
}, | ||
senderInfo, | ||
); | ||
|
||
return sender(internalSenderInfo); | ||
}; | ||
}; |
Oops, something went wrong.