summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/runtime/client/dev-toolbar/apps/audit/a11y.ts6
-rw-r--r--packages/astro/src/runtime/server/astro-island.ts47
2 files changed, 28 insertions, 25 deletions
diff --git a/packages/astro/src/runtime/client/dev-toolbar/apps/audit/a11y.ts b/packages/astro/src/runtime/client/dev-toolbar/apps/audit/a11y.ts
index 48240317e..3bd296589 100644
--- a/packages/astro/src/runtime/client/dev-toolbar/apps/audit/a11y.ts
+++ b/packages/astro/src/runtime/client/dev-toolbar/apps/audit/a11y.ts
@@ -498,9 +498,9 @@ export const a11y: AuditRuleWithSelector[] = [
if (is_semantic_role_element(role, element.localName, getAttributeObject(element))) {
return;
}
-
+
const elementRoles = role.split(WHITESPACE_REGEX) as ARIARoleDefinitionKey[];
- for(const elementRole of elementRoles) {
+ for (const elementRole of elementRoles) {
const { requiredProps } = roles.get(elementRole)!;
const required_role_props = Object.keys(requiredProps);
const missingProps = required_role_props.filter((prop) => !element.hasAttribute(prop));
@@ -530,7 +530,7 @@ export const a11y: AuditRuleWithSelector[] = [
if (!role) return false;
const elementRoles = role.split(WHITESPACE_REGEX) as ARIARoleDefinitionKey[];
- for(const elementRole of elementRoles) {
+ for (const elementRole of elementRoles) {
const { props } = roles.get(elementRole)!;
const attributes = getAttributeObject(element);
const unsupportedAttributes = aria.keys().filter((attribute) => !(attribute in props));
diff --git a/packages/astro/src/runtime/server/astro-island.ts b/packages/astro/src/runtime/server/astro-island.ts
index 7741de25d..e1c73a5f0 100644
--- a/packages/astro/src/runtime/server/astro-island.ts
+++ b/packages/astro/src/runtime/server/astro-island.ts
@@ -101,30 +101,33 @@ declare const Astro: {
return;
}
try {
- await Astro[directive]!(
- async () => {
- const rendererUrl = this.getAttribute('renderer-url');
- const [componentModule, { default: hydrator }] = await Promise.all([
- import(this.getAttribute('component-url')!),
- rendererUrl ? import(rendererUrl) : () => () => {},
- ]);
- const componentExport = this.getAttribute('component-export') || 'default';
- if (!componentExport.includes('.')) {
- this.Component = componentModule[componentExport];
- } else {
- this.Component = componentModule;
- for (const part of componentExport.split('.')) {
- this.Component = this.Component[part];
+ await Astro[directive]!(
+ async () => {
+ const rendererUrl = this.getAttribute('renderer-url');
+ const [componentModule, { default: hydrator }] = await Promise.all([
+ import(this.getAttribute('component-url')!),
+ rendererUrl ? import(rendererUrl) : () => () => {},
+ ]);
+ const componentExport = this.getAttribute('component-export') || 'default';
+ if (!componentExport.includes('.')) {
+ this.Component = componentModule[componentExport];
+ } else {
+ this.Component = componentModule;
+ for (const part of componentExport.split('.')) {
+ this.Component = this.Component[part];
+ }
}
- }
- this.hydrator = hydrator;
- return this.hydrate;
- },
- opts,
- this
- )
+ this.hydrator = hydrator;
+ return this.hydrate;
+ },
+ opts,
+ this
+ );
} catch (e) {
- console.error(`[astro-island] Error hydrating ${this.getAttribute('component-url')}`, e);
+ console.error(
+ `[astro-island] Error hydrating ${this.getAttribute('component-url')}`,
+ e
+ );
}
}
hydrate = async () => {