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

[WIP] feat: Add register_decorator #984

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

schloerke
Copy link
Collaborator

@schloerke schloerke commented Feb 18, 2025

2025/02/05

Thought process...

  • On plumb(), collect the text until a parseble object
    • parse decorated object
  • Parse each tagged set of text, save results to mutable object
    • decorator_parser_FN(info, ..., line_num, line, envir)
    • register_decorator_parser
    • for every decorator, update mutate object given line block
      When parsing is done, post process the mutated object
  • processor_FN
  • register_decorator_processor
  • for every handler, update pr given mutable object

Update 2025/02/07 From conversation with @thomasp85 We should use {roxygen2} to parse the tags. I agree!

The important part is plumber needs to call a method that will capture the appropriate information and also opt-in to processor method for the corresponding decorator. (No actual processing needs to happen upon discovery, just prep work.) Then, after all decorators have been found, each processor method will execute on the info object.

Ex: @param should register that the verify_route_is_handled call is executed. (This method will verify that a @get etc. is eventually called.).
Ex: @get would register the add route to router method. It would use information found from @serializer, @param, <PATH>, etc.

The processor methods should take pr and processed_info. The processor return value will be ignored.


Update 2025/02/18

This code is not meant to be merged. It is a non working POC and meant to start a conversation.

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.

1 participant