Commit graph

148 commits

Author SHA1 Message Date
Jonathan Kelley
828cc502f1
Fix: #2604, Fix: #2240, Fix: #2341, Fix #1355 - Better error handling and and spaces handling in autofmt (#2736)
* add new autofmt sample
* Feat: implement rustfmt::skip support for rsx
* generally improve error handling with better expect messages
* wip: nested rsx formatting and expression formatting
* nested rsx formatting works
* collapse autofmt crate
* cast indent through macros
* use proper whitespace
* no more eating comments!
* Use proper error handling
2024-07-30 18:36:13 -07:00
opensource-inemar-net
e73484795a
This fixes issue (#2724) 2024-07-28 12:06:09 -07:00
Evan Almloff
7f210633eb
fix formatting and merging if chains in attributes (#2697)
* fix formatting and merging if chains in attributes

* fix autoformat if attribute chains

* Fix IfAttributeValue ToTokens implementation

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-24 18:56:21 -07:00
Tristan F.
9167cd9dec
fix most typos, add crate-ci/typos to CI (#2653)
* fix most typos, add crate-ci/typos to CI

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-23 17:49:33 -07:00
Evan Almloff
fa4e5dbf62
Fix rsx autocomplete and diagnostics in the root; provide better completions after attributes are finished (#2656)
* fix rsx autocomplete and diagnostics in the root; provide better completions after attributes are finished

* clean up pr to use internal child parsing

* Fix peek_lowercase name

* fix comma diagnostics in the root

* Fix parsing components with a path

* remove simple routes trailing comma

* Fix incomplete_root_elements test

* Remove trailing commas from root body node in tests

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-07-23 16:34:50 -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
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
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
Evan Almloff
b3cd4fac10
set up example scaping for docs.rs (#2450) 2024-05-28 13:05:55 -07:00
Evan Almloff
2523581cf4
Autocomplete rsx (#2421)
* autocomplete rsx

* hide the completions module

* fix autocomplete for identifiers that start with a raw identifier

* add field completion hints for props

* remove extra import

* Revert "add field completion hints for props"

This reverts commit 194899c737.

* fix autocomplete inside raw expressions

* fix autofmt

* feat: just use regular ifmt if it's compatible

reuses the tokens for ifmt so RA provides its HIR lowering on simple formatted strings

* fix merging ifmt strings

* add a better error message for components called like functions

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-05-22 07:24:50 -05:00
Jonathan Kelley
a0e06271dd
Fix: flaky CI by correcting autofmt to match proper spacing (#2369) 2024-04-26 12:04:56 -04:00
Jonathan Kelley
994056e16d
Don't eat keys (#2280) 2024-04-08 22:31:58 -07:00
Jonathan Kelley
67af2d89dd
Autofmt nested rsx using syn::Visitor (#2279)
* Nested macros using visitor pattern
2024-04-08 22:15:52 -07:00
Jonathan Kelley
be99e29e5f
Fixes to autofmt, make it more aggressive (#2230)
* fix: fmt unterminated if, be more aggressive with line splits

* Fix: Handle long exprs in for/if statements
2024-04-03 15:27:36 -07:00
Miles Murgaw
3cbe6ff96e
Fix Outdated README.md (#2147)
* fix: outdated readme

* Fix missing readme

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
2024-03-26 19:17:02 -07:00
Jonathan Kelley
eb79e61642
Add a ton of comments to rsx/hotreload, add snapshot testing, refactor a bit to simplify the crate (#2130)
Merge dynamic context and dynamic mapping, clean up the rsx hotreload logic, and add location data to the Rsx objects
2024-03-24 13:31:26 -07:00
Evan Almloff
58f7efafea
Make EventHandler copy (#2112)
* implement Copy for EventHandler
* implement from closure for event handler and remove special on prefix
* fix props implementation of EventHandler
2024-03-19 19:48:53 -07:00
Jonathan Kelley
d8942a255b
Fix #2104: fmt incorrectly using 1-indexing for columns (#2106)
* Fix #2104: fmt incorrectly using 1-indexing for columns

* Clippy...
2024-03-18 18:23:45 -07:00
Jonathan Kelley
ad7a350d2e
fix hotreloading issues in the CLI 2024-03-12 13:39:42 -07:00
Jonathan Kelley
3e5edff724
Fix key errors in autofmt crate 2024-03-07 16:21:51 -08:00
Jonathan Kelley
0bd9692e45
Fix cargo test and a number of little cleanup bugs 2024-01-30 17:33:14 -08:00
Jonathan Kelley
1dde044697
remove cx.render 2024-01-13 21:12:21 -08:00
Jonathan Kelley
fae0b08e61
Fix the router and stub out a number of crates to get compiling 2024-01-13 20:51:37 -08:00
Jonathan Kelley
4f077ec664
Merge pull request #1812 from ealmloff/duplicate-event-listener-rsx
check for duplicate event listeners in the rsx macro
2024-01-11 14:34:01 -08:00
Evan Almloff
4ef6f78657 fix duplicate listeners in the autoformat tests 2024-01-11 16:22:28 -06:00
Jonathan Kelley
f1e8faffb5
fix tests 2024-01-10 23:17:01 -08:00
Jonathan Kelley
fa9d92f956
Fix tests for autofmt 2024-01-10 22:41:40 -08:00
Jonathan Kelley
d9b84f9f8f
Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
Jonathan Kelley
2876a7deb2
Merge branch 'master' into feat/inline-attributes-fmt 2024-01-08 20:00:14 -08:00
Evan Almloff
e5df83ceec Merge branch 'master' into pr/atty303/1349 2024-01-06 08:52:37 -06:00
Jonathan Kelley
8df7a7685e
Merge branch 'master' into many_optional_attributes 2024-01-04 10:18:57 -08:00
marc2332
ce5d7bd11b
rename to split-line-attributes 2023-12-09 16:51:41 +01:00
marc2332
c10cefffb6
fix: Disabling short-children inlining when inline attributes is disabled 2023-12-09 11:46:30 +01:00
marc2332
0958056100
fix 2023-12-09 11:33:14 +01:00
marc2332
27bfabd425
clean up 2023-12-09 11:19:18 +01:00
marc2332
52cb5ff951
feat: --inline-attributes option for autofmt 2023-12-09 11:16:26 +01:00
Evan Almloff
0aa4875ec0 fix formating 2023-11-02 13:59:46 -05:00
Alex Parrill
52fb080193 Use indentation settings in dx fmt and vscode extension
Adds the ability to specify an indent string to public autofmt methods - either
a sequence of spaces or a tab character.

Get the indentation style and size from rustfmt for dx fmt, or from the editor
settings for the vscode extension.

Closes #1595
2023-11-01 17:24:18 -04:00
Evan Almloff
77d53df532 Merge branch 'master' into pr/atty303/1349 2023-10-31 13:39:20 -05:00
Leonard
2d1234c3d1
Include README and Dioxus logo in package docs (#1536)
* Include README in docs.rs and add Dioxus logo

* Update README.md
2023-10-10 10:52:48 -05:00
Evan Almloff
5b65c4cfb4 implement spreading props in the rsx macro 2023-09-22 10:04:34 -05:00
Evan Almloff
9e167dfdb7 Merge branch 'many_optional_attributes' into pr/atty303/1349 2023-09-22 09:32:05 -05:00
Evan Almloff
7033276c34 Merge branch 'master' into pr/atty303/1349 2023-09-20 16:19:23 -05:00
Evan Almloff
ab2b9fb34e fix autoformatting 2023-09-19 09:39:53 -05:00
Evan Almloff
d297e2baa2 Add optional attributes 2023-09-18 19:50:02 -05:00
marc2332
7f8c963cd9
fix: Update doc links from v3 to v4 2023-09-16 19:03:27 +02:00
Leonard
c866ae602b
Add system for creating component attributes + new #[component] attribute (#1448)
* Add `#[component]` attribute + system for creating component attributes + other stuff

* Delete inlineprops.rs

* Update inline_props.rs

* Cargo fmt

* Fix clippy warnings and paths in props/mods.rs

* Include where clause in `#[inline_props]` output

* Allow Clippy type complexity in `LinkProps`

* Allow the type complexity lint for the entire link.rs file

* Remove snake_case -> PascalCase converter, but rather enforce PascalCase

Also:
- Put the second function inside the main one instead of besides it.
- Simplify

* Simplify type check lints so they don't return false positives

They will not always work, but they won't return any false positives, like for aliases. This is likely going to be replaced by a more polished Clippy-backed linting system.

* Fix #583

* Cargo fmt

* Add docs for `deserialize()` and remove useless comment

* Add `#[component]` to prelude

* Merge branch 'master' of https://github.com/tigerros/dioxus

* #[inline_props] is no more. Except in the docs folder, but that's going to be removed

* Remove docs folder

* Remove docs from workspace

* Resolve `DeserializerOutput` conversation
2023-09-15 09:13:36 -05:00
Evan Almloff
1a17ca988c fix double quotes in autoformatting 2023-09-14 16:19:21 -05:00