diff --git a/playwright.config.js b/playwright.config.js index df8e3cff6..aae8335d2 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -37,4 +37,4 @@ const config = { } } -export default config \ No newline at end of file +export default config diff --git a/src/core/index.js b/src/core/index.js index 27a2ad15c..bfa0148d8 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -3,11 +3,12 @@ import { PageRenderer } from "./drive/page_renderer" import { PageSnapshot } from "./drive/page_snapshot" import { FrameRenderer } from "./frames/frame_renderer" import { FormSubmission } from "./drive/form_submission" +import { StreamActions } from "./streams/stream_actions" import { fetch } from "../http/fetch" const session = new Session() const { cache, navigator } = session -export { navigator, session, cache, PageRenderer, PageSnapshot, FrameRenderer, fetch } +export { navigator, session, cache, PageRenderer, PageSnapshot, FrameRenderer, StreamActions, fetch } /** * Starts the main session. diff --git a/src/core/streams/stream_actions.js b/src/core/streams/stream_actions.js index 064e94ca4..0e0ed2372 100644 --- a/src/core/streams/stream_actions.js +++ b/src/core/streams/stream_actions.js @@ -1,5 +1,3 @@ -import { session } from "../" - export const StreamActions = { after() { this.targetElements.forEach((e) => e.parentElement?.insertBefore(this.templateContent, e.nextSibling)) @@ -35,6 +33,6 @@ export const StreamActions = { }, refresh() { - session.refresh(this.baseURI, this.requestId) + window.Turbo.session.refresh(this.baseURI, this.requestId) } } diff --git a/src/index.js b/src/index.js index c3f27878e..07e3e097d 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,6 @@ import * as Turbo from "./core" window.Turbo = Turbo Turbo.start() -export { StreamActions } from "./core/streams/stream_actions" export * from "./core" export * from "./elements" export * from "./http" diff --git a/src/tests/fixtures/umd.html b/src/tests/fixtures/umd.html new file mode 100644 index 000000000..5bc410a65 --- /dev/null +++ b/src/tests/fixtures/umd.html @@ -0,0 +1,15 @@ + + +
+ +