Skip to content

Conversation

@Nytra
Copy link
Contributor

@Nytra Nytra commented Jun 20, 2025

Closes #120

@Nytra Nytra changed the title Add cursed inspector transpiler Add inspector transpiler Jun 20, 2025
@Nytra Nytra marked this pull request as ready for review June 20, 2025 02:10
@Nytra Nytra requested a review from Banane9 June 20, 2025 02:10
@Nytra
Copy link
Contributor Author

Nytra commented Jun 20, 2025

It doesn't respect the Enabled state yet, wasn't sure how to do that

@Nytra
Copy link
Contributor Author

Nytra commented Jun 20, 2025

It doesn't rely on counting the branches anymore

@Nytra
Copy link
Contributor Author

Nytra commented Jun 20, 2025

It now respects the Enabled state

@Nytra
Copy link
Contributor Author

Nytra commented Jun 20, 2025

I think this now 100% matches the behavior of the old patch

Copy link
Contributor

@Banane9 Banane9 left a comment

Choose a reason for hiding this comment

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

Added some comments - I'd also prefer this to be an optional thing, at least for the start, I think. As in, have a toggle to use replacement instead of transpiler 🤔
Also let me know whether you think the history of the commits should be kept or whether it should be squashed

@Nytra
Copy link
Contributor Author

Nytra commented Jun 21, 2025

Added some comments - I'd also prefer this to be an optional thing, at least for the start, I think. As in, have a toggle to use replacement instead of transpiler 🤔 Also let me know whether you think the history of the commits should be kept or whether it should be squashed

Would be a bit odd to have both a prefix and transpiler, is that even possible? Also I don't mind what happens to the commits. Probably fine to squash.

@Banane9
Copy link
Contributor

Banane9 commented Jun 21, 2025

Would be a bit odd to have both a prefix and transpiler, is that even possible?

well, a prefix would just skip the transpiled content of the method, so it would be possible to have both indeed. It's mainly that restoring the vanilla behavior becomes harder when a transpiler is involved. We could do patch / unpatch with enabled / disabled, but that's also kinda funky 😩

@Nytra
Copy link
Contributor Author

Nytra commented Jun 21, 2025

The transpiler respects the Enabled state, so if its disabled, skip the prefix and then the original should run via the transpiler

then just have a toggle for if you want to use prefix replacement or transpiler

@Banane9
Copy link
Contributor

Banane9 commented Jun 22, 2025

The transpiler respects the Enabled state, so if its disabled, skip the prefix and then the original should run via the transpiler

What I'm thinking about is the transpiler breaking the method so it doesn't work anymore at all after an update - so disabling it would have to be an unpatch 🤔

@Nytra
Copy link
Contributor Author

Nytra commented Jun 22, 2025

The solution to that would be to make the transpiler very robust so it is very unlikely to break after an update.. The same thing could happen to the prefix.

@Banane9
Copy link
Contributor

Banane9 commented Jun 22, 2025

The solution to that would be to make the transpiler very robust so it is very unlikely to break after an update.. The same thing could happen to the prefix.

Yea... though at least in my scenario, the prefix and transpiler break in different ways. The transpiler could break the method from working entirely (if not made properly), while the prefix just stays stuck on the old implementation, but doesn't "break" anything in that sense.

Of course that all goes out of the window when any of the referenced methods change so they're not found anymore.

@Nytra
Copy link
Contributor Author

Nytra commented Jun 23, 2025

If the transpiler IL code is invalid it won't patch anyway.

@Nytra Nytra requested a review from Banane9 June 24, 2025 22:38
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.

Use transpiler for custom inspector injector

3 participants