Commit graph

6202 commits

Author SHA1 Message Date
Evan Almloff
e794be5d78
Improve warnings when trying to update outside of pending suspense boundaries on the server (#2575)
* Improve warnings when trying to update outside of pending suspense boundaries on the server

* remove suspense resolve log
2024-07-17 19:32:33 -07:00
Jonathan Kelley
88af3e7eff
Hotreloading of for/if/body, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI (#2258)
Hotreload the contents of for loops, if chains, component bodies, props, attributes, and any literals discovered in rsx!
Add a TUI renderer to the CLI.
Improve the CLI build system to be async and parallel.
Refactor RSX to allow partial expansion of expressions.
Merge autofmt implementations for consistency.
Merge the representation of elements and components under the hood.
Add a diagnostics system for rsx for improved error messages.
Drop interprocess and move to websockets for communication between the CLI and the server.
Assign IDs to nodes and attributes in a stable way to be used in non compiler contexts.
Add hotreloading to any body of component/for loop/if chain/etc.

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Co-authored-by: Liam Mitchell <liamkarlmitchell@gmail.com>
2024-07-17 19:11:18 -07:00
Evan Almloff
176e67e5b7
switch to a Document trait and introduce Script/Head/Style/Meta components (#2635)
* switch to a Document trait and introduce Script/Head/Style/Meta components

* Fix desktop title

* Insert special elements into the head during the inital SSR render

* Make all head component attributes optional

* hydrate head elements

* improve the server streaming head warning

* Document fullstack head hydration approach

* deduplicate head elements by href

* move Link into head::Link

* document head components

* add meta and title examples

* Fix a few doc examples

* fix formatting

* Add title to playwright tests

* serde is optional on web, but it is enabled by hydrate

* remove leftover console log
2024-07-17 20:54:03 -05:00
Evan Almloff
a490a94ae5
make playwright timeout even longer (50min) 2024-07-18 03:26:12 +02:00
Evan Almloff
742721bfde expose static site generation in the launch builder and prelude 2024-07-10 16:59:08 -07:00
Evan Almloff
580bf666a6 fix static generation playwright test 2024-07-10 16:50:21 -07:00
Jonathan Kelley
2e8af5fc62
fix clippy on zoom example 2024-07-10 12:50:57 -07:00
Andrew Scott
69d7098d0e
feat (desktop): upgrade from wry 37 to 41 (#2618) 2024-07-10 12:50:04 -07:00
dependabot[bot]
b4934ab974
Bump JamesIves/github-pages-deploy-action from 4.6.1 to 4.6.3 (#2605)
Bumps [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) from 4.6.1 to 4.6.3.
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.6.1...v4.6.3)

---
updated-dependencies:
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 12:43:55 -07:00
Evan Almloff
96450a110e
Fix empty prefixes (#2621) 2024-07-10 12:43:28 -07:00
Evan Almloff
b13236cd38
Add a playwright test that checks static generation (#2608)
* add a playwright test that checks static generation

* add playwright-static-generation to the workspace

* fix static-generation name in CLI
2024-07-10 12:43:02 -07:00
Evan Almloff
f07ab370b9
Fix context type in static generation crate (#2607) 2024-07-10 12:42:33 -07:00
Evan Almloff
c47d7da070 fix windows CI rust version 2024-07-10 10:53:50 -07:00
Andrew Scott
156144e8f5
fix (desktop): hide menu when window decorations are disabled (#2613)
* fix: hide menu when window decorations are disabled

* chore: clearer doc description
2024-07-09 12:37:58 -07:00
Andrew Scott
bb52280a51
fix (regression): hide desktop window until initial render (#2614) 2024-07-09 12:32:05 -07:00
Evan Almloff
ecdc93232e
Expand component definition before errors to fix component autocomplete from other modules (#2609) 2024-07-08 11:21:20 -07:00
Evan Almloff
d6ca80e494 bump rustc version in CI 2024-07-08 10:13:32 -07:00
luveti
e1ea213d05
Fix fullstack desktop launch (#2581) 2024-07-03 12:18:56 -05:00
Jonathan Kelley
2c20d3dc5e
Remove deprecated macros: inline_props, format_args_f!, render! (#2574)
* remove deprecated macros

* Rename derive_typed_builder
2024-07-02 21:46:11 -07:00
Miles Murgaw
7f6f0de085
Partially Fix Hotreload (#2557)
* fix: template names

* fix: hot reload "resets" after reload

* revision: ensure all paths are split by `/`

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-02 21:45:12 -07:00
Miles Murgaw
9567674a63
Feat: CLI Settings (#2424)
* feat: cli settings

* revision: lower msrv

* add previous line about hotreload settings just in case

* Fix issue with open

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-02 21:43:58 -07:00
Miles Murgaw
2ef406982e
Use Manganis Linker System (#2561)
* feat: new manganis linker

* revision: fmt, clippy, cleanup

* revision: link subcommand

* fix: async runtime

* revision: remove working dir arg

* revision: switch dep source

* fix: matrix, playwright

* fix: fullstack manganis
2024-07-02 21:36:44 -07:00
Jonathan Kelley
90c46afd12
fix fmt tests 2024-07-02 17:22:53 -07:00
Jonathan Kelley
b30810e486
cut out a number of changes from the hr PR (#2580) 2024-07-02 17:09:57 -07:00
Evan Almloff
9bf46968cd
don't unwrap when fullstack fails to get the path and query information from the request (#2578) 2024-07-02 15:31:52 -07:00
Evan Almloff
4cab834640
switch to comments as placeholder nodes (#2579) 2024-07-02 15:31:18 -07:00
Jonathan Kelley
30f6986283
Fix clippy 2024-07-02 12:39:32 -07:00
Jonathan Kelley
1404d26455
Switch to using refs instead of owned for autofmt write block out (#2573) 2024-07-02 12:27:11 -07:00
Jonathan Kelley
d4831edcf7
edit settings.json to disable format on save for the repo (#2572) 2024-07-02 12:18:25 -07:00
Evan Almloff
022e4ad203
Suspense boundaries/out of order streaming/anyhow like error handling (#2365)
* create static site generation helpers in the router crate

* work on integrating static site generation into fullstack

* move ssg into a separate crate

* integrate ssg with the launch builder

* simplify ssg example

* fix static_routes for child routes

* move CLI hot reloading websocket code into dioxus-hot-reload

* fix some unused imports

* use the same hot reloading websocket code for fullstack

* fix fullstack hot reloading

* move cli hot reloading logic into the hot reload crate

* ssg example working with dx serve

* add more examples

* fix clippy

* switch to a result for Element

* fix formatting

* fix hot reload doctest imports

* fix axum imports

* add show method to error context

* implement retaining nodes during suspense

* fix unterminated if statements

* communicate between tasks and suspense boundaries

* make suspense placeholders easier to use

* implement IntoDynNode and IntoVNode for more wrappers

* fix clippy examples

* fix rsx tests

* add streaming html utilities to the ssr package

* unify hydration and non-hydration ssr cache

* fix router with Result Element

* don't run server doc tests

* Fix hot reload websocket doc examples

* simple apps working with fullstack streaming

* fix preloading wasm

* Report errors encountered while streaming

* remove async from incremental renderer

* document new VirtualDom suspense methods

* make streaming work with incremental rendering

* fix static site generation

* document suspense structs

* create closure type; allow async event handlers in props; allow shorthand event handlers

* test forwarding event handlers with the shorthand syntax

* fix clippy

* fix imports in spawn async doctest

* fix empty rsx

* fix async result event handlers

* fix mounting router in multiple places

* Fix task dead cancel race condition

* simplify diffing before adding suspense

* fix binary size increase

* fix attribute diffing

* more diffing fixes

* create minimal fullstack feature

* smaller fullstack bundles

* allow mounting nodes that are already created and creating nodes without mounting them

* fix hot reload feature

* fix replacing components

* don't reclaim virtual nodes

* client side suspense working!

* fix CLI

* slightly smaller fullstack builds

* fix multiple suspended scopes

* fix merge errors

* yield back to tokio every few polls to fix suspending on many tasks at once

* remove logs

* document suspense boundary and update suspense example

* fix ssg

* make streaming optional

* fix some router and core tests

* fix suspense example

* fix serialization with out of order server futures

* add incremental streaming hackernews demo

* fix hackernews demo

* fix root hackernews redirect

* fix formatting

* add tests for suspense cases

* slightly smaller binaries

* slightly smaller

* improve error handling docs

* fix errors example link

* fix doc tests

* remove log file

* fix ssr cache type inference

* remove index.html

* fix ssg render template

* fix assigning ids on elements with dynamic attributes

* add desktop feature to the workspace examples

* remove router static generation example; ssg lives in the dioxus-static-generation package

* add a test for effects during suspense

* only run effects on mounted nodes

* fix multiple suspense roots

* fix node iterator

* fix closures without arguments

* fix dioxus-core readme doctest

* remove suspense logs

* fix scope stack

* fix clippy

* remove unused suspense boundary from hackernews

* assert that launch never returns for better compiler errors

* fix static generation launch function

* fix web renderer

* pass context providers into server functions

* add an example for FromContext

* clean up DioxusRouterExt

* fix server function context

* fix fullstack desktop example

* forward CLI serve settings to fullstack

* re-export serve config at the root of fullstack

* forward env directly instead of using a guard

* just set the port in the CLI for fullstack playwright tests

* fix fullstack dioxus-cli-config feature

* fix launch server merge conflicts

* fix fullstack launch context

* Merge branch 'main' into suspense-2.0

* fix fullstack html data

* remove drop virtual dom feature

* add a comment about only_write_templates binary size workaround

* remove explicit dependencies from use_server_future

* make ErrorContext and SuspenseContext more similar

* Tweak: small tweaks to tomls to make diff smaller

* only rerun components under suspense after the initial placeholders are sent to the client

* add module docs for suspense

* keep track of when suspense boundaries are resolved

* start implementing JS out of order streaming

* fix core tests

* implement the server side of suspense with js

* fix streaming ssr with nested suspense

* move streaming ssr code into fullstack

* revert minification changes

* serialize server future data as the html streams

* start loading scripts wasm immediately instead of defering the script

* very basic nested suspense example working with minimal html updates

* clean up some suspense/error docs

* fix hydrating nested pending server futures

* sort resolved boundaries by height

* Fix disconnecting clients while streaming

* fix static generation crate

* don't insert extra divs when hydrating streamed chunks

* wait to swap in the elements until they are hydrated

* remove inline streaming script

* hackernews partially working

* fix spa mode

* banish the open shadow dom

* fix removing placeholder

* set up streaming playwright test

* run web playwright tests on 9999 to avoid port conflicts with other local servers

* remove suspense nodes if the suspense boundary is replaced before the suspense resolves on the server

* ignore hydration of removed suspense boundaries

* use path based indexing to fix hydrating suspense after parent suspense with child is removed

* re-export dioxus error

* remove resolved suspense divs if the suspense boundary has been removed

* Fix client side initialized server futures

* ignore comment nodes while traversing nodes in core to avoid lists getting swapped out with suspense

* Pass initial hydration data to the client

* hide pre nodes

* don't panic if reclaiming an element fails

* fix scope stack when polling tasks

* improve deserialization out of length message

* Ok(VNode::placeholder()) -> VNode::empty()

* fix typo in rsx usage

* restore testing changes from suspense example

* clean up some logs and comments

* fix playwright tests

* clean up more changes in core

* clean up core tests

* remove anymap dependency

* clean up changes to hooks

* clean up changes in the router, rsx, and web

* revert changes to axum-hello-world

* fix use_server_future

* fix clippy in dioxus-core

* check that the next or previous node exist before checking if we should ignore them

* fix formatting

* fix suspense playwright test

* remove unused suspense code

* add more suspense playwright tests

* add more docs for error boundaries

* fix suspense core tests

* fix ErrorBoundary example

* remove a bunch of debug logging in js

* fix router failure_external_navigation

* use absolute paths in the interpreter build.rs

* strip '\r' while hashing ts files

* add a wrapper with a default error boundary and suspense boundary

* restore hot reloading

* ignore non-ts files when hashing

* sort ts files before hashing them

* fix rsx tests

* fix fullstack doc tests

* fix core tests

* fix axum auth example

* update suspense hydration diagram

* longer playwright build limit

* tiny fixes - spelling, formatting

* update diagram link

* remove comment and template nodes for suspense placeholders

* remove comment nodes as we hydrate text

* simplify hackernews example

* clean up hydrating text nodes

* switch to a separate environment variable for the base path for smaller binaries

* clean up file system html trait

* fix form data

* move streaming code into fullstack

* implement serialize and deserialize for CapturedError

* remove waits in the nested suspense playwright spec

* force sequential fullstack builds for CI

* longer nested suspense delay for CI

* fix --force-sequential flag

* wait to launch server until client build is done

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-01 20:50:36 -07:00
Evan Almloff
ffa36a67c3
Forward cli serve settings and make it easier to provide platform config to fullstack (#2521)
* assert that launch never returns for better compiler errors

* fix static generation launch function

* fix web renderer

* pass context providers into server functions

* add an example for FromContext

* clean up DioxusRouterExt

* fix server function context

* fix fullstack desktop example

* forward CLI serve settings to fullstack

* re-export serve config at the root of fullstack

* forward env directly instead of using a guard

* just set the port in the CLI for fullstack playwright tests

* fix fullstack dioxus-cli-config feature

* fix launch server merge conflicts

* fix fullstack launch context

* run web playwright tests on 9999 to avoid port conflicts with other local servers

* fix playwright tests
2024-06-28 14:40:41 -07:00
Miles Murgaw
9dd4427cb5
revision: cli-dev profile section (#2560) 2024-06-27 18:22:32 -05:00
Jonathan Kelley
47ab4c8db9
Chore: move todo!() to unimplemented!() (#2558) 2024-06-27 16:27:27 -05:00
Ribbon
8bba6d6672
Update the examples link on the README (#2552) 2024-06-23 09:40:27 -05:00
Matt Hunzinger
5ae7fd65ee
Fix hot-reloading on Windows (#2544)
* Convert template path to UNIX spec to be compatible with file! macro output

* Make this code windows-only
2024-06-20 10:25:56 -07:00
Maja Piechotka
1fdee2d47a
Add missing packages in flake.nix (#2547) 2024-06-20 11:08:21 -05:00
Miles Murgaw
9e2b3d95ad
revision: change ip (#2543) 2024-06-19 17:32:16 -07:00
Maja Piechotka
f7820d8d94
add aria-current to link (#2540) 2024-06-19 17:11:28 -05:00
Evan Almloff
c094bf3ec3 fix header docs in router_resource 2024-06-19 09:06:42 -07:00
Evan Almloff
77b08f2330 fix router resource docs 2024-06-19 08:54:39 -07:00
Evan Almloff
b6dc2a2230
Deduplicate reactive scope updates/Reset subscriptions on reruns/fix use memo double update (#2506)
* deduplicate effect updates

* only subscribe to signals read in the current run of reactive scopes

* subscribe to memo reads after recomputing the value
2024-06-18 18:49:25 -07:00
Evan Almloff
24d247dc85 fix fullstack launch arc 2024-06-18 18:48:13 -07:00
Evan Almloff
b0caf442ab
Make it easier to provide context to fullstack (#2515)
* pass context providers into server functions

* add an example for FromContext

* clean up DioxusRouterExt

* fix server function context

* fix fullstack desktop example

* fix axum auth example

* fix fullstack context type

* fix context providers path
2024-06-18 20:38:06 -05:00
Chris Rogus
7ee3dc41fc
nonreactive examples for hooks were not compilable as written (#2337)
* nonreactive examples for hooks were not compilable as written

* add example demonstrating the correct usage of use_resource w router

* switch to readonlysignal in the router resource example

* fix readonlysignal name

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2024-06-18 18:39:45 -05:00
Evan Almloff
6320e00056
Convert closures into Option<Callback> automatcially (#2538)
* convert from a closure to Option<Callback> in props

* add a test for optional callback conversion
2024-06-18 16:39:35 -07:00
Evan Almloff
a09548d80e
Remove implicit optional dependency features (#2512)
* remove implicit optional dependency features

* switch to new features in desktop, router and signals crates
2024-06-18 18:39:15 -05:00
Evan Almloff
b0ae9be9c8
Simplify dioxus-config-macro (#2514)
* refactor config macro code

* fix clippy
2024-06-18 16:10:23 -07:00
Evan Almloff
3a4860add4
Document props and component macro (#2522)
* document prop attributes

* document children props

* fix children doc test
2024-06-18 16:06:54 -07:00
Evan Almloff
f042e0029c
fix raw attribute names (#2520) 2024-06-18 16:05:11 -07:00
Evan Almloff
f4a62fad6b
Assert that launch never returns for better compiler errors (#2517)
* assert that launch never returns for better compiler errors

* fix static generation launch function

* fix web renderer
2024-06-18 16:04:36 -07:00