
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
view-models
Advanced tools
Tools for converting type definitions in client side apps to type definitions in server-side languages. Currently supports converting types from React or TypeScript/React to C#, Kotlin or TypeScript.
These tools were developed for adding type safety to websites that employ server-side rendering where the client and server use different languages (like rendering React components in C# using ReactJS.NET). Combining this with CI/CD helps uncover breaking changes in the client/server integration before they reach end users.
npm install --save-dev view-models
To see the CLI help, run view-models --help.
Read more here
Config example. See complete list of options here
const ViewModelsPlugin = require('view-models/webpack-plugin');
const { generators, parsers } = require('view-models');
module.exports = {
entry: { ... },
output: { ... },
plugins: [
new ViewModelsPlugin({
include: [/\.tsx$/],
exclude: ['node_modules', 'some/path/to/exclude'],
compilerOptions: {
parser: parsers.typescriptReact, // Optional
generator: generators.kotlin // Optional
}
})
]
};
Read more here
{
"plugins": ["view-models/babel-plugin"]
}
Read more here
npm install --save-dev eslint-plugin-view-models
{
"plugins": ["eslint-plugin-view-models"],
"rules": {
"view-models/no-errors": "error",
"view-models/no-unused-meta": "warn",
"view-models/no-meta-mismatch": "warn",
"view-models/no-prop-mapping": "warn"
}
}
Only some of the parsers/generators in this package have been properly tested:
This is a TypeScript rewrite of @creuna/prop-types-csharp which I created while employed at Creuna. At Creuna we started using ReactJS.NET for server-side rendering pretty heavily around 2017 and soon discovered that a javascript/C# integration can be quite brittle. Breakage was common. I introduced this tool mid-2018 and since sorting out the initial kinks it has been very helpful in reducing runtime breakage.
If you're migrating from @creuna/prop-types-csharp here's a migration guide.
FAQs
Generate viewmodels from react components
We found that view-models 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.