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
Fix a bug in layouts with props that use type variables #128
Fix a bug in layouts with props that use type variables #128
Conversation
If the project has a layout with props using type variables, there's an error in the code generation that throws: ``` Props type needs 1 argument, but I see 0 instead: in .elm-land/src/Layouts.elm ``` This commit updates the array of layout paths sent to the code generator, including a boolean variable indicating if the layout uses Props with type variables. In such case, the code generator creates valid code for that layout, avoiding the current error.
✅ Deploy Preview for elm-land canceled.
|
copying here from discord for visibility
|
Circling back, is there anything i can do to help move this along? really looking to try out Layouts |
hey Ryan, I'm sorry, I haven't had much free time lately to wrap up this PR. I'll try to give it a big push during this weekend. I'm having a problem making the cli to generate the code of the example. It will only add the default app that displays |
No worries at all (or need to apologize)! You've already contributed more than I could have asked for ❤️ @mc706 , if you'd like to add a minimal example in the You don't have to get it running locally, even a separate PR that just adds the broken example would be more than enough to get this merged with the next release! Thank you both for your contributions so far– I truly appreciate it 💖 |
Hey @ryannhg! Finally got some time to add a very simple example (number 17, feel free to change the ordering). I think we may have a bug with nested layouts. While I was working on the example, at some point I couldn't compile example 08 (nested layouts). Can you give it a try using the Thanks! |
@Ferdev thank you! As a heads up, I just enabled GitHub Actions for this PR, so you will be able to see if any tests are failing before/after your changes: Hopefully, this will let you validate if there are any regressions as you go! 🪄 |
I think I've fixed the regression. The test that was failing is no passing in my machine. Although other tests pass/fail randomly in my system, so I'm not 100% sure if the whole test suite passes. |
Problem
If the project has a layout with props using type variables, there's an error in the generated code that throws:
Apparently, the implementation in the code generator for layouts that use props with type variables is incomplete. This PR tries to fill the missing gaps.
Solution
This commit updates the array of layout paths sent to the code generator, including a boolean variable indicating if the layout uses Props with type variables. In such case, the code generator creates valid code for that layout, avoiding the current error.
Notes
Issue mentioned and discussed in Discord