Commit graph

499 commits

Author SHA1 Message Date
Greg Johnston
634ac1c4a3 chore: clippy and fmt 2024-08-01 19:43:09 -04:00
Greg Johnston
a1ca8549a1 chore: fmt 2024-08-01 19:42:51 -04:00
Greg Johnston
6be090079f chore: fmt 2024-08-01 19:42:51 -04:00
Greg Johnston
bf8d2e079c fix: custom elements should support any attribute names 2024-08-01 19:42:50 -04:00
Bruno De Simone
66d6038f2d add allow too_many_arguments (#2684) 2024-08-01 19:42:50 -04:00
Saber Haj Rabiee
e1f3be6416 chore: cargo fmt (#2672) 2024-08-01 19:42:50 -04:00
Greg Johnston
fd48a61eef macro alpha 2 2024-08-01 19:42:50 -04:00
Lucas Åström
ce4fe632a2 Destructuring let (0.7) (#2655)
* Use `let()` syntax for bindings

This lets users use destructuring when binding more complex values, and we also get better IDE support.

* Update rstml
2024-08-01 19:42:50 -04:00
Greg Johnston
be92dc56aa chore: suppress unnecessary .into() warning 2024-08-01 19:42:49 -04:00
Greg Johnston
3ebea79e05 preliminary work on directives (not useful yet until we have an ElementExt that allows you to do things declaratively from an Element 2024-08-01 19:42:49 -04:00
Greg Johnston
adf57f5771 fix attr:class when spreading onto a component 2024-08-01 19:41:27 -04:00
Greg Johnston
6dfea0b0a2 additional warnings 2024-08-01 19:41:12 -04:00
Greg Johnston
9fd881603f cargo fmt 2024-08-01 19:41:12 -04:00
Greg Johnston
9666c9c0c5 chore: clear up... a few warnings 2024-08-01 19:41:12 -04:00
Greg Johnston
4d54574f9e feat: 0.7 slots 2024-08-01 19:41:11 -04:00
Greg Johnston
f6c7ac473a feat: enhanced spreading syntax 2024-08-01 19:41:11 -04:00
Greg Johnston
1766bfedb9 default to Params::get() giving an owned value (which you want in a derived signal), but use reference in the macro 2024-08-01 19:41:11 -04:00
Greg Johnston
bb7bb8f4c2 allow let: syntax to work 2024-08-01 19:41:11 -04:00
Greg Johnston
109244b28b feat: minimal island support in 0.7 2024-08-01 19:40:57 -04:00
Greg Johnston
cebe744a84 support arbitrary attributes on components in view 2024-08-01 19:40:57 -04:00
Greg Johnston
e93a34a2c9 full attribute spreading 2024-08-01 19:40:57 -04:00
Greg Johnston
4336051f78 prep for preview release 2024-08-01 19:40:56 -04:00
Greg Johnston
97ce5adb8e fix reorganized exports 2024-08-01 19:40:56 -04:00
Greg Johnston
0beef3b2e0 prep for preview release 2024-08-01 19:40:56 -04:00
Greg Johnston
2dd2bb5958 add more hooks and primitives to router 2024-08-01 19:40:25 -04:00
Greg Johnston
c8e5e1b16b experimental sledgehammer Renderer backend 2024-08-01 19:40:24 -04:00
Greg Johnston
53703f208a working on AddAttr 2024-08-01 19:40:24 -04:00
Greg Johnston
a8adf8eea2 todomvc example 2024-08-01 19:40:24 -04:00
Greg Johnston
0fddfb4823 stash 2024-08-01 19:40:23 -04:00
Greg Johnston
528d1eae65 chore(ci): update nightly 2024-08-01 14:48:52 -04:00
Ar4ys
7e75801f7c
fix: move lint rules outside of quote_spanned (closes #2527) (#2709) 2024-07-24 07:54:46 -04:00
Oleg Shatov
b3db094618
chore: remove cfg-related warnings (#2654) 2024-07-03 06:49:32 -04:00
Chris
fb5d8513ff
docs: generate link to definition (#2656) 2024-07-03 06:46:02 -04:00
Hamir Mahal
c9d0ef5033
chore: simplify string interpolation (#2626) 2024-06-21 07:51:38 -04:00
ARSON
b22f3bb3bd
fix: extract dyn_bindings impl into DynBindings trait (#2619) 2024-06-12 09:07:56 -04:00
SleeplessOne1917
21a6551ce6
feat: allow slice! macro to index tuples (#2598)
* Allow slice! macro to index tuples

* Undo changes to component tests

---------

Co-authored-by: Greg Johnston <greg.johnston@gmail.com>
2024-05-29 09:07:41 -04:00
Mingwei Samuel
2f4fd87c05
feat: #[component] now handles impl Trait by converting to generic type params, fix #2274 (#2599)
Book needs to be updated to remove this line:
35c380ffc8/src/view/03_components.md (L233)
2024-05-29 09:06:52 -04:00
Greg Johnston
3760ced0ec
fix: allow temporaries as props (closes #2541) (#2582) 2024-05-08 19:35:57 -04:00
Greg Johnston
f3f3a053ba
fix: don't insert empty child for comment/doctype (closes #2549) (#2581) 2024-05-08 07:19:57 -04:00
Antoine Büsch
6a8e4bb453
Fix empty_docs warnings in #[component] macro (#2574) 2024-05-06 22:09:19 -04:00
bicarlsen
9a7dbd50eb
feat: ability to use multiple classes in view macro using array syntax. (#2532) 2024-04-17 19:04:33 -04:00
Ethan Niser
410225c4d1
docs: remove unnecessary type parameter and trait bound in component macro 'bad' example (#2520) 2024-04-17 18:53:18 -04:00
ARSON
8b1c0a7013
feat: spread component attrs (#2534)
* add `dyn_bindings` builder method to component

* Revert "add `dyn_bindings` builder method to component"

This reverts commit cdd5e0f682.

* add `dyn_bindings` builder method to component
2024-04-17 14:05:00 -07:00
Greg Johnston
03a56f8795 chore(ci): latest nightly 2024-04-15 18:33:06 -04:00
Ar4ys
36b2f919dd
feat: signifiantly improved error reporting in view macro (#2289)
* Added name span to .build in component_to_tokens

* Added #[allow(unreachable_code)] to  leptos::component_view inside component_to_tokens

* Added span to name reference in component_to_tokens

* Added span to leptos::component_props_builder in component_to_tokens

* Added span to props in component_to_tokens

* Added span to "on" method in events component_to_tokens

* Added spans in directive_call_from_attribute_node

* Added spans in fragment_to_tokens and it's ssr version

* Added span to props in slot_to_tokens

* Added span to the whole slot quote

* Changed slots's name span to last slot node

* Added span to the slot vec

* Added #[allow(unreachable_code)] to `.into()` in slot_to_tokens

* Added span to `.build()` in slot_to_tokens

* Added span for the whole component

* Added span to "clone:" directive

* Added span to ".children()"

* Removed unused "_span" param from fragment_to_tokens and fragment_to_tokens_ssr

* Removed unnecessary parenthesis around values in `attribute_to_tokens`

* Removed unnecessary curly braces around value in `spread_attrs`

* Removed unnecessary parenthesis around children in `element_to_tokens`

* Added catch-all span to element_to_tokens

* Formatted `quote!` according to official guidelines

* Updated view/snapshots in leptos_macro

* Added span to spread props in element_to_tokens_ssr

* Removed unnecessary curly braces in element_to_token_ssr

* Updated view/snapshots in leptos_macro

* Added view macro tests to leptos_macro

* Fixed clippy warnings in view macro output

* Updated view snapshots in tests

* Fixed expected_one_let_bind_got_none test in leptos_macro

* Removed snapshot tests in leptos_macro/tests/ui/view

---------

Co-authored-by: Greg Johnston <greg.johnston@gmail.com>
2024-04-08 08:14:33 -04:00
Lukas Potthast
119c9ea23f
feat: allow spreading of both attributes and event handlers (#2432) 2024-04-05 14:30:34 -04:00
Greg Johnston
a9034a92b0
fix: handle directives properly in SSR mode (closes #2488) (#2477) 2024-04-01 17:29:30 -04:00
Greg Johnston
41f3c46830
chore: bump nightly version in examples (#2479) 2024-04-01 15:16:53 -04:00
martin frances
f3d19ca744
Minor: Ran cargo clippy --fix (#2461)
Manually reviewed the changes. All look like reasonable nudges.

A summary :-

In one place removed a redundant call to .clone().

In two places, now using clone_from() which clippy says
**MAY** be an optimisation.
2024-03-23 18:27:31 -07:00
Roland Fredenhagen
4e578e335b
chore: update attribute-derive (#2438) 2024-03-18 11:39:34 -04:00