Jint
MediatR
Jint | MediatR | |
---|---|---|
24 | 53 | |
3,943 | 10,716 | |
- | - | |
9.2 | 5.9 | |
2 days ago | 14 days ago | |
C# | C# | |
BSD 2-clause "Simplified" License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Jint
- Jint – A JavaScript Interpreter for .NET
-
Is there a way to dynamically interpret a string as javascript within a C# winforms program?
Jint https://github.com/sebastienros/jint
- Any framework/library for validating arbitrary code?
-
Scripting inside Rimworld with Unity: Impossible? With java it is a 3 liner.
There are quite a lot of ways to run scripting languages in C#. I've no idea what JSR223 is but .NET has DLR for example. There are also multiple libraries: IronPython, NLua, Jint and Jurassic for Javascript. There's also older version of CS-Script working with .NET Framework.
-
Is there any way to use Javascript to code in Unity anymore?
You can. Embeding lua is a trivial task, and I'm reasonably sure there even are plug-and-play solutions for that, and for JS there's JINT.
-
Running custom code from users
I personally use Jint (a multi-platform Javascript interpreter) since Roslyn is not available on mobile. It basically has the same kind of functionality as Roslyn, but it's JS. JS is well-known and accessible to everybody, but Roslyn might be faster since there's no double indirection when interpreting the script. It also depends on what language your users are comfortable with or could learn easily.
-
Classic BBS (code in comments)
Ah yeah, I looked into it more and decompiled the game to find that it appears they're using Jint to interpret the Javascript, and from testing with someone's REPL BBS server I can find that it's a pretty well isolated environment. Only ways around it I can think of are by exploiting some vulnerability in the sandbox to do external requests, modding the game itself to update the api, or running a parallel server to do some janky communication through the save state data.
-
.NET-compatible scripting languages for users to write their own scripts to query/manipulate objects/properties in the app
We used https://github.com/sebastienros/jint for scripting, it's ES5 JS implementation.
-
The experience of creating my own JavaScript runtime - #2
Jint is a JS interpreter with an integrated engine built in C#, like V8, he is responsible for all the base code execution as well as EcmaScript implementations such as default constructors, syntax, Promises... I studied its features in depth to start and it was a bit hard (in the beginning).
-
The experience of creating my own JavaScript runtime - #1
MelonRuntime is based on Jint, a JavaScript interpreter created by Sébastien Ros, software developer in the ASP.NET team at Microsoft. Melon works from bindings and functionalities injected into this interpreter together with external typing (provided by another package that comes with the default project generated by the command npx melon new) and built-in tools.
MediatR
-
The Monad Invasion - Part 2: Monads in Action!
You probably noticed that .SetName() returns a Either. You may have come across Unit in libraries like MediatR or Language-Ext. It's a simple construct representing a type with only one possible value. We use it as a placeholder for operations that do not return a value but may return another state. In our example, .SetName() is a Command that does not return a value but may fail. Therefore, the monad Either carries two possible states: Right (without value) or Left (with an Error).
-
How small is the smallest .NET Hello World binary?
The widely used MediatR library[0] could be used to do that as well, just FYI.
[0]: https://github.com/jbogard/MediatR
- Cannot use disposed service
- Exception handling between controller and service
-
CQRS: How to handle duplicate queries inside a CommandHandler
Hope this GH issue shed some light on why injecting handler inside another handler is not good https://github.com/jbogard/MediatR/issues/400
-
Is MediatR the only real CQRS solution for .Net?
From: https://github.com/jbogard/MediatR
-
Easiest way to build the fastest REST API in C# and .NET 7 using CQRS
I gave it a go and I was impressed how easy and fast it was to set it all up. Since I'm not a big fan of REPR pattern almost all my projects are using CQRS pattern with a help of MediatR ](https://github.com/jbogard/MediatR) I immediately started going over something similar that Fast Endpoints offer which is a command bus.
-
MVVM Question: How do you manage the interaction between Model and ViewModel?
I'd use a dedicated event bus based on Reactive Extensions or MediatR to publish domain events from your domain services. This probably doesn't solve all your ViewModel update problems as is, maybe you need to revise the granularity (maybe you can have smaller ViewModels that refresh single property that exposes the Model) and lifespan (sometimes you can create a ViewModel, make it perform it's task and then discard it completely) of your ViewModels.
-
Async Methods after setting a property.
If you're finding yourself in a situation where you need to turn this behavior into a pattern because there are a lot of View Models that need to execute async business logic in response to some changes, I'd go with something like MediatR or Reactive Extensions. The idea is, again, that some other, probably business-level, component listens to changes in a decoupled way (that means it doesn't subscribe directly to your View Model, but to an event bus instead). View Model publishes change events to the event bus, and business-component reacts to these events by executing the business logic.
-
I don't get why I should use Redux
What people really want is to design the logic of an app independently from the component hierarchy. That means you need to store state somewhere other than the components and you need to dispatch events that are not attached to the component hierarchy. Also, a one way data flow has well known benefits as described by things like CQRS, RabbitMQ, and MediatR.
What are some alternatives?
Jurassic - A .NET library to parse and execute JavaScript code.
Mediator.Net - A simple mediator for .Net for sending command, publishing event and request response with pipelines supported
Jering.Javascript.NodeJS - Invoke Javascript in NodeJS, from C#
RabbitMQ - Open source RabbitMQ: core server and tier 1 (built-in) plugins
Edge.js - Run .NET and Node.js code in-process on Windows, MacOS, and Linux
Polly - Polly is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner. From version 6.0.1, Polly targets .NET Standard 1.1 and 2.0+.
ReactJS.NET - .NET library for JSX compilation and server-side rendering of React components
Brighter - A framework for building messaging apps with .NET and C#.
Enums.NET - Enums.NET is a high-performance type-safe .NET enum utility library
ApiEndpoints - A project for supporting API Endpoints in ASP.NET Core web applications.
Outcome.NET - Never write a result wrapper again! Outcome.NET is a simple, powerful helper for methods that return a value, but sometimes also need to return validation messages, warnings, or a success bit.
FluentValidation - A popular .NET validation library for building strongly-typed validation rules.