-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Markerless placeholders/Portals/Multiwindow/const builder/optimized templates #5554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ealmloff
wants to merge
366
commits into
DioxusLabs:main
Choose a base branch
from
ealmloff:fix-textarea-hydration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+42,156
−11,889
Open
Changes from all commits
Commits
Show all changes
366 commits
Select commit
Hold shift + click to select a range
3f6f855
remove is dirty
ealmloff 2d40518
clean up comments in ssr
ealmloff 8b761df
remove HYDRATION_INJECT_MARKER
ealmloff 581ef3d
dyn writer
ealmloff a61951b
pull out const vec
ealmloff 06970e8
rework template structure
ealmloff e4d1d7b
use the builder api in html
ealmloff dd4e8ed
remove list diffing logic from anchor
ealmloff 6ae6e1a
clean up core api
ealmloff 589e8bc
promote the rsx expansion to the only path
ealmloff eb88a9e
fix pathological anchor case and clean up custom element example
ealmloff 4fff5cc
clean up html builder example
ealmloff 3755614
optimize core to reduce benchmark regressions
ealmloff 44a9a9b
make const vec mutable
ealmloff 3a39221
clean up template traits
ealmloff 069ee7e
pull out const vec
ealmloff 38a7f18
optimize core to reduce benchmark regressions (const-vec portion)
ealmloff f308298
make const vec mutable
ealmloff 3eb46dc
rename const-vec to dioxus-const-vec
devin-ai-integration[bot] fc455b5
refactor(core): extract RenderDriver trait from PR #5554
devin-ai-integration[bot] 720e07b
move mounted data out of vnode
ealmloff edc054f
fix(core): fix suspense resolution with RenderDriver trait
devin-ai-integration[bot] f5e6893
refactor: replace dyn RenderDriver + DynWriter with enum dispatch
devin-ai-integration[bot] a5b7b0c
refactor: use trait object RenderDriver with direct dyn WriteMutation…
devin-ai-integration[bot] 6d66bf6
fuzzer passing
ealmloff 5539af8
update manganis callers for &mut ConstVec API
devin-ai-integration[bot] 0fa533a
remove writes_are_noops
ealmloff 084dd45
remove fn suspense_context
ealmloff 3dd2e13
use dyn everywhere
ealmloff 89c9e34
remove refcell around suspense_location
ealmloff 23d888c
leave public virtual dom api unchanged
ealmloff 31f8d5b
restore signature for resolve_suspense
ealmloff 64c12cf
fix clippy
ealmloff 5af2e21
revert memorize behavior for suspense to match main
ealmloff 38bb5a4
match generic on existing resolve suspense
ealmloff 8bb490f
decouple prop diffing and lifecycle driver
ealmloff 0edbf93
clean up diff
ealmloff ca99bf9
undo rename
ealmloff e2eedb6
clean up suspense component diff
ealmloff d602010
fix native integration
ealmloff f8b933c
remove virtual placeholder nodes in ts
ealmloff b2cf35a
Merge commit 'refs/tmp/pr5633' into fix-textarea-hydration
ealmloff 3bfa127
Merge commit 'refs/tmp/pr5634' into fix-textarea-hydration
ealmloff 43af0a1
Refactor core render drivers
ealmloff 322182d
pull out stack
ealmloff 4ffb269
remove string template cache - no perf impact
ealmloff ff3fcea
clean up templates api
ealmloff 8a26417
move hydration back into rust
ealmloff ea05f96
rename to walk
ealmloff 82f88a8
rename view items and make more of core private
ealmloff 53ae6f8
split up template
ealmloff 9c790ba
remove RuntimeTemplateBuilder
ealmloff 69fa09b
calibrate default const allocations
ealmloff 0f3a515
pull out template lib and handle large rsx blocks
ealmloff 327ebfd
rename TemplateStorageEstimate
ealmloff 07000f0
fix keyed diffing regression
ealmloff a900a6d
remove TemplateSlotTarget
ealmloff 183e6e8
make drop_scope mimic main
ealmloff dcc65fe
move all of the const work to the end of the builder to reduce alloca…
ealmloff 87860bc
move all of the const work to the end of the builder to reduce alloca…
ealmloff 9788b1e
clean up some tests
ealmloff 1ef9b1a
fix window component
ealmloff a3fd4d8
fix tests
ealmloff 43b0c02
fix docsite
ealmloff 65fe14a
fix hydration
ealmloff cfe9938
improve const component builder api
ealmloff 3c2d254
remove raw api
ealmloff 5d9575a
clean up documentation around templates
ealmloff 4b1c830
handle renderer removal
ealmloff 55e1f53
hide some marker types
ealmloff 83592b8
fix html conflict
ealmloff 16fa13c
revert .gitignore
ealmloff e245cf0
clean up web lib diff
ealmloff dff5930
revert useless fullstack document change
ealmloff b9917c4
clean up cache diff
ealmloff 807c6fc
clean up some wrappers
ealmloff 82c206b
Merge remote-tracking branch 'ealmloff/fix-textarea-hydration' into f…
ealmloff b32ac11
fix scope drop
ealmloff c2d381d
cut down on rsx public api
ealmloff 7f0599f
fix mount event element id and dynamic value shape comparison
ealmloff 2888c11
fix fuzzer
ealmloff a41b765
always derive debug
ealmloff 234a63a
fix some hydration issues; split up rsx at build time if it is too large
ealmloff 63d4556
fuzzing passes
ealmloff 9e6cd46
fix fullstack playwright test
ealmloff 1774802
more hydration fixes
ealmloff 35ce1bd
add explicit test for textarea
ealmloff 2f4584e
always create the typed rsx once
ealmloff e03000d
more cleanup
ealmloff 808dfab
make callbody constructor private so templates are always split
ealmloff 7b4e1c1
less rambly comments
ealmloff 563d676
fix rsx splitting
ealmloff 202c081
remove DynamicViewValues
ealmloff 90942d9
fix examples
ealmloff 922776e
undo readme changes
ealmloff 12c7c4d
input -> search signal
ealmloff 5b2b359
clean up websocket chat
ealmloff 1a1fa2a
clean up set_attribute
ealmloff 884749c
web import cleanup
ealmloff 686910c
remove extra error boundary hydration logic
ealmloff 47f7b07
directly hydrate
ealmloff 43cfccc
remove useless check in fragment children
ealmloff 93aa799
fix web mutations
ealmloff 66b682f
clean up ssr tests
ealmloff 7d93d05
remove decoded ops
ealmloff dc4170b
remove template type aliases
ealmloff 1afca11
simplify single text node extraction
ealmloff d635a16
remove temp playwright test
ealmloff ce130cd
clean up unused args
ealmloff d109666
mirror error hydration on main
ealmloff 1a5514f
only emit one component builder
ealmloff 90f090a
remove parent arg
ealmloff 331517b
handle many roots and force component builder
ealmloff 0338f11
remove unused storage limits
ealmloff 1a2187f
generate completions enum for elements similar to components
ealmloff 0bbe4d4
more diffing cleanup
ealmloff 1c82a7d
fix autoformatting split rsx blocks
ealmloff 3d58147
revert handle_close_requested
ealmloff ea2a64e
partial restore ssr
ealmloff e284e02
drive remove the dom from the webview instance
ealmloff d7e1620
remove binary size bloating inlines
ealmloff 640a967
rename len -> depth
ealmloff 361d07c
remove template counts
ealmloff e648081
fix css module
ealmloff e2d0bf6
fix ssr tests
ealmloff b229de0
slightly clean up suspense
ealmloff 8de4c36
even more tests
ealmloff c68db64
add all anchors to the heap immediately instead of defering
ealmloff 8485f7f
DomAnchor -> InsertionSite
ealmloff bd0e7f3
fix event test
ealmloff 2abc222
remove out of date todo
ealmloff b9e34a9
walk both attributes and nodes at the same time and pull out tree-sha…
ealmloff 7b2fbc3
hide more of template core
ealmloff 80a3e80
fix suspense test
ealmloff 3ab67d7
don't eagerly collect children
ealmloff 5121786
remove unused _escape_text
ealmloff 766e806
match main eval order for borrow checking compatibility
ealmloff 2dd40f6
fix clippy
ealmloff 65c7e2b
less index based template apis
ealmloff 0b82273
remove validate_anchors
ealmloff a5ae1b3
update a couple of tests
ealmloff a116a84
docsite hydration edge case
ealmloff c1ae32e
fix ssr example
ealmloff 72a399d
fix diagnostics tests
ealmloff 7a58920
remove mutation helpers
ealmloff 33002f8
fix suspense template caching
ealmloff fae4b0c
hide template cache capability
ealmloff fdef63e
clean up some comments in core
ealmloff 7d11fa7
fix formatting
ealmloff 626d9c5
fix tests
ealmloff 1e0d156
use a single box for mounted slots
ealmloff db43945
restore pop effect
ealmloff 43785f8
remove with children
ealmloff c5c1345
trait based html extension
ealmloff 6d0834e
fix path leftovers
ealmloff f71b749
simplify op hash
ealmloff 9f0199f
remove EffectiveAttribute from core
ealmloff 7ccdf69
remove DynamicNodeSlot
ealmloff ed090ef
prefer new/old instead of left/right
ealmloff 56bb7cb
remove DynamicValue
ealmloff e288a3f
switch to anchor based iterator
ealmloff 221e292
remove reserve logic
ealmloff 4d38d04
update some old tests
ealmloff c10d107
roots are always anchors
ealmloff b4c68a3
lower templates lazily in debug
ealmloff 3df1e02
less special root anchor logic
ealmloff 1fc7036
remove pop_id
ealmloff bec1db8
finish removing pop id
ealmloff 0fe2a76
always print err
ealmloff ecb0bc7
less root specific logic
ealmloff d1a3741
fix clippy in playwright tests
ealmloff 7aed675
clean up some attribute comments
ealmloff 998c2e8
formatting
ealmloff 00c2dbb
push id once
ealmloff 133ed39
simplify document element traversal
ealmloff b6351c5
move some fuzzer only helpers from public template api into private f…
ealmloff 57887a8
fuzzing passes
ealmloff 23df255
don't queue vcomponents
ealmloff c016c95
fix list placement
ealmloff 395fdc8
clean up html macro
ealmloff c6223d1
clean up placement.rs
ealmloff bab4817
remove all references to dioxus_elements
ealmloff c36d878
remove window id from poll
ealmloff 037401a
more waker cleanup
ealmloff d1f3475
remove mountref
ealmloff 2d21ac0
revert fullstack document changes
ealmloff b2da413
placement resolver
ealmloff 4bb91ba
fix document test
ealmloff bb37239
use props macro in window component
ealmloff 7cad1b3
split up webview and desktop context
ealmloff 47c23c4
fix autocomplete for attributes - RA can't see through nested macros
ealmloff 62f7294
remove SerializedTemplate
ealmloff b256288
windowless desktop apps
ealmloff dc6b28b
document define_elements
ealmloff 23b90e3
dynidx is only used for templates
ealmloff 94fc050
only remove data-dioxus-id after the listener is removed
ealmloff bedb098
move stats into its own file
ealmloff 24c2cc8
clean up redundant core checks
ealmloff 4186de9
remove reuse existing mounts
ealmloff 75f4566
remove op based search
ealmloff 66bd7e8
never use existing mounts
ealmloff 0db8cbc
remove find_last_element
ealmloff 0c4a835
remove secondary component_windows map
ealmloff e1b210e
move stats to rsx
ealmloff 03a2211
ssr now has zero hydration specific behavior
ealmloff cdcf351
don't double parse attributes
ealmloff ff52ae5
remove parent: node from hydration cursor - rely on the stack
ealmloff b7b9c29
remove some cruft in rsx
ealmloff 83d36c6
fix fuzzing
ealmloff 74c8d23
non-allocating utf16_len
ealmloff 312750f
add dioxus macro to desktop
ealmloff 8ba6e7c
clean up diff context
ealmloff 6e22537
more context cleanup
ealmloff 673dbfb
clean up some top level comments
ealmloff 55bf676
remove StaticViewTemplateWithCapacity
ealmloff cc6b913
less new types in mount
ealmloff 6340db6
restore hidden on suspense builder
ealmloff 7c396c9
remove suspense fallback hydration
ealmloff ea91059
less public api surface for ComponentBuilder on unit components
ealmloff e67ea88
keep suspense closer to main
ealmloff 234bb3b
less example changes
ealmloff 98d282b
simplify suspense
ealmloff 61dbdfb
move more view logic into the macro
ealmloff a09956d
clean up nodes.rs
ealmloff a554988
remove debug assertions check root wrapper
ealmloff b824ef6
don't change global context
ealmloff 5b4f5d8
remove error anchor
ealmloff c6e62c0
remove suspense_boundary: RefCell<Option<SuspenseContext>>,
ealmloff 8e4b1ec
fix web hydration
ealmloff 7aeb9b2
fix hydration call
ealmloff b4322ec
remove double height
ealmloff a633dff
remove reset_renderer_cache
ealmloff 31553a6
nodes.rs cleanup
ealmloff 0169b3c
document PackedMountedSlot
ealmloff 18a4a18
fix tests
ealmloff 489c293
store the iterator position on the mount instead of searching
ealmloff 1fb97d3
clean up a couple redundant checks
ealmloff 69b3402
remove a couple expects
ealmloff 6eb2033
clean up event bubbling
ealmloff e14a08c
remove current_render_target
ealmloff e950a03
remove ScopeStackFrame
ealmloff 2f626ac
follow reverse order like main
ealmloff 0e34e16
clean up some single caller wrappers
ealmloff de320f1
fix clippy
ealmloff 8771075
fix ci
ealmloff 6b923d2
more doc fixes
ealmloff 8f91ac9
match hydration order to core
ealmloff 73f7cf0
fix formatting
ealmloff 2d3026d
fix suspense render mount
ealmloff 80c3fb4
bump windows hot patch timeout
ealmloff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,32 +1,71 @@ | ||
| //! Multiwindow example | ||
| //! | ||
| //! This example shows how to implement a simple multiwindow application using dioxus. | ||
| //! This works by spawning a new window when the user clicks a button. We have to build a new virtualdom which has its | ||
| //! own context, root elements, etc. | ||
| //! The app root owns each native window explicitly. | ||
|
|
||
| use dioxus::desktop::{Config, WindowBuilder, WindowConfig}; | ||
| use dioxus::prelude::*; | ||
|
|
||
| fn main() { | ||
| dioxus::launch(app); | ||
| dioxus::LaunchBuilder::desktop() | ||
| .with_cfg(Config::new().with_headless_root(true)) | ||
| .launch(app); | ||
| } | ||
|
|
||
| fn app() -> Element { | ||
| let onclick = move |_| { | ||
| dioxus::desktop::window().new_window(VirtualDom::new(popup), Default::default()); | ||
| }; | ||
| let mut window_state = use_store(|| WindowState { | ||
| windows: vec![0], | ||
| next_id: 1, | ||
| count: 0, | ||
| }); | ||
|
|
||
| rsx! { | ||
| button { onclick, "New Window" } | ||
| for id in window_state.windows().read().iter().copied() { | ||
| Window { | ||
| key: "{id}", | ||
| config: WindowConfig::new().with_window( | ||
| WindowBuilder::new().with_title(format!("Window {id}")) | ||
| ), | ||
| onclose: move |_| window_state.close_window(id), | ||
| AppWindow { id, window_state } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #[derive(Store, PartialEq, Clone, Debug)] | ||
| struct WindowState { | ||
| windows: Vec<usize>, | ||
| next_id: usize, | ||
| count: usize, | ||
| } | ||
|
|
||
| #[store] | ||
| impl Store<WindowState> { | ||
| fn open_window(&mut self) { | ||
| let id = self.next_id().cloned(); | ||
| self.next_id().set(id + 1); | ||
| self.windows().push(id); | ||
| } | ||
|
|
||
| fn close_window(&mut self, id: usize) { | ||
| self.windows().retain(|window_id| *window_id != id); | ||
| } | ||
|
|
||
| fn increment_count(&mut self) { | ||
| let count = self.count().cloned(); | ||
| self.count().set(count + 1); | ||
| } | ||
| } | ||
|
|
||
| fn popup() -> Element { | ||
| let mut count = use_signal(|| 0); | ||
| #[component] | ||
| fn AppWindow(id: usize, mut window_state: Store<WindowState>) -> Element { | ||
| rsx! { | ||
| div { | ||
| h1 { "Popup Window" } | ||
| p { "Count: {count}" } | ||
| button { onclick: move |_| count += 1, "Increment" } | ||
| h1 { "Window {id}" } | ||
| p { "Count: {window_state.count()}" } | ||
| button { onclick: move |_| window_state.increment_count(), "Increment" } | ||
| button { onclick: move |_| window_state.open_window(), "New Window" } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.