From 6b6fcad0a06edeeeb11c45b335c07d3ce8de3ef7 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 14 Jun 2023 22:13:31 +0200 Subject: [PATCH] docs: note limitations of not using shadow root closes #8686 --- packages/playground/start.js | 5 ++++- site/content/docs/04-run-time.md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/playground/start.js b/packages/playground/start.js index 4144ba97acfd..af2ed10a54ca 100644 --- a/packages/playground/start.js +++ b/packages/playground/start.js @@ -4,7 +4,10 @@ import { watch } from 'rollup'; import serve from 'rollup-plugin-serve'; import * as svelte from '../svelte/src/compiler/index.js'; -const __dirname = new URL('.', import.meta.url).pathname; +let __dirname = new URL('.', import.meta.url).pathname; +if (process.platform === 'win32') { + __dirname = __dirname.slice(1); // else path.resolve fucks up +} /** @returns {import('rollup').Plugin}*/ function create_plugin(ssr = false) { diff --git a/site/content/docs/04-run-time.md b/site/content/docs/04-run-time.md index 3b9097ae7464..76eefab1880b 100644 --- a/site/content/docs/04-run-time.md +++ b/site/content/docs/04-run-time.md @@ -1187,7 +1187,7 @@ el.name = 'everybody'; --- -When constructing a custom element, you can tailor several aspects by defining `customElement` as an object within ``. This object comprises a mandatory `tag` property for the custom element's name, an optional `shadow` property that can be set to `"none"` to forgo shadow root creation, and a `props` option, which offers the following settings: +When constructing a custom element, you can tailor several aspects by defining `customElement` as an object within ``. This object comprises a mandatory `tag` property for the custom element's name, an optional `shadow` property that can be set to `"none"` to forgo shadow root creation (note that styles are then no longer encapsulated, and you can't use slots), and a `props` option, which offers the following settings: - `attribute: string`: To update a custom element's prop, you have two alternatives: either set the property on the custom element's reference as illustrated above or use an HTML attribute. For the latter, the default attribute name is the lowercase property name. Modify this by assigning `attribute: ""`. - `reflect: boolean`: By default, updated prop values do not reflect back to the DOM. To enable this behavior, set `reflect: true`.