summaryrefslogtreecommitdiff
path: root/packages/integrations/svelte/client.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-09-07fix(svelte): unmount islands properly on navigation (#8448)Gravatar Nate Moore 1-3/+3
2023-08-29[ci] formatGravatar natemoo-re 1-2/+2
2023-08-29Unmount framework components when islands are destroyed (#8264)Gravatar Nate Moore 1-1/+3
* fix(view-transitions): update persistence logic for improved unmount behavior * feat(astro): add `astro:unmount` event * feat(vue): automatically unmount islands * feat(react): automatically unmount islands * feat(react): automatically unmount islands * feat(solid): automatically dispose of islands * feat(svelte): automatically destroy of islands * feat(svelte): automatically destroy of islands * feat(solid): automatically dispose of islands * feat(preact): automatically unmount islands * chore: update changeset * fix: rebase issue * chore: add clarifying comment * chore: remove duplicate changeset * chore: add changeset
2023-08-15Filter out Svelte's unknown class prop console warnings (#7291)Gravatar Eric Mika 1-1/+59
* Filter out Svelte's unexpected class prop console warnings Astro's hydration code passes a `class` prop to Svelte components, inducing Svelte to log a warning about an unknown prop. Preempting this by exporting a `class` prop from the Svelte component isn't a viable workaround since `class` is a reserved identifier in JS. This PR implements the console-filtering workaround suggested by @HiDeoo in #5665, borrowing the `useConsoleFilter` approach from the [preact integration](https://github.com/withastro/astro/blob/a1c0cbe604c9f91cdc421b5606aab574999eba01/packages/integrations/preact/src/server.ts#L72-L94). It would probably be better to generalize console filtering so it could be shared across multiple integrations. Ideally there would be a way to handle this in Svelte, but as was pointed out in the issue thread even they resort to [similar cringe-inducing hackery](https://github.com/sveltejs/kit/blob/master/packages/kit/src/runtime/client/client.js#L1974-L1996) in sveltekit. * Only filter Svelte console warnings in dev builds * Add changeset * Fix lint error. --------- Co-authored-by: bluwy <bjornlu.dev@gmail.com> Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-02-15Fix unmount Svelte slots (#6250)Gravatar Bjorn Lu 1-1/+9
2022-10-10Allow `class` to be passed into Svelte islands (#5045)Gravatar Matthew Phillips 1-1/+0
* Allow class to be passed into svelte component * Adding a changeset
2022-06-23[ci] formatGravatar natemoo-re 1-8/+11
2022-06-23Enable named slots in renderers (#3652)Gravatar Nate Moore 1-4/+32
* feat: pass all slots to renderers * refactor: pass `slots` as top-level props * test: add named slot test for frameworks * fix: nested hydration, slots that are not initially rendered * test: add nested-recursive e2e test * fix: render unmatched custom element children * chore: update lockfile * fix: unrendered slots for client:only * fix(lit): ensure lit integration uses new slots API * chore: add changeset * chore: add changesets * fix: lit slots * feat: convert dash-case or snake_case slots to camelCase for JSX * feat: remove tmpl special logic * test: add slot components-in-markdown test * refactor: prefer Object.entries.map() to for/of loop Co-authored-by: Nate Moore <nate@astro.build>
2022-05-31Improve nested and `client:only` hydration (#3455)Gravatar Nate Moore 1-2/+3
* wip: fix nested islands * fix: improve hydration for dynamic content * chore: fix bundle-size script for new files * chore: allow-list client:* directive files * fix(#3362): fix client:only behavior for React, Vue, Solid * test: add client-only e2e test * chore: update lockfile * test: fix e2e tests * test: add framework nesting e2e tests * Update packages/astro/src/runtime/client/events.ts Co-authored-by: Matthew Phillips <matthew@skypack.dev> * chore: add changeset * fix(preact): ignore hydrate roots * chore: remove `ssr` check in integrations * Revert "chore: remove `ssr` check in integrations" This reverts commit ba27eaae5514701f4b7bb6259f682fe82821a23d. * chore: add changeset Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-03-18Astro Integration System (#2820)Gravatar Fred K. Schott 1-0/+14
* update examples * add initial integrations * update tests * update astro * update ci * get final tests working * update injectelement todo * update ben code review * respond to final code review feedback