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

file patcher for code weaving (eg module timer, template preprocessing, code generation) #2

Open
naturallymitchell opened this issue Jan 23, 2019 · 15 comments

Comments

@naturallymitchell
Copy link
Member

No description provided.

@aleksanderwlodarczyk
Copy link

aleksanderwlodarczyk/file-patcher@fe4e86f

Should it be only for file processing or for loading too? f.e we have theme loader in lighttouch-base that patches the themes and load them. This tool should be universal way of file patching, right?

@naturallymitchell
Copy link
Member Author

Yes

@naturallymitchell
Copy link
Member Author

Should work for each case

@naturallymitchell
Copy link
Member Author

What you're doing doesn't look right. It should only have the mechanisms. It shouldn't know about "rules" and "themes" etc. Lighttouch should use that. Other things should use it too for its common mechanisms

@aleksanderwlodarczyk
Copy link

Okay, but if I started this way I decided to finish theme patching and then refactor it to be mechanism only. But how do you want the patcher to recognize which mechanism should it use?

So far the first 'milestone' is working outsourced mechanisms for rules, actions and themes

aleksanderwlodarczyk/file-patcher@1d4a04c

@aleksanderwlodarczyk
Copy link

I was trying to update it today but I can't understand how should we have multiple mechanisms and do not switching it with "rules", "actions"? Do you want it to be just preprocessors table and add such a preprocessors in each app?

@naturallymitchell
Copy link
Member Author

sounds good

@aleksanderwlodarczyk
Copy link

Okay, I think I almost got what you want. Here at aleksanderwlodarczyk/file-patcher@4cc39ec I got preety clean solution but Lua seems to has problems with 'unpack' which I am using first time (https://www.lua.org/pil/5.2.html)

I will try to fix this problem because 'unpack' seems to be ideal to use it here where we need functions with various parameters number

@naturallymitchell
Copy link
Member Author

Lighttouch should also have a dependent patch to use the file patcher

@aleksanderwlodarczyk
Copy link

Okay, so current version is working for any number of parameters
aleksanderwlodarczyk/file-patcher@4e36521

In our version of Lua we should use (...) instead of unpack(args) (https://stackoverflow.com/questions/38749099/lua-variable-length-function-arguments-are-nil/38749326)

Should I start refactoring lighttouch to use this patcher?

@naturallymitchell
Copy link
Member Author

it looks pretty worthless, tbh

I really don't know what if anything you've accomplished.

mind filling me?

@aleksanderwlodarczyk
Copy link

Worthless? I asked you if you want patching modes - you said you want, I did the modes, you said it should be more universal, I asked should it be only table for preprocessors and each app should add their own - you said it sounds good and now you are saying it is worthless? Funny.... Really funny

@naturallymitchell
Copy link
Member Author

If you're gonna go off doing your own thing, idk how to help other than to wait and see what you come up with.

I'm trying to reach you on discord so we can dialogue.

@naturallymitchell
Copy link
Member Author

I went back and looked again for what I had a hunch I must have been missing..

In fact the code you made was there, but somewhere different than where you linked, 2ac7a01#diff-a71c5bb21ea277cd777a78278660cd85

So, it seems like you were on the right track.. Yes I do want you to refactor lighttouch.

(Sorry for jumping to the belief that you had failed; I should have dug deeper.)

Do you still want to carry this though?

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

No branches or pull requests

2 participants