-
Notifications
You must be signed in to change notification settings - Fork 7
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
dhow
rewrite
#12
Comments
Wow, this is a lot of clean work, thank you so much for your interest & support on this project! I have no problem merging this rewrite in, just had a few notes on some of the mentioned changes:
This is really nice,
Unsure about this, leaving it as is would be non-breaking & as previously we can use the
Thank you for #9, it's a very nice convenience feature that I like about Next.js. I think that's all the suggestions/notes I have to mention. Otherwise, the rewrite looks very clean, & definitely easier to maintain!
Haha not at all, feel free to publish your fork anytime, I really don't mind. |
Hey, thanks for the quick response! I'll open a PR in the near future (probably tomorrow) and try to incorporate some changes you suggested.
Yeah that's true, I forgot that
Completely forgot about command line arguments, using that is definitely preferable to introducing a breaking change. I think I may have hardcoded the build function to expect a
Absolutely, I didn't get around to fully implementing the existing CLI behavior; I added it to the TODO. |
One thing that I meant to look at but didn't have the time to pursue is building pages entirely in memory, as opposed to first transpiling the jsx to staging and then building the page. Mainly adding this as a note for me later on but maybe you're interested in looking into it as well. |
Compiling to a staging directory might not be needed. I think the esbuild transform API would allow for directly getting a string after compiling. The part I'm missing is how we |
Yeah that API is what made me think of the possibility. The NodeJS VM module should allow for running a string of JS code. I was previously worried that this wouldn't be an option because |
While working on improving tests/testability and supporting
_app.js
, I accidentally rewrote dhow in the last couple of days, . You can take a look at the changes in therewrite
branch of my fork.Some changes:
min-document
and associated logic is replaced with a custom (very basic) virtual DOM implementation consisting exclusively of aVNode
class that can be stringified down to HTML. This makes many parts of the codebase much easier to reason about and test, stuff like Root fragment breaks build #7 shouldn't be able to happen again._app.js
, inspired by Next.js.pages
has been moved tosrc/pages
(it makes sense if have stuff likesrc/components/header.js
). This is a very opinionated change, I don't feel strongly about keeping it in.Head
doesn't useglobal
anymore.There's still some stuff to do: I haven't had the time to add CSS processing yet (although that shouldn't be a problem) and
buildPages
inbuild.ts
is still a bit too large for my liking. But even so I'm opening this issue now to let you know that this is a thing, it'd be cool to work together on getting this merged (including any changes you propose, of course).Not creating a PR yet because I'd like to hear your opinion on this first. But fair warning, if you take too long I'll probably publish my fork on NPM; I certainly changed enough code and concepts to allow me to that. First and foremost I rewrote this because I want to use
dhow
for my homepage, and I've been putting that off for long enough. Please don't take this as blackmail or something like that, I just want to be able to start work on that in a reasonable timeframe (and I'll need my changes to be on NPM for that).The text was updated successfully, but these errors were encountered: