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.
render-jsx
Advanced tools
Tools for building JSX-based libraries / frameworks, also a super-thin and fast pure DOM renderer.
npm i render-jsx
/** @jsx renderer.create */
import { CommonDOMRenderer } from 'render-jsx/dom';
const renderer = new CommonDOMRenderer();
renderer.render(
<div>
<b>Hellow</b> World!
</div>
).on(document.body);
JSX is an syntax extension of JavaScript, allowing for XML-style representations within JavaScript. JSX needs to be transpiled (since it is an extension), with transpilers such as TypeScript or Babel. Transpilers in turn need to know what JSX should mean.
Render-JSX provides abstraction for specifying that meaning in a highly extensible way, allowing re-use of components and common JSX patterns across different domains. For example, you can re-use your components (or your custom class-based component system) while rendering to DOM (client-side), to HTML string (server side), to native UI libraries, to custom input format of a PDF generator, etc.
Render-JSX also comes with a super-thin and fast DOM renderer (which is mostly meant as a basis of more involved UI renderers). This means you can use it to create simple web interfaces without any extra dependency.
╭────────────────────╮ ╭────────────────────╮
│ │ │ │
│ App │────▶│ Components │╶╶╶╶╶╶╶╶╮
│ │╶╮ │ │ ╷
╰────────────────────╯ ╷ ╰────────────────────╯ ╷
│ ╷ │ ╷
╰────╮ ╰╶╶╶╶╶╶╶╶╶╶╶╶╶ │ ╶╶╶╶╶╶╶╶╶╶╶╶╶╶╮ ╷
│ │ ╷ ╷
╭────────────╮ ▼ ▼ ╷ ╷
╭─│ Renderer │────────────────────────────────╮ ╷ ╷
│ ╰────────────╯ │ ╷ ╷
│ ╭─────────────────────────────────╮ │ ╷ ╷
│ │ │ │ ╷ ╷
│ │ Plugins │╶╶╶╶╶╶╶╶╶╮ ╷ ╷
│ │ │ │ ╷ ╷ ╷
│ ╰─────────────────────────────────╯ │ ╷ ╷ ╷
│ │ │ ╷ ╷ ╷
│ ▼ │ ╷ ╷ ╷
│ ╭─────────────────────────────────╮ │ ╷ ╷ ╷
│ │ │ │ ╷ ╷ ╷
│ │ Base Renderer │ │ ╷ ╷ ╷
│ │ │ │ ╷ ╷ ╷
│ ╰─────────────────────────────────╯ │ ╷ ╷ ╷
│ │ │ ╷ ╷ ╷
╰────────────────────── │ ──────────────────────╯ ╷ ╷ ╷
│ ╷ ╷ ╷
▼ ▽ ▽ ▽
╭──╮ ╭──╮ ╭──╮ ╭──╮ ╭──╮ ╭──╮ ╭──╮ ╭──╮ ╭──╮ ╭──╮ ╭──╮
│ ╰──╯ ╰──╯ ╰──╯ ╰──╯ ╰──╯ ╰──╯ ╰──╯ ╰──╯ ╰──╯ ╰──╯ │
│ │
│ Environment / Context │
│ │
Use starter templates:
Or get the package:
npm i render-jsx
And use the following pragmas in your .jsx
/.tsx
files:
/** @jsx renderer.create */
/** @jsxFrag renderer.fragment */
There are no contribution guidelines or issue templates currently, so just be nice (and also note that this is REALLY early stage). Useful commands for development / testing:
git clone https://github.com/loreanvictor/render-jsx.git
npm i # --> install dependencies
npm start # --> run `samples/index.tsx` on `localhost:3000`
npm test # --> run all tests
npm run cov:view # --> run tests and display the code coverage report
npm i -g @codedoc/cli # --> install CODEDOC cli (for working on docs)
codedoc install # --> install CODEDOC dependencies (for working on docs)
codedoc serve # --> serve docs on `localhost:3000/render-jsx` (from `docs/md/`)
FAQs
render pure dom using JSX
We found that render-jsx 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.