MCPcopy
hub / github.com/ampproject/amphtml / bootstrapThirdPartyFrames

Function bootstrapThirdPartyFrames

build-system/tasks/helpers.js:102–125  ·  view source on GitHub ↗

* Generates frames.html * * @param {!Object} options * @return {Promise }

(options)

Source from the content-addressed store, hash-verified

100 * @return {Promise<void>}
101 */
102async function bootstrapThirdPartyFrames(options) {
103 const startTime = Date.now();
104 if (options.watch) {
105 thirdPartyFrames.forEach((frameObject) => {
106 const watchFunc = async () => {
107 await thirdPartyBootstrap(frameObject.max, frameObject.min, options);
108 };
109 watch(frameObject.max).on(
110 'change',
111 debounce(watchFunc, watchDebounceDelay)
112 );
113 });
114 }
115 await Promise.all(
116 thirdPartyFrames.map(async (frameObject) => {
117 await thirdPartyBootstrap(frameObject.max, frameObject.min, options);
118 })
119 );
120 endBuildStep(
121 'Bootstrapped 3p frames into',
122 `dist.3p/${options.minify ? internalRuntimeVersion : 'current'}/`,
123 startTime
124 );
125}
126
127/**
128 * Compile and optionally minify the core runtime.

Callers 3

runPreDistStepsFunction · 0.85
runPreBuildStepsFunction · 0.85
storybookFunction · 0.85

Calls 6

thirdPartyBootstrapFunction · 0.85
endBuildStepFunction · 0.85
nowMethod · 0.80
debounceFunction · 0.50
forEachMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected