0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
Commit graph

21 commits

Author SHA1 Message Date
Darius
72c7ae9901
update formatter config (#11640)
* update formatter config

* format

---------

Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
2024-08-08 12:12:50 +02:00
Ben Holmes
8ca7c731de
Actions: React 19 progressive enhancement support (#11071)
* deps: react 19

* feat: react progressive enhancement with useActionState

* refactor: revert old action state implementation

* feat(test): react 19 action with useFormStatus

* fix: remove unused context arg

* fix: wrote actions to wrong test fixture!

* deps: revert react 19 beta to 18 for actions-blog fixture

* chore: remove unused overrides

* chore: remove unused actions export

* chore: spaces vs tabs ugh

* chore: fix conflicting fixture names

* chore: changeset

* chore: bump changeset to minor

* Actions: support React 19 `useActionState()` with progressive enhancement (#11074)

* feat(ex): Like with useActionState

* feat: useActionState progressive enhancement!

* feat: getActionState utility

* chore: revert actions-blog fixture experimentation

* fix: add back actions.ts export

* feat(test): Like with use action state test

* fix: stub form state client-side to avoid hydration error

* fix: bad .safe chaining

* fix: update actionState for client call

* fix: correctly resume form state client side

* refactor: unify and document reactServerActionResult

* feat(test): useActionState assertions

* feat(docs): explain my mess

* refactor: add experimental_ prefix

* refactor: move all react internals to integration

* chore: remove unused getIslandProps

* chore: remove unused imports

* chore: undo format changes

* refactor: get actionResult from middleware directly

* refactor: remove bad result type

* fix: like button disabled timeout

* chore: changeset

* refactor: remove request cloning

* Update .changeset/gentle-windows-enjoy.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* changeset grammar tense

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-05-22 13:24:55 +01:00
Erika
c7edb22b4b [ci] format 2024-03-08 10:58:49 +00:00
Matthew Phillips
9cd84bd19b
Allow islands to be re-rendered with new props on page transition (#10136)
* Allow islands to be re-rendered with new props on page transition

* Adjust the expected styles

* Restore test expectation

* Add changeset and final change

* linting

* Implement transition:persist-props behavior

* Fix lockfile

* Fix expectations

* App is hyrid

* Update .changeset/lovely-nails-cough.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/lovely-nails-cough.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/lovely-nails-cough.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-03-08 10:54:16 +00:00
StandardGage
20ca3154fb
Fix Issues with passing void elements to React with experimentalReactChildren flag set (#9849)
* Create simple react element if element has no children

* Fix for when element has text

* add changeset

* minor -> patch

---------

Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2024-02-07 23:38:44 +05:30
matthewp
48bf7c3de6 [ci] format 2023-10-24 12:07:52 +00:00
Matthew Phillips
4dee38711c
Fix client hydration in experimentalReactChildren (#8898)
* Fix client hydration in experimentalReactChildren

* Add tests

* Add a changeset

* Use recursion instead of walking

* getChildren -> swap order

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-10-24 08:05:19 -04:00
Nate Moore
1f58a7a1be
Unmount framework components when islands are destroyed (#8264)
* 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-29 09:30:11 -05:00
Robin Neal
da517d4055
fix: remove react identifierPrefix from client:only (#8075)
This was causing React components rendered with client:only
to be prefixed with null. While not technically causing any
issues, it is unintended and could be considered a bug.

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2023-08-14 11:26:03 -05:00
ematipico
14fd198ea5 [ci] format 2023-05-04 14:25:03 +00:00
Robin Neal
ca329bbcae
Generate unique ids within each React island (#6976) 2023-05-04 15:23:00 +01:00
Anders Kaseorg
53e0c98dae
Fix spelling mistakes found by codespell and mwic (#5627) 2022-12-19 12:00:00 +01:00
matthewp
d48de5a06f [ci] format 2022-08-25 18:53:12 +00:00
Sanjaiyan Parthipan
3b5f34d606
Adding time-slicing with startTransition to prevent hydration from blocking the main thread for too long for those users who immediately scroll. (#4313)
* Adding timeslicing for hydrating  :)

* update
2022-08-25 14:50:45 -04:00
Nate Moore
7373d61cdc
Enable named slots in renderers (#3652)
* 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-06-23 10:10:54 -05:00
Nate Moore
e9a77d8619
Improve nested and client:only hydration (#3455)
* 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 ba27eaae55.

* chore: add changeset

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-05-31 11:29:36 -05:00
matthewp
8666f22a0f [ci] format 2022-05-12 16:06:40 +00:00
Ben Holmes
678c2b7523
Fix: React - Use "createRoot" instead of "hydrateRoot" for client:only (#3337)
* feat: pass "client" directive to clientEntrypoints

* refactor: remove hydration warning suppression react 17

* feat: remove hydration warning suppression react 18

* chore: changeset

* fix: change metadata to options bag
2022-05-12 10:05:55 -06:00
Fred K. Schott
1335797903
update prettier width (#2968) 2022-04-02 14:15:41 -06:00
Fred K. Schott
57f48b2701
Add support for React 18 in @astrojs/react (#2947)
* First pass at supporting React 18 in @astrojs/react

* Try marking React 18’s `react-dom/client` as external

* Try a different approach to importing different React versions

* Allow resolving JSON modules

* Revert "Allow resolving JSON modules"

This reverts commit 5279b7249c.

* Try the separate client entrypoint approach from #2946

* Clean up diff

* Trying to see something

* Just keep swimming… 🐠

* update to support react 18

* add changeset

* add docs

Co-authored-by: delucis <swithinbank@gmail.com>
2022-03-31 12:51:29 -04:00
Fred K. Schott
6386c14d00
Astro Integration System (#2820)
* 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
2022-03-18 15:35:45 -07:00