Skip to content
Closed
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
22 changes: 13 additions & 9 deletions index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ let current_component;
function set_current_component(component) {
current_component = component;
}
Promise.resolve();

// source: https://html.spec.whatwg.org/multipage/indices.html
const boolean_attributes = new Set([
const _boolean_attributes = [
'allowfullscreen',
'allowpaymentrequest',
'async',
Expand All @@ -38,6 +36,7 @@ const boolean_attributes = new Set([
'disabled',
'formnovalidate',
'hidden',
'inert',
'ismap',
'loop',
'multiple',
Expand All @@ -50,7 +49,12 @@ const boolean_attributes = new Set([
'required',
'reversed',
'selected'
]);
];
/**
* List of HTML boolean attributes (e.g. `<input disabled>`).
* Source: https://html.spec.whatwg.org/multipage/indices.html
*/
const boolean_attributes = new Set([..._boolean_attributes]);

const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
Expand Down Expand Up @@ -151,7 +155,7 @@ function validate_component(component, name) {
if (!component || !component.$$render) {
if (name === 'svelte:component')
name += ' this={...}';
throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);
throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`);
}
return component;
}
Expand Down Expand Up @@ -200,7 +204,7 @@ function add_attribute(name, value, boolean) {
function style_object_to_string(style_object) {
return Object.keys(style_object)
.filter(key => style_object[key])
.map(key => `${key}: ${style_object[key]};`)
.map(key => `${key}: ${escape_attribute_value(style_object[key])};`)
.join(' ');
}

Expand Down Expand Up @@ -390,7 +394,7 @@ function objectWithKey(key, value) {
: {}
}

/* src/components/SvgElement.svelte generated by Svelte v3.49.0 */
/* src/components/SvgElement.svelte generated by Svelte v3.59.2 */

const SvgElement = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let { tag } = $$props;
Expand Down Expand Up @@ -430,7 +434,7 @@ const SvgElement = create_ssr_component(($$result, $$props, $$bindings, slots) =
return `<svg${spread([escape_object(elementProps)], {})}${add_attribute("this", ref, 0)}><!-- HTML_TAG_START -->${markup}<!-- HTML_TAG_END --></svg>`;
});

/* src/components/FontAwesomeIcon.svelte generated by Svelte v3.49.0 */
/* src/components/FontAwesomeIcon.svelte generated by Svelte v3.59.2 */

const FontAwesomeIcon = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let $$restProps = compute_rest_props($$props, [
Expand Down Expand Up @@ -535,7 +539,7 @@ const FontAwesomeIcon = create_ssr_component(($$result, $$props, $$bindings, slo
$$rendered = `${result
? `${validate_component(SvgElement, "SvgElement").$$render(
$$result,
Object.assign(result, { style }, { ref }),
Object.assign({}, result, { style }, { ref }),
{
ref: $$value => {
ref = $$value;
Expand Down
22 changes: 13 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
function set_current_component(component) {
current_component = component;
}
Promise.resolve();

// source: https://html.spec.whatwg.org/multipage/indices.html
const boolean_attributes = new Set([
const _boolean_attributes = [
'allowfullscreen',
'allowpaymentrequest',
'async',
Expand All @@ -42,6 +40,7 @@
'disabled',
'formnovalidate',
'hidden',
'inert',
'ismap',
'loop',
'multiple',
Expand All @@ -54,7 +53,12 @@
'required',
'reversed',
'selected'
]);
];
/**
* List of HTML boolean attributes (e.g. `<input disabled>`).
* Source: https://html.spec.whatwg.org/multipage/indices.html
*/
const boolean_attributes = new Set([..._boolean_attributes]);

const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
Expand Down Expand Up @@ -155,7 +159,7 @@
if (!component || !component.$$render) {
if (name === 'svelte:component')
name += ' this={...}';
throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);
throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`);
}
return component;
}
Expand Down Expand Up @@ -204,7 +208,7 @@
function style_object_to_string(style_object) {
return Object.keys(style_object)
.filter(key => style_object[key])
.map(key => `${key}: ${style_object[key]};`)
.map(key => `${key}: ${escape_attribute_value(style_object[key])};`)
.join(' ');
}

Expand Down Expand Up @@ -394,7 +398,7 @@
: {}
}

/* src/components/SvgElement.svelte generated by Svelte v3.49.0 */
/* src/components/SvgElement.svelte generated by Svelte v3.59.2 */

const SvgElement = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let { tag } = $$props;
Expand Down Expand Up @@ -434,7 +438,7 @@
return `<svg${spread([escape_object(elementProps)], {})}${add_attribute("this", ref, 0)}><!-- HTML_TAG_START -->${markup}<!-- HTML_TAG_END --></svg>`;
});

/* src/components/FontAwesomeIcon.svelte generated by Svelte v3.49.0 */
/* src/components/FontAwesomeIcon.svelte generated by Svelte v3.59.2 */

const FontAwesomeIcon = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let $$restProps = compute_rest_props($$props, [
Expand Down Expand Up @@ -539,7 +543,7 @@
$$rendered = `${result
? `${validate_component(SvgElement, "SvgElement").$$render(
$$result,
Object.assign(result, { style }, { ref }),
Object.assign({}, result, { style }, { ref }),
{
ref: $$value => {
ref = $$value;
Expand Down
Loading