Skip to content
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

feat(macros): 🎸 derive Declare support builtin abilitify #535

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

M-Adoo
Copy link
Collaborator

@M-Adoo M-Adoo commented Feb 28, 2024

Purpose of this Pull Request

  • All types that derive Declare can now utilize built-in abilities.
  // Before
  let row: State<Row> = Row::declare_builder().build_declare(ctx);
  // This would fail to compile
  row.on_tap(|_| { println!("tapped"); });

  // After
  let row: FatObj<Row> = Row::declare_builder().build_declare(ctx);
  // Now, you can use every built-in ability on `row` across the APIs.
  row.on_tap(|_| { println!("tapped"); });
  • prevents circular references and memory leaks that could be caused by using pipe values for DeclareBuilder.

Checklist Before Merging

Please ensure the following are completed before merging:

  • Make built-in widget APIs available for FatObj.
  • Allow widgets to use built-in abilities without the rdl! macro. Widgets deriving from Query should have access to all built-in abilities.
  • Automatically unsubscribe when a Pipe-initialized widget field is disposed.
  • Prevent DeclareBuilder from accepting Pipe for field initialization if it doesn't extend BuiltinObj ability.
  • Introduced simple_declarer macro for types that don't use Pipe for initialization.
  • If this is linked to an issue, include the link in your description.
  • If you've made changes to the code or documentation, make sure these are updated in the CHANGELOG.md file.
  • If you've introduced any break changes, briefly describe them in the Breaking section of the CHANGELOG.md file.

Additional Information

If you're unsure about which branch to submit your Pull Request to, or when it will be released after being merged, please refer to our Release Guide.

If you're working on a widget and need help writing test cases, we have some macros that can assist you. Please refer to the Ribir Dev Helper documentation.

@M-Adoo M-Adoo changed the title feat(macros): 🎸 add simple_declarer that not support use pipe to in… feat(macros): 🎸 derive Declare support builtin abilitify Feb 28, 2024
@M-Adoo M-Adoo added this to the 0.3 milestone Feb 28, 2024
@M-Adoo M-Adoo force-pushed the feat/declarer-extend-builtin branch 7 times, most recently from 9544644 to a5b2158 Compare March 4, 2024 13:54
@M-Adoo M-Adoo force-pushed the feat/declarer-extend-builtin branch 2 times, most recently from c6b1bed to 8d595d3 Compare March 7, 2024 13:30
@M-Adoo M-Adoo force-pushed the feat/declarer-extend-builtin branch from 8d595d3 to 542f21a Compare March 8, 2024 10:50
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 90.35470% with 155 lines in your changes are missing coverage. Please review.

Project coverage is 84.92%. Comparing base (51489d3) to head (23f0631).

Files Patch % Lines
core/src/builtin_widgets.rs 87.52% 75 Missing ⚠️
macros/src/simple_declare_attr.rs 91.07% 19 Missing ⚠️
macros/src/declare_derive.rs 96.38% 18 Missing ⚠️
core/src/builtin_widgets/mix_builtin.rs 74.46% 12 Missing ⚠️
macros/src/declare_obj.rs 88.88% 9 Missing ⚠️
core/src/widget_children.rs 55.55% 4 Missing ⚠️
core/src/builtin_widgets/fitted_box.rs 50.00% 2 Missing ⚠️
core/src/animation/stagger.rs 50.00% 1 Missing ⚠️
core/src/builtin_widgets/anchor.rs 50.00% 1 Missing ⚠️
core/src/builtin_widgets/cursor.rs 50.00% 1 Missing ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #535      +/-   ##
==========================================
- Coverage   85.12%   84.92%   -0.20%     
==========================================
  Files         180      180              
  Lines       25411    26316     +905     
==========================================
+ Hits        21630    22350     +720     
- Misses       3781     3966     +185     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@M-Adoo M-Adoo force-pushed the feat/declarer-extend-builtin branch from 542f21a to 23f0631 Compare March 9, 2024 16:07
@M-Adoo M-Adoo marked this pull request as ready for review March 9, 2024 16:07
@M-Adoo M-Adoo requested review from wjian23 and sologeek and removed request for wjian23 March 9, 2024 16:07
@M-Adoo M-Adoo modified the milestones: 0.3, 0.2 Mar 9, 2024
@M-Adoo M-Adoo enabled auto-merge March 11, 2024 07:52
@M-Adoo M-Adoo mentioned this pull request Mar 11, 2024
3 tasks
@M-Adoo M-Adoo added this pull request to the merge queue Mar 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 12, 2024
@M-Adoo M-Adoo added this pull request to the merge queue Mar 12, 2024
Merged via the queue into master with commit ea4a8cf Mar 12, 2024
6 of 7 checks passed
@M-Adoo M-Adoo deleted the feat/declarer-extend-builtin branch March 12, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants