Skip to content

Commit a9569b6

Browse files
committed
Realligning with orchestration
1 parent aeba892 commit a9569b6

36 files changed

+1827
-790
lines changed

SEQUENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ sequenceDiagram
129129

130130
## Notes
131131
- TSJS
132-
- Served first-party at `/static/tsjs-core.min.js` (and `/static/tsjs-ext.min.js` if prebid auto-config is enabled).
132+
- Served first-party at `/static/tsjs=tsjs-unified.min.js?v=<hash>`. The server dynamically concatenates core + enabled integration modules based on config.
133133
- Discovers ad units and renders placeholders; either uses slot-level HTML (`/first-party/ad`) or JSON auction (`/auction`).
134134
- Publisher HTML Rewriting
135135
- Injects TSJS loader and rewrites absolute URLs from origin domain to first-party domain during streaming.

crates/common/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ Helpers:
3838
- `rewrite_srcset(settings, srcset) -> String` — proxy absolute candidates; preserve descriptors (`1x`, `1.5x`, `100w`)
3939
- `split_srcset_candidates(srcset) -> Vec<&str>` — robust splitting for commas with/without spaces; avoids splitting the first `data:` mediatype comma
4040

41-
Static bundles (served by publisher module):
41+
JS bundles (served by publisher module):
4242

43-
- Unified dynamic endpoint: `/static/tsjs=<filename>`
44-
- `tsjs-core(.min).js` — core library
45-
- `tsjs-ext(.min).js` — Prebid.js shim/extension
46-
- `tsjs-creative(.min).js` — creative click‑guard injected into proxied creatives
43+
- Dynamic endpoint: `/static/tsjs=tsjs-unified.min.js?v=<hash>`
44+
- At build time, each integration is compiled as a separate IIFE (`tsjs-core.js`, `tsjs-prebid.js`, `tsjs-creative.js`, etc.)
45+
- At runtime, the server concatenates `tsjs-core.js` + enabled integration modules based on `IntegrationRegistry` config
46+
- The URL filename is fixed for backward compatibility; the `?v=` hash changes when modules change
4747

4848
Behavior is covered by an extensive test suite in `crates/common/src/creative.rs`.
4949

crates/common/src/creative.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ pub fn rewrite_creative_html(settings: &Settings, markup: &str) -> String {
322322
let injected = injected_ts_creative.clone();
323323
move |el| {
324324
if !injected.get() {
325-
let script_tag = tsjs::unified_script_tag();
325+
let script_tag = tsjs::tsjs_script_tag_all();
326326
el.prepend(&script_tag, ContentType::Html);
327327
injected.set(true);
328328
}

crates/common/src/html_processor.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ pub fn create_html_processor(config: HtmlProcessorConfig) -> impl StreamProcesso
203203
origin_host: &patterns.origin_host,
204204
document_state: &document_state,
205205
};
206-
// First inject the unified TSJS bundle (defines tsjs.setConfig, etc.)
207-
snippet.push_str(&tsjs::unified_script_tag());
206+
// First inject the TSJS bundle (defines tsjs.setConfig, etc.)
207+
let module_ids = integrations.js_module_ids();
208+
snippet.push_str(&tsjs::tsjs_script_tag(&module_ids));
208209
// Then add any integration-specific head inserts (e.g., mode config)
209210
// These run after the bundle so tsjs API is available
210211
for insert in integrations.head_inserts(&ctx) {

0 commit comments

Comments
 (0)