elm-antd icon indicating copy to clipboard operation
elm-antd copied to clipboard

Ellie Link Generator - v1 (Stateless & Messageless Files Only)

Open joshuanianji opened this issue 4 years ago • 8 comments

Description

This PR showcases basic functionality for the Ellie Link Generator. It generates a simple AST of the file which is able to be manipulated to work in Ellie. It currently works on Stateless and Messageless files, though isn't able to inject the Ant.Css stylesheet into the code yet.

By the way, ignore the first two commits where I was toying around with HTTP requests in JS and Elm.

Additional technical notes can be found on this comment.

Screenshots

(not applicable)

Action Items

  • [x] I have read the CONTRIBUTING doc
  • [x] This PR is as small as it can be, and only implements one thing (not many)
  • [x] I have manually tested my feature
  • [ ] I have written a "good" amount of tests (including visual and unit tests) (not yet)
  • [ ] Figure out how to import the defaultStyles for ellie code demos to have correct styling applied
  • [ ] Export a better "file parser" function in Utils.FileParser.
  • [x] Use extensible records in Container.elm for more readability.
  • [ ] Remove hard-coding of ant version in flag declaration and use environment variables

Post-Merge

  • Add a comment to the Ellie-app issue
  • Consider maybe creating an issue to add Sentry (or some similar service) and to log parse errors in prod.

joshuanianji avatar Oct 29 '20 13:10 joshuanianji

I'm still reviewing your PR, but I had a thought pop into my head that I wanted to write down so I didn't forget:

Ellie link generation should only run once for each file and henceforth the output should be saved in memory (in each page's Model or something like that). Thus, if I:

  • navigate to, say, https://elm-antd.netlify.app/components/button and click on the ellie links
  • then go to another page .. i.e. https://elm-antd.netlify.app/components/alert
  • And then I go back to https://elm-antd.netlify.app/components/button, I shouldn't need to regenerate the ellie links again.

Do you get what I mean?

supermacro avatar Oct 29 '20 15:10 supermacro

Thanks for such a detailed code review! Before I fix the issues, I'll just reply to the comment you made earlier:

Ellie link generation should only run once for each file and henceforth the output should be saved in memory (in each page's Model or something like that)

I totally get what you mean, but the good news is that I think this already works that way! The URL Generator only executes every time the ExampleSourceCodeLoaded msg is run, and that is stored in the memory as well. I also looked at the Elm Debugger and the ExampleSourceCodeLoaded isn't rerun when you renavigate to the same page.

joshuanianji avatar Oct 29 '20 19:10 joshuanianji

Hey, just wanted to thank you again for the great code review. I won't be able to resolve all of them today, but will do them tomorrow or over the weekend. This project is super exciting!

joshuanianji avatar Oct 29 '20 21:10 joshuanianji

Looks like there's an unrelated issue going on with the visual_tests CI step. Don't worry about that. I can investigate later.

supermacro avatar Oct 30 '20 15:10 supermacro

Hey @joshuanianji,

Just want to check in. Any idea on when you'll have some time to continue working on this PR?

supermacro avatar Nov 14 '20 20:11 supermacro

Hey @supermacro! I've been really busy lately, but the term is finishing up soon and I hope to continue working on this PR within the next couple of weeks. Sorry for the wait!

joshuanianji avatar Nov 19 '20 08:11 joshuanianji

Hey @supermacro, I'll be able to work on this PR more often now that my term is almost over. Excited to see this project move forward!

joshuanianji avatar Dec 04 '20 09:12 joshuanianji

Hey @joshuanianji 👋

Hope you're doing well. I just wanted to check in and see if you have any plans on continuing this work.

Regards,

Gio

supermacro avatar Feb 28 '21 19:02 supermacro