Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix: wait for QRL to resolve for signal attribute" #7246

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/silly-nails-own.md

This file was deleted.

4 changes: 2 additions & 2 deletions packages/qwik/src/core/use/use-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ResourceEvent,
TaskEvent,
} from '../shared/utils/markers';
import { isPromise, retryOnPromise } from '../shared/utils/promises';
import { isPromise } from '../shared/utils/promises';
import { seal } from '../shared/utils/qdev';
import { isArray } from '../shared/utils/types';
import { setLocale } from './use-locale';
Expand Down Expand Up @@ -263,7 +263,7 @@ export const trackSignalAndAssignHost = (
if (value instanceof WrappedSignal && value.$hostElement$ !== host && host) {
value.$hostElement$ = host;
}
return retryOnPromise(() => trackSignal(() => value.value, host, property, container, data));
return trackSignal(() => value.value, host, property, container, data);
};

/** @internal */
Expand Down
28 changes: 28 additions & 0 deletions starters/apps/e2e/src/components/attributes/attributes.e2e.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { domRender, ssrRenderToDom } from "@qwik.dev/core/testing";
import { beforeEach, describe, it } from "vitest";
import { Attributes } from "./attributes";

const debug = false; //true;
Error.stackTraceLimit = 100;

describe.each([
{ render: ssrRenderToDom }, //
{ render: domRender }, //
])("$render.name: attributes.e2e", ({ render }) => {
describe("<Attributes/>", () => {
// let document: Document;
// let vNode: VNode;
// let container: ClientContainer;
// let getStyles: () => Record<string, string | string[]>;

beforeEach(async () => {
await render(<Attributes />, { debug });
// document = result.document;
// vNode = result.vNode!;
// container = result.container;
// getStyles = result.getStyles;
});

it("should run 'Toggle render'", async () => {});
});
});
49 changes: 1 addition & 48 deletions starters/apps/e2e/src/components/attributes/attributes.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
$,
Slot,
component$,
useComputed$,
useSignal,
useStore,
type PropsOf,
} from "@qwik.dev/core";
import { component$, useSignal, useStore } from "@qwik.dev/core";

export const Attributes = component$(() => {
const render = useSignal(0);
Expand All @@ -21,7 +13,6 @@ export const Attributes = component$(() => {
Rerender
</button>
<AttributesChild v={render.value} key={render.value} />
<ProgressParent />
</>
);
});
Expand Down Expand Up @@ -223,41 +214,3 @@ export const Issue4718Null = component$(() => {
</button>
);
});

const ProgressRoot = component$<{ min?: number } & PropsOf<"div">>((props) => {
const { ...rest } = props;

const minSig = useComputed$(() => props.min ?? 0);

const valueLabelSig = useComputed$(() => {
const value = minSig.value;
return `${value * 100}%`;
});

return (
<div aria-valuetext={valueLabelSig.value} {...rest}>
<Slot />
</div>
);
});

const ProgressParent = component$(() => {
const minGoal = useSignal(2000);

const incrementMin = $(() => {
minGoal.value += 500;
});

return (
<div>
<div>
<span id="progress-value">${minGoal.value}</span>
<button id="progress-btn" onClick$={incrementMin}>
+
</button>
</div>

<ProgressRoot min={minGoal.value}>Test</ProgressRoot>
</div>
);
});
9 changes: 0 additions & 9 deletions starters/e2e/e2e.attributes.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,6 @@ test.describe("attributes", () => {
await expect(button).not.toHaveAttribute("aria-label");
await expect(button).not.toHaveAttribute("title");
});

test("should update var prop QRL signal value", async ({ page }) => {
const button = page.locator("#progress-btn");
await button.click();
const progress = page.locator("#progress-value");
await expect(progress).toHaveText("$2500");
await button.click();
await expect(progress).toHaveText("$3000");
});
}

tests();
Expand Down
Loading