Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hotwired/turbo

Package Overview
Dependencies
Maintainers
3
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hotwired/turbo - npm Package Compare versions

Comparing version 7.0.0-beta.4 to 7.0.0-beta.5

dist/types/core/bardo.d.ts

1

dist/types/core/drive/form_submission.d.ts

@@ -45,2 +45,3 @@ import { FetchRequest, FetchMethod, FetchRequestHeaders } from "../../http/fetch_request";

get enctype(): FormEnctype;
get isIdempotent(): boolean;
get stringFormData(): [string, string][];

@@ -47,0 +48,0 @@ start(): Promise<FetchResponse | undefined>;

@@ -0,1 +1,2 @@

import { Action } from "../types";
import { FetchResponse } from "../../http/fetch_response";

@@ -30,2 +31,3 @@ import { FormSubmission } from "./form_submission";

get restorationIdentifier(): string;
getActionForFormSubmission(formSubmission: FormSubmission): Action;
}

13

dist/types/core/frames/frame_controller.d.ts

@@ -17,16 +17,20 @@ import { FrameElement, FrameElementDelegate, FrameLoadingStyle } from "../../elements/frame_element";

readonly formInterceptor: FormInterceptor;
loadingURL?: string;
currentURL?: string;
formSubmission?: FormSubmission;
private resolveVisitPromise;
private connected;
private hasBeenLoaded;
private settingSourceURL;
constructor(element: FrameElement);
connect(): void;
disconnect(): void;
disabledChanged(): void;
sourceURLChanged(): void;
loadingStyleChanged(): void;
loadSourceURL(): Promise<void>;
loadResponse(response: FetchResponse): Promise<void>;
loadResponse(fetchResponse: FetchResponse): Promise<void>;
elementAppearedInViewport(element: Element): void;
shouldInterceptLinkClick(element: Element, url: string): boolean;
linkClickIntercepted(element: Element, url: string): void;
shouldInterceptFormSubmission(element: HTMLFormElement): boolean;
shouldInterceptFormSubmission(element: HTMLFormElement, submitter?: Element): boolean;
formSubmissionIntercepted(element: HTMLFormElement, submitter?: HTMLElement): void;

@@ -55,3 +59,4 @@ prepareHeadersForRequest(headers: FetchRequestHeaders, request: FetchRequest): void;

get enabled(): boolean;
get sourceURL(): string | null;
get sourceURL(): string | undefined;
set sourceURL(sourceURL: string | undefined);
get loadingStyle(): FrameLoadingStyle;

@@ -58,0 +63,0 @@ get isLoading(): boolean;

import { Snapshot } from "./snapshot";
export declare type PermanentElement = Element & {
id: string;
};
export declare type Placeholder = {
element: Element;
permanentElement: PermanentElement;
};
export declare abstract class Renderer<E extends Element, S extends Snapshot<E> = Snapshot<E>> {

@@ -23,5 +16,6 @@ readonly currentSnapshot: S;

focusFirstAutofocusableElement(): void;
get connectedSnapshot(): S;
get currentElement(): E;
get newElement(): E;
get permanentElementMap(): Record<string, [Element, Element]>;
}
export declare function replaceElementWithElement(fromElement: Element, toElement: Element): Element | undefined;
import { Adapter } from "./native/adapter";
import { FormSubmitObserver } from "../observers/form_submit_observer";
import { FormSubmitObserver, FormSubmitObserverDelegate } from "../observers/form_submit_observer";
import { FrameRedirector } from "./frames/frame_redirector";

@@ -17,3 +17,3 @@ import { History, HistoryDelegate } from "./drive/history";

export declare type TimingData = {};
export declare class Session implements HistoryDelegate, LinkClickObserverDelegate, NavigatorDelegate, PageObserverDelegate, PageViewDelegate {
export declare class Session implements FormSubmitObserverDelegate, HistoryDelegate, LinkClickObserverDelegate, NavigatorDelegate, PageObserverDelegate, PageViewDelegate {
readonly navigator: Navigator;

@@ -72,5 +72,5 @@ readonly history: History;

getActionForLink(link: Element): Action;
elementIsNavigable(element?: Element): boolean;
locationIsVisitable(location: URL): boolean;
get snapshot(): PageSnapshot;
}
export declare function elementIsNavigable(element?: Element): boolean;

@@ -7,6 +7,8 @@ export declare class Snapshot<E extends Element = Element> {

getElementForAnchor(anchor: string): Element | null;
get isConnected(): boolean;
get firstAutofocusableElement(): Element | null;
get permanentElements(): Element[];
getPermanentElementById(id: string): Element | null;
getPermanentElementsPresentInSnapshot(snapshot: Snapshot): Element[];
getPermanentElementMapForSnapshot(snapshot: Snapshot): Record<string, [Element, Element]>;
}
export declare type PermanentElementMap = Record<string, [Element, Element]>;

@@ -8,1 +8,2 @@ export declare type Locatable = URL | string;

export declare function toCacheKey(url: URL): string;
export declare function urlsAreEqual(left: string, right: string): boolean;

@@ -11,2 +11,3 @@ import { FetchResponse } from "../http/fetch_response";

sourceURLChanged(): void;
disabledChanged(): void;
formSubmissionIntercepted(element: HTMLFormElement, submitter?: HTMLElement): void;

@@ -13,0 +14,0 @@ loadResponse(response: FetchResponse): void;

@@ -31,2 +31,3 @@ import { FetchResponse } from "./fetch_response";

readonly method: FetchMethod;
readonly headers: FetchRequestHeaders;
readonly url: URL;

@@ -43,10 +44,7 @@ readonly body?: FetchRequestBody;

get fetchOptions(): RequestInit;
get isIdempotent(): boolean;
get headers(): {
get defaultHeaders(): {
Accept: string;
};
get isIdempotent(): boolean;
get abortSignal(): AbortSignal;
get defaultHeaders(): {
Accept: string;
};
}

@@ -14,2 +14,3 @@ import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";

"test no-action form submission with multiple parameters"(): Promise<void>;
"test no-action form submission submitter parameters"(): Promise<void>;
"test invalid form submission with unprocessable entity status"(): Promise<void>;

@@ -20,4 +21,7 @@ "test invalid form submission with server error status"(): Promise<void>;

"test frame form submission with redirect response"(): Promise<void>;
"test frame form submission toggles the ancestor frame's [busy] attribute"(): Promise<void>;
"test frame form submission toggles the target frame's [busy] attribute"(): Promise<void>;
"test frame form submission with empty created response"(): Promise<void>;
"test frame form submission with empty no-content response"(): Promise<void>;
"test frame form submission within a frame submits the Turbo-Frame header"(): Promise<void>;
"test invalid frame form submission with unprocessable entity status"(): Promise<void>;

@@ -27,3 +31,5 @@ "test invalid frame form submission with internal server errror status"(): Promise<void>;

"test frame form submission with HTTP verb other than GET or POST"(): Promise<void>;
"test form submission with Turbo disabled on the form"(): Promise<void>;
"test frame form submission with [data-turbo=false] on the form"(): Promise<void>;
"test frame form submission with [data-turbo=false] on the submitter"(): Promise<void>;
"test form submission with [data-turbo=false] on the form"(): Promise<void>;
"test form submission with [data-turbo=false] on the submitter"(): Promise<void>;

@@ -33,3 +39,4 @@ "test form submission skipped within method=dialog"(): Promise<void>;

"test form submission targets disabled frame"(): Promise<void>;
"test form submission targeting a frame submits the Turbo-Frame header"(): Promise<void>;
get formSubmitted(): Promise<boolean>;
}

@@ -1,4 +0,7 @@

import { FunctionalTestCase } from "../helpers/functional_test_case";
export declare class FrameTests extends FunctionalTestCase {
import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
export declare class FrameTests extends TurboDriveTestCase {
setup(): Promise<void>;
"test following a link preserves the current <turbo-frame> element's attributes"(): Promise<void>;
"test a frame whose src references itself does not infinitely loop"(): Promise<void>;
"test following a link driving a frame toggles the [busy] attribute"(): Promise<void>;
"test following a link to a page without a matching frame results in an empty frame"(): Promise<void>;

@@ -9,2 +12,5 @@ "test following a link within a frame with a target set navigates the target frame"(): Promise<void>;

"test following a link within a frame with target=_top navigates the page"(): Promise<void>;
"test following a link to a page with a <turbo-frame recurse> which lazily loads a matching frame"(): Promise<void>;
"test submitting a form that redirects to a page with a <turbo-frame recurse> which lazily loads a matching frame"(): Promise<void>;
"test removing [disabled] attribute from eager-loaded frame navigates it"(): Promise<void>;
}
export * from "./async_script_tests";
export * from "./autofocus_tests";
export * from "./form_submission_tests";

@@ -3,0 +4,0 @@ export * from "./frame_tests";

import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";
declare global {
interface Window {
savedElement: Element | null;
}
}
export declare class LoadingTests extends TurboDriveTestCase {

@@ -7,4 +12,7 @@ setup(): Promise<void>;

"test changing loading attribute from lazy to eager loads frame"(): Promise<void>;
"test navigating a visible frame with loading=lazy navigates"(): Promise<void>;
"test changing src attribute on a frame with loading=lazy defers navigation"(): Promise<void>;
"test changing src attribute on a frame with loading=eager navigates"(): Promise<void>;
"test navigating away from a page does not reload its frames"(): Promise<void>;
"test disconnecting and reconnecting a frame does not reload the frame"(): Promise<void>;
}

@@ -6,3 +6,6 @@ import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";

"test following a same-origin unannotated link"(): Promise<void>;
"test following a same-origin unannotated form[method=GET]"(): Promise<void>;
"test following a same-origin data-turbo-action=replace link"(): Promise<void>;
"test following a same-origin data-turbo-action=replace form[method=GET]"(): Promise<void>;
"test following a same-origin form with button[data-turbo-action=replace]"(): Promise<void>;
"test following a same-origin data-turbo=false link"(): Promise<void>;

@@ -9,0 +12,0 @@ "test following a same-origin unannotated link inside a data-turbo=false container"(): Promise<void>;

@@ -17,2 +17,3 @@ import { TurboDriveTestCase } from "../helpers/turbo_drive_test_case";

"test preserves permanent elements within turbo-frames rendered without layouts"(): Promise<void>;
"test preserves permanent element video playback"(): Promise<void>;
"test before-cache event"(): Promise<void>;

@@ -19,0 +20,0 @@ "test mutation record as before-cache notification"(): Promise<void>;

@@ -15,2 +15,4 @@ import { InternTestCase } from "./intern_test_case";

innerHTMLForSelector(selector: string): Promise<string>;
attributeForSelector(selector: string, attributeName: string): Promise<string | null>;
propertyForSelector(selector: string, attributeName: string): Promise<any>;
get scrollPosition(): Promise<{

@@ -22,2 +24,3 @@ x: number;

get nextBeat(): Promise<void>;
sleep(ms: number): Promise<void>;
evaluate<T>(callback: (...args: any[]) => T, ...args: any[]): Promise<T>;

@@ -29,2 +32,3 @@ get head(): Promise<Element>;

get pathname(): Promise<string>;
get search(): Promise<string>;
get searchParams(): Promise<URLSearchParams>;

@@ -31,0 +35,0 @@ getSearchParam(key: string): Promise<string>;

@@ -5,4 +5,6 @@ import { FunctionalTestCase } from "./functional_test_case";

declare type EventLog = [string, any];
declare type MutationLog = [string, string | null, string | null];
export declare class TurboDriveTestCase extends FunctionalTestCase {
eventLogChannel: RemoteChannel<EventLog>;
mutationLogChannel: RemoteChannel<MutationLog>;
lastBody?: Element;

@@ -12,2 +14,4 @@ beforeTest(): Promise<void>;

nextEventNamed(eventName: string): Promise<any>;
noNextEventNamed(eventName: string): Promise<boolean>;
nextAttributeMutationNamed(elementId: string, attributeName: string): Promise<string | null>;
get nextBody(): Promise<Element>;

@@ -14,0 +18,0 @@ get changedBody(): Promise<Element | undefined>;

{
"name": "@hotwired/turbo",
"version": "7.0.0-beta.4",
"version": "7.0.0-beta.5",
"description": "The speed of a single-page web application without having to write any JavaScript",

@@ -5,0 +5,0 @@ "module": "dist/turbo.es2017-esm.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc