vritant24 / cleave-html

A modular way to write static webpages
MIT License
1 stars 0 forks source link

[WIP] Reader Implementation #4

Closed claytn closed 6 years ago

claytn commented 6 years ago

Additions:

Sidenote:

vritant24 commented 6 years ago

Yup Ramda seems amazing. Why have I not seen this before? Also yeah we will do async stuff, but since the config has to be read and checked before anything else can be done, wouldn't it by better done synchronously?

Also, I do intend to use promises and async/await for all async calls. Definitely want to learn how to use those properly

claytn commented 6 years ago

Not really. The only difference will be that with synchronous calls we will pass the remainder of the program as a callback with the data retrieved. Essentially, it will just create a pipeline for all the data to flow through. Or if we use Promises the entire program will be a chain of thens.

We can leave the synchronous call, but eventually we are going to be creating an asynchronous pipeline so I thought we might as well start it at the very beginning. If you want to leave it as is that's fine though. The difference won't be noticed by the user.

vritant24 commented 6 years ago

Hmmm alright. Let me finish the tests I am making, and then you can go ahead and change it to async. I don't exactly get what you're saying right now, but when I see it I should understand.

vritant24 commented 6 years ago

Alright you can go ahead and merge your PR. I saw that some of the changes I made overlap with yours, use your judgement for those. And lets use Ramda for its functionality (heh)

claytn commented 6 years ago

I won't merge until I deal with merge conflicts from your most recent changes. The pipeline I am describing will likely change a bit based on issues we run into along the way since we don't have all of this mapped out yet, but any changes should be simple at this level.

vritant24 commented 6 years ago

Alright cool. I'll branch out and start working on the html file reader

claytn commented 6 years ago

Feel free to change anything I've done with this so far. Also, I saw you added more things to the reader-dev branch. Not too sure which of those things you want to keep so let me know what needs to stay or if it's easier just pull in the reader-dev branch into this branch and fix the two conflicts as you see fit

Update: On second thought don't worry about these changes. Since you've added more to this we might as well just translate this to use promises from scratch. If you want I can rewrite this section using promises when I get the chance during the next few days and you can just use the current implementation to continue development on the next portion of this project if that works with you. Once I get back home (after Christmas) we can skype and address more planning issues for the parser and so on.

vritant24 commented 6 years ago

I'll take care of the promises. I've gotta get my hands dirty with some async and await. Enjoy Christmas! Let's definitely discuss more after.

vritant24 commented 6 years ago

I removed your implementation for readFIle for the merge since we'll be writing promises from scratch. I'll have something up tonight, let me know if that'll be good.

I'll also replace my typecheck with ramda.