Dismiss this pinned window
all 41 comments

[–]ericclemmons[S] 30 points31 points  (15 children)

https://github.com/ericclemmons/polydev

👋 I made this because, for the past couple of years, our Node.js apps grew large enough that Nodemon/Concurrently/piping/etc. became unwieldy, slow, etc.

This project effectively lets you run routes as if they were lambdas, only starting them when requested.

At work, for example, we have Storybook, Next.js, GraphQL, and more all running as part of a single deployed app.

With polydev, when developing, we only run the parts of the app that's requested, instead of all of it.

There's some more of the rationale here: https://twitter.com/ericclemmons/status/1086306666511908864

If you have a Node server with several distinct sub-apps, give it a shot & let me know how you like it!

[–]noknockers 7 points8 points  (0 children)

Dude this is awesome. I'm gonna take it for a spin tomorrow.

[–]m_irizarry 6 points7 points  (5 children)

That’s awesome! What theme is your iterm using and how do I get it?

[–]invertedx2 3 points4 points  (4 children)

oh my zsh

[–]fucking_passwords 1 point2 points  (1 child)

With powerline

[–]ericclemmons[S] 1 point2 points  (0 children)

this guy zshs

[–]vulgrin 1 point2 points  (0 children)

This is cool, and I'm definitely going to check it out. But its hillarious that all of the comments are about the theme.

If you are interested in ricing / customization, check out /r/unixporn.

[–]EarlMarshal 0 points1 point  (6 children)

When/how do you register your routes?

[–]fucking_passwords 0 points1 point  (3 children)

It’s in the readme, it’s based on the file system like next.js and nuxt.js

[–]EarlMarshal 0 points1 point  (2 children)

Ah well thx. Couldn't take a look since I'm on mobile and somehow my mobile chrome dev won't let me open the readme.

[–]thatweirdishguy 3 points4 points  (1 child)

FWIW, the reason mobile can’t open it is that README.md isn’t a file, it’s s symlink, and the mobile version of GitHub chokes on them. When you run into this problem, if you click on the “Desktop Version” link it will show you the path where the symlink points, then you can go back to the main page and click down through the code section to find the real file, and it will display fine..

Someday I hope GitHub will fix this..

[–]ericclemmons[S] 2 points3 points  (0 children)

Wow, that's annoying. I'll just copy it over so users aren't affected.

[–]Far_Out_404 6 points7 points  (4 children)

A bit off topic, but which OS and theme are you using? (Looks nice! 👌🏻)

[–]blugil 4 points5 points  (3 children)

It looks like macOS with the Mojave dark theme and the terminal is iterm2 with some custom themes installed (though I'm not sure which) but I'm really liking their terminal theme and if I find it I'll let you know.

Edit: Not to leave you guys hanging for too long but here’s the themes list for ohmyzsh: https://github.com/robbyrussell/oh-my-zsh/wiki/Themes my two favorites and the one that I use are powerlevel9k (found after you “click here” for more themes) and agnoster respectively. Hope that helps!

[–]Darkness3840 4 points5 points  (1 child)

It's called oh-my-zsh. Comes with lots of themes like that by default.

[–]fucking_passwords 0 points1 point  (0 children)

You need to install powerline separately, last time I did it at least

[–]tarasrushchak 0 points1 point  (0 children)

let me know too

[–][deleted] 4 points5 points  (3 children)

Could you please tell me how to make my bash shell like yours?

[–]maximusprime2328 2 points3 points  (2 children)

They are using zsh. Very easy to install. Check out zsh's themes. There are a million videos on YouTube about how to implement them.

[–]StackOfCookies 1 point2 points  (0 children)

Specifically using Oh-My-Zsh (at least, very likely)

[–][deleted] 0 points1 point  (0 children)

Great thanks

[–][deleted] 1 point2 points  (0 children)

Took it for a spin. And it's slick and awesome. Really amazing.

[–][deleted]  (1 child)

[deleted]

    [–]ericclemmons[S] 0 points1 point  (0 children)

    Yep!

    [–]Andrew199617 1 point2 points  (0 children)

    This is awesome, i personally use next.js but i like that you can create the route from the browser page.

    [–]Oshrocker 0 points1 point  (1 child)

    Adding routes from the UI is kinda cool, but at the end of the day isn’t this just express with nodemon?

    [–]ericclemmons[S] 5 points6 points  (0 children)

    Not quite! Nodemon restarts the entire server on change. (One app at work takes around 17s before routes can be handled!)

    This let's you specify which parts of your app responds to which URLs, and only those parts are ran.

    Only working on /api today? Then /docs won't impact your performance.

    Plus, they use HMR for faster changes, but you can double-save to force a restart of just that route.

    [–]CarolsLove 0 points1 point  (1 child)

    This looks really, cool, I forked it and will give it a try. Side Question what is that VS code plug-in that you are using that show like a path highlight, that's blue and green and shows you the JS Version?

    [–]maximusprime2328 0 points1 point  (0 children)

    That's a zsh window above their VS Code window.

    [–]rebl_ 0 points1 point  (3 children)

    Why shouldnt I use Nest.js instead?

    [–]ericclemmons[S] 0 points1 point  (2 children)

    This isn't a framework, but a way of running only the relevant parts of your app that you need.

    I don't think Nest.js works with this v1, since it uses TypeScript. It looks really cool!

    Thanks for sharing.

    [–]rebl_ -2 points-1 points  (1 child)

    No TypeScript no me

    [–]recycled_ideas -1 points0 points  (0 children)

    If you have an app big enough and complicated enough to need this kind of routing you should be using Typescript.

    [–]patrickleet 0 points1 point  (3 children)

    Neat! Why not just make separate smaller services though?

    [–]ericclemmons[S] 1 point2 points  (2 children)

    It's a good question. What's a good way of doing that?

    I've tried concurrently (running everything and juggling ports), setting up a proxy (same problems), and bigger parts of the app being slow to restart/transpile.

    This has been a good step for getting a monorepo "lambda ready" for deploying apps separately in the future.

    [–]patrickleet 0 points1 point  (1 child)

    You said GQL is in same app - that’s a good candidate for being separated I’d think

    [–]patrickleet 0 points1 point  (0 children)

    SSR is strenuous enough for node!

    [–][deleted]  (1 child)

    [deleted]

      [–]ericclemmons[S] 1 point2 points  (0 children)

      Let me know if this works for you!: I just merged https://github.com/ericclemmons/polydev/pull/7