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

Rewrite dhow #13

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open

Rewrite dhow #13

wants to merge 69 commits into from

Conversation

fs-c
Copy link
Contributor

@fs-c fs-c commented Mar 15, 2021

Closes #12
Closes #9
Also related to #11


Stuff that's still TODO:

  • fully implement CLI (I'd like to propose some breaking changes in this regard though, but that's best discussed in the original issue)
  • related to the above: don't expect the input directory to contain a pages directory, expect the input directory to be the pages directory
  • update the README (although this probably warrants some discussion as well)
  • build fully in-memory (although it might be a good idea to have that be a separate PR, to be worked on once this is landed) doesn't look like this is feasible at the moment
  • remove obsolete packages

@fs-c
Copy link
Contributor Author

fs-c commented Mar 18, 2021

Potentially breaking change in the current code, dhow dev now builds to .dhow instead of __dhow__, which is how it should be (prefixed dot usually literally hides the folder, wrapping underscores visually highlight -- we don't want the latter).

Also introduced --input and --output to replace --indir and --outdir mostly because I really didn't want to write indir in my code. I don't care about reverting it, I just don't want to ever look at cli.ts again afterwards.

I also implemented a logger since I don't like spinners. Feel free to revert that, I don't mind. Reminds me of Next.js though, which is usually not a bad thing.

Did some testing in regards to the in-memory builds, I think they will work but I don't have the time at the moment.

@fs-c
Copy link
Contributor Author

fs-c commented Mar 19, 2021

Scratch --input and --output, not worth making this refactor breaking. I wouldn't consider __dhow__ -> .dhow to be breaking since it's undocumented behavior (I think) so I still stand by that.

@kartiknair
Copy link
Owner

Tried running a few of the examples & committed a few bug fixes. I'm unable to debug the tailwind example though. For some reason, it says build successful but writes no HTML files. Any ideas on what could be causing this?

@fs-c
Copy link
Contributor Author

fs-c commented Mar 21, 2021

Where did you commit those bug fixes to?

Also I should note that I have a lot of uncommitted changes right now, I anticipate a big commit in the next couple of days. This should include incremental builds and caching in the build function for dhow dev (this is really big for me, as a tailwind user) and a slew of bugfixes. I don't have any issues with any of the examples at the moment, on my local version.

@fs-c
Copy link
Contributor Author

fs-c commented Mar 21, 2021

Also, in regards to in-memory builds: they seem largely impossible at the moment (without requiring our users to opt into experimental NodeJS modules and forcing .mjs) so I've stopped pursuing them. If you want to give it a shot let me know and I'll post more info.

@fs-c
Copy link
Contributor Author

fs-c commented Mar 21, 2021

This is a big one. I almost regret splitting build.js into two files because seeing the changes is harder now. But there's certainly a shit ton of new logic and I really don't look forward to writing tests for all of that -- but I will absolutely have to because I am certain this is full of bugs and corner cases that I missed. Working on the cache next.

I'm doing all this because I use tailwind, and I got tired of waiting for >10s every build just because PostCSS is slow, even though I didn't even touch a .css file. So yeah, that's how I ended up here. Next up is caching because I don't want to wait >10s when re-running dhow dev even though I didn't touch the .css. This stuff also has the nice side effect of minimizing the amount of getProps and getPaths re-runs, which I was previously concerned about in case I ever throw API calls in there that might be subject to rate limiting.

fs-c and others added 30 commits August 3, 2021 16:47
Add a DOCTYPE to make it a valid HTML5 Document
Update Readme to make it less personal
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.

dhow rewrite Emulate new JSX transform benefits
3 participants