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

chore: rewrite set_class() to handle directives #15352

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
remove unused + fix JSDoc
  • Loading branch information
adiguba committed Feb 22, 2025
commit bf9c3052330549b69769279e5d323bbd108e7f36
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export function RegularElement(node, context) {
build_set_attributes(
attributes,
class_directives,
style_directives,
context,
node,
node_id,
Expand Down Expand Up @@ -310,7 +309,6 @@ export function RegularElement(node, context) {
attribute,
attributes,
class_directives,
style_directives,
context
);
if (is) is_attributes_reactive = true;
Expand Down Expand Up @@ -555,7 +553,6 @@ export function build_class_directives_object(class_directives, context) {
* @param {AST.Attribute} attribute
* @param {Array<AST.Attribute | AST.SpreadAttribute>} attributes
* @param {AST.ClassDirective[]} class_directives
* @param {AST.StyleDirective[]} style_directives
* @param {ComponentContext} context
* @returns {boolean}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export function SvelteElement(node, context) {
is_attributes_reactive = build_set_attributes(
attributes,
class_directives,
style_directives,
inner_context,
node,
element_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { build_template_chunk, get_expression_id } from './utils.js';
/**
* @param {Array<AST.Attribute | AST.SpreadAttribute>} attributes
* @param {AST.ClassDirective[]} class_directives
* @param {AST.StyleDirective[]} style_directives
* @param {ComponentContext} context
* @param {AST.RegularElement | AST.SvelteElement} element
* @param {Identifier} element_id
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/src/internal/shared/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function clsx(value) {
}

/**
* @param {any} clazz
* @param {any} value
* @param {string|null} [hash]
* @param {Record<string,boolean>} [classes]
* @returns {string|null}
Expand Down