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

Updated markers.ts to employ the '⚡️' prefix for component styles, enhancing consistency with the Qwik Framework. #7248

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions .changeset/slimy-cougars-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'eslint-plugin-qwik': patch
'@builder.io/qwik-city': patch
'@builder.io/qwik': patch
---

removed playwrite patching of hasAttribute with toHaveAttribute
5 changes: 5 additions & 0 deletions .changeset/slow-comics-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@builder.io/qwik': patch
---

Updated markers.ts to employ the '⚡️' prefix for component styles, enhancing consistency with the Qwik Framework.
17 changes: 9 additions & 8 deletions packages/qwik/src/core/render/dom/render.unit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { assert, test, suite } from 'vitest';
import { createDOM } from '../../../testing/library';
import { renderToString } from '../../../server/render';
import { createDocument } from '../../../testing/document';
import { ComponentStylesPrefixContent as prefix } from 'packages/qwik/src/core/util/markers';

test('should render basic content', async () => {
const fixture = new ElementFixture();
Expand Down Expand Up @@ -218,15 +219,15 @@ test('should render a component with scoped styles', async () => {
`
<host q:version="dev" q:container="resumed" q:render="dom-dev">
<style q:style="ml52vk-0" hidden="">
.stuff.⭐️ml52vk-0 {
.stuff.${prefix}ml52vk-0 {
color: red;
}
</style>
<!--qv -->
<div class="⭐️ml52vk-0">
<div class="⭐️ml52vk-0 stuff" aria-hidden="true">
<div class="${prefix}ml52vk-0">
<div class="${prefix}ml52vk-0 stuff" aria-hidden="true">
Hello
<button class="⭐️ml52vk-0">
<button class="${prefix}ml52vk-0">
Toggle
</button>
</div>
Expand All @@ -241,15 +242,15 @@ test('should render a component with scoped styles', async () => {
`
<host q:version="dev" q:container="resumed" q:render="dom-dev">
<style q:style="ml52vk-0" hidden="">
.stuff.⭐️ml52vk-0 {
.stuff.${prefix}ml52vk-0 {
color: red;
}
</style>
<!--qv -->
<div class="⭐️ml52vk-0">
<div class="⭐️ml52vk-0">
<div class="${prefix}ml52vk-0">
<div class="${prefix}ml52vk-0">
Hello
<button class="⭐️ml52vk-0">
<button class="${prefix}ml52vk-0">
Toggle
</button>
</div>
Expand Down
47 changes: 24 additions & 23 deletions packages/qwik/src/core/render/ssr/render-ssr.unit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Slot } from '../jsx/slot.public';
import type { JSXOutput } from '../jsx/types/jsx-node';
import { SSRComment, SSRRaw } from '../jsx/utils.public';
import { _renderSSR, type RenderSSROptions } from './render-ssr';
import { ComponentStylesPrefixContent as prefix } from 'packages/qwik/src/core/util/markers';

test('render attributes', async () => {
await testSSR(
Expand Down Expand Up @@ -1125,43 +1126,43 @@ test('component useStylesScoped()', async () => {
`
<html q:container="paused" q:version="dev" q:render="ssr-dev" q:base="" q:manifest-hash="test">
<body>
<!--qv q:sstyle=⭐️1d-0|⭐️1e-1 q:id=0 q:key=sX:-->
<!--qv q:sstyle=${prefix}1d-0|${prefix}1e-1 q:id=0 q:key=sX:-->
<style q:style="1d-0" hidden>
.host.⭐️1d-0 {
.host.${prefix}1d-0 {
color: red;
}
</style>
<style q:style="1e-1" hidden>
.blue.⭐️1e-1 {
.blue.${prefix}1e-1 {
color: blue;
}
</style>
<div class="⭐️1d-0 ⭐️1e-1 host">
<div class="⭐️1d-0 ⭐️1e-1 div">
<div class="${prefix}1d-0 ${prefix}1e-1 host">
<div class="${prefix}1d-0 ${prefix}1e-1 div">
Scoped1
<!--qv q:s q:sref=0 q:key=-->
<div>projected</div>
<!--/qv-->
<p class="⭐️1d-0 ⭐️1e-1">Que tal?</p>
<p class="${prefix}1d-0 ${prefix}1e-1">Que tal?</p>
</div>
<!--qv q:sstyle=⭐️f0gmsw-0 q:id=1 q:key=sX:-->
<!--qv q:sstyle=${prefix}f0gmsw-0 q:id=1 q:key=sX:-->
<style q:style="f0gmsw-0" hidden>
.host.⭐️f0gmsw-0 {
.host.${prefix}f0gmsw-0 {
color: blue;
}
</style>
<div class="⭐️f0gmsw-0 host">
<div class="⭐️f0gmsw-0">
<div class="${prefix}f0gmsw-0 host">
<div class="${prefix}f0gmsw-0">
Scoped2
<p class="⭐️f0gmsw-0">Bien</p>
<p class="${prefix}f0gmsw-0">Bien</p>
</div>
</div>
<!--/qv-->
<!--qv q:sstyle=⭐️f0gmsw-0 q:id=2 q:key=sX:-->
<div class="⭐️f0gmsw-0 host">
<div class="⭐️f0gmsw-0">
<!--qv q:sstyle=${prefix}f0gmsw-0 q:id=2 q:key=sX:-->
<div class="${prefix}f0gmsw-0 host">
<div class="${prefix}f0gmsw-0">
Scoped2
<p class="⭐️f0gmsw-0">Bien</p>
<p class="${prefix}f0gmsw-0">Bien</p>
</div>
</div>
<!--/qv-->
Expand All @@ -1180,21 +1181,21 @@ test('component useStylesScoped() + slot', async () => {
</>,
`
<html q:container="paused" q:version="dev" q:render="ssr-dev" q:base="" q:manifest-hash="test">
<!--qv q:sstyle=⭐️lkei4s-0 q:id=0 q:key=sX:-->
<body class="⭐️lkei4s-0">
<!--qv q:sstyle=⭐️tdblg1-0 q:id=1 q:key=sX:-->
<!--qv q:sstyle=${prefix}lkei4s-0 q:id=0 q:key=sX:-->
<body class="${prefix}lkei4s-0">
<!--qv q:sstyle=${prefix}tdblg1-0 q:id=1 q:key=sX:-->
<style q:style="tdblg1-0" hidden>
.host.⭐️tdblg1-0 {
.host.${prefix}tdblg1-0 {
background: green;
}
</style>
<div class="⭐️tdblg1-0">
<div class="${prefix}tdblg1-0">
<!--qv q:s q:sref=1 q:key=one-->
<div q:slot="one" class="⭐️lkei4s-0">One</div>
<div q:slot="one" class="${prefix}lkei4s-0">One</div>
<!--/qv-->
</div>
<q:template q:slot="two" hidden aria-hidden="true" class="⭐️lkei4s-0">
<div q:slot="two" class="⭐️lkei4s-0">Two</div>
<q:template q:slot="two" hidden aria-hidden="true" class="${prefix}lkei4s-0">
<div q:slot="two" class="${prefix}lkei4s-0">Two</div>
</q:template>
<!--/qv-->
</body>
Expand Down
Loading
Loading