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

Rel/0.7.0 rc.1 #185

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open

Rel/0.7.0 rc.1 #185

wants to merge 56 commits into from

Conversation

rory-ocl
Copy link
Contributor

Description

0.7.0 Release Candidate 1

Includes all code from develop branch, ready to merge into main.

Checklist

  • I have documented these changes where necessary.
  • I have read the DCO and ensured that these changes comply.
  • I assign this work under its open source licensing.

Jason-W123 and others added 30 commits December 13, 2024 12:35
These tests are important before upgrading alloy to avoid misuing their
API and causing errors.
This alloy version includes generic integer types, so instead of
implementing those on our end, we special case the built-in integer
sizes so they work with both primitive ints and alloy generics.
This is a rather large refactor of the stylus proc macros with the main
goal of improving maintainability, testability, and documentation of
these macros. The following changes have been made:

- Operate on AST nodes instead of raw tokens. This allows testing of
  smaller parts of the macros as unit tests. This also allows some
  composibility within the implementations.
- Use the visitor pattern in several places to avoid confusing nesting
  of for-loops.
- Separation of export-abi code using "extention" traits so that it is
  easy to reason about export-abi when needed, and otherwise ignore it.
- Improved error reporting. The main change here is the ability to
  report multiple errors when compilation fails, allowing the user to
  see all errors at once. There is also some small changes with regards
  to consistency between the macros.
- Unit tests for utilities and macro generation at the AST level. This
  includes a `assert_ast_eq()` function which can be used to compare two
  ASTs of the same type. If an error occurs, the ASTs are pretty printed
  and a diff is output so that the issue can be easily addressed.
- Integration tests in the `stylus-proc/tests` directory. These allow
  compiled macros to be tested as working correctly. Additionally the
  `stylus-proc/tests/fail` directory will contain failing integration
  tests. These all fail to compile and include expected stderr outputs.
- Modify code snippets within docstrings so that they are not ignored,
  and pass as part of the `cargo test` process.
- A `README.md` which will contain information about developing and
  maintaining these proc macros.
- Support for `solidity.path.separator` to `rust::path::separator` for
  custom structs within `sol_interface!` definitions.
- Change the folder structure to have all macro implementations in a
  `macros` module. Easier to find the macro implementation you are
  looking for.
- Docstrings within the macro implementations for developer reference.
- Utilities for handing inner attributes including those which contain
  tokens which need to be parsed.

A little more work is going to be done before this is ready for merge,
but it will be good to get this out for review since it is such a large
set of changes.
Copy link
Contributor

@rauljordan rauljordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

This was broken due to a change in the updated alloy version.
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.

7 participants