Out of curiosity how man…
Out of curiosity how many developers uses NX and tightly couple themselves to frameworks such as reach, angular, express and NestJs? Or do people use these frameworks as an access point into your code base?
Responses:
I’m trying to strike a balance. For our current long-term project, the more important thing is to keep the option to replace the testing framework and the test runner. I use Chai and Sinon for this reason. They are testing framework-agnostic.
Our code base is strictly built on top of Angular and Nest but I forsee us branching out into other technologies in the future if the need suites us as we build our more products.
We’re actually using Koa with Nx. But most of our code is written in plain classes or modules that export a collection of functions. We also have a handful of libraries that we’ve developed for our selves internally.
so I guess outside of a few middleware functions we’ve written, and our route handling, we’re not really tied to any particular framework
I have actually been working on an adapter for Koa + Nest since nest has an adapter for express and fastify. It was more for a proof of concept though.
that’s cool . I like Koa but it never got the adoption that express has
I have never actually used Koa… Just dived right in and started building an adapter for Nest because I am such a huge Nest fan :laughing:
Thats what i was considering. Yes sometimes you need framework code. But i tend to write code thats abstract, using facade layers and DI/IOC tokens to swap out the implementation.
I’ve done one project where we extended classes just to add framework wrappers. I wasn’t sure if this was an over kill but then we was able to swap the system and change the entry framework
We dont really assume we’re going to switch frameworks. But I thought it would be a good idea if at least our business logic wasn’t tied to any specific framework. If we do end up switching, rewriting some middleware and the routing isn’t a big deal
like your thinking. Thats basically what I did to help start NX storybook builder. Never done schematics before and i decided to build the storybook builder. Best way of learning
totally! When I was learning schematics I dived into Nx and built the @nrwl/nest library schematic! It took a bit to figure out but I got there eventually and how it is available in nx 9!
I am now doing the same thing with tslint as it is missing a rule that I wanted access to in angular.
> I’ve done one project where we extended classes just to add framework wrappers. I wasn’t sure if this was an over kill but then we was able to swap the system and change the entry framework This is what we need to do to stop depending on Angular decorators in our non-presentational layers. It’s a pain though because of Angular’s class-based, static analysis approach. Just dumb grunt work which makes it appealing to put off.
The developer experience of using Angular’s dependency injection system without tying all our layers to Angular is not at a pleasant level.
I notice that, so many Javascript/typescript developers only know the framework not the language. I guess its about finding the balance which I think is quiet hard. I think it be sweet if we get a build or schematic that would do the leg work for us