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

Syntax matcher walker #582

Merged
merged 2 commits into from
Sep 29, 2024
Merged

Syntax matcher walker #582

merged 2 commits into from
Sep 29, 2024

Conversation

jaytaph
Copy link
Member

@jaytaph jaytaph commented Sep 2, 2024

No description provided.

Copy link
Member

@Sharktheone Sharktheone left a comment

Choose a reason for hiding this comment

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

I've spotted a few more of these, but I guess you should have a general idea on how you could remove dyn from most places

crates/gosub_shared/src/traits/document.rs Outdated Show resolved Hide resolved
crates/gosub_html5/src/parser/document.rs Outdated Show resolved Hide resolved
Copy link
Member

@Sharktheone Sharktheone left a comment

Choose a reason for hiding this comment

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

just marking some todos that should be done before merging this PR because they break some important stuff

crates/gosub_css3/src/system.rs Outdated Show resolved Hide resolved
crates/gosub_render_utils/src/render_tree/desc.rs Outdated Show resolved Hide resolved
crates/gosub_css3/src/matcher/styling.rs Outdated Show resolved Hide resolved
@jaytaph jaytaph marked this pull request as ready for review September 29, 2024 14:28
@jaytaph jaytaph force-pushed the syntax-matcher-walker branch 2 times, most recently from e48b3dc to d5504b0 Compare September 29, 2024 17:30
This is a rather large commit that was needed in order to let the
gosub_html5 and gosub_css3 crates to be dependend on eachother. The
problem was that they both need eachother and resulted in a cyclic
dependency. We solve this usually by moving stuff to the gosub_shared
crate, but in this case it would mean we practically move EVERYTHING to
that crate.

So instead we created a lot of traits in the gosub_shared that can be
used by the other crates. This way, both html5 and css3 crates do not
need to be depenended on eachother, but only on the gosub_shared crate.

However, it crates a lot of extra efford in getting this up and running,
the traits and generics means that A LOT of code must be refactored into
this system, during which we found out that a lot of code is not on the
correct places. We moved around much of the code so it kinda makes sense
again.

This resulted in the removal of the gosub_styling crate, which was a
sort of bridge between the css3-system and other things, which now lives
in the css3 crate (which we now properly could manage).

There are still problems we're facing, but overal the refactoring looks
good.

Note that creating this trait setup resulted in redesigning a new engine
architecture (unimaginably named "engine_v2"), in which we are
redesigning the way we deal with all components. It should resolve all
the trait bottlenecks we currently have and hopefully we will be able to
refactor the current engine into that one. For now, we keep on working
on this system.

Co-authored-by: Shark <[email protected]>
@jaytaph jaytaph merged commit 4c5e39b into gosub-io:main Sep 29, 2024
10 checks passed
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.

2 participants