Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
nest-next-renderer
Advanced tools
Module for rendering Next.js pages inside Next.js applications.
Note: At the moment this package works only with Next and Fastify.
This package requires to be installed in a Next application that is using Fastify as platform (read more).
This is the full list of peer dependencies:
yarn add @nestjs/common
yarn add fastify
yarn add react react-dom next
Note: In theory you should install just
react
,react-dom
andnext
because@nestjs/common
andfastify
might be already installed.
Note: If you are using TypeScript, you should install
@types/react
and@types/react-dom
as well.
Run: yarn add nest-next-renderer
Import the module:
import { Module } from '@nestjs/common';
import { NextRendererModule } from 'nest-next-renderer';
@Module({
imports: [
NextRendererModule.forRoot({
dev: process.env.NODE_ENV !== 'production',
dir: './client',
customServer: true,
conf: {
// Next.js config
},
}),
],
})
export class AppModule {}
Render from a controller:
// WIP
You can contribute to this project by opening an issue or creating a pull request.
Note: If you want to test this library locally by using yarn link, you should know that there will be a conflict between the local
@nestjs/common
and@nestjs/core
packages (devDependencies) and the ones in the test project. To fix this, you'll have to use the same module path in both projects.
Add tests
Add documentation and example
Document the default values for the NextRendererModuleOptions
Add @Render
decorator
Make it work with Express or others
Make it possible to render any page without a controller (useFileSystemPublicRoutes
+ @Get('*')
and @Post('*')
that calls next.handle
)
Generate enum for the view
parameter based on the content of the pages
folder
Server not working with hot reload (if it's on the consumer side document the proper configuration)
Add a filter for errors and let the consumer choose how does he want to handle them (with Nest or with Next) (example)
Add command to copy the dist folder to a project that linked to this package for development purposes
Example:
1. Create a GIT ignored file called `linked-projects.paths` in the root of this project containing the paths to the projects that are linked to this package
2. Create a script in the `package.json` file that copies the `dist` folder to the paths specified in the `linked-projects.paths` file
3. Run the script after every build
FAQs
Render Next.js pages in Nest.js applications
The npm package nest-next-renderer receives a total of 1 weekly downloads. As such, nest-next-renderer popularity was classified as not popular.
We found that nest-next-renderer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.