Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

io.extendreality.malimbe

Package Overview
Dependencies
Maintainers
3
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

io.extendreality.malimbe - npm Package Compare versions

Comparing version 8.2.4 to 9.0.0

Editor/Malimbe.MemberChangeMethod.Fody.dll

29

CHANGELOG.md
# Changelog
# [9.0.0](https://github.com/ExtendRealityLtd/Malimbe/compare/v8.2.4...v9.0.0) (2019-03-04)
### Bug Fixes
* **PropertySerialization:** fix null reference exception ([97fdf72](https://github.com/ExtendRealityLtd/Malimbe/commit/97fdf72))
* **UnityIntegration:** remove manual weaving menu item entry ([1404254](https://github.com/ExtendRealityLtd/Malimbe/commit/1404254))
### Code Refactoring
* **PropertyValidation:** remove property validation ([1e1c8f7](https://github.com/ExtendRealityLtd/Malimbe/commit/1e1c8f7))
### Features
* **MemberChange:** overhaul PropertySetter for Unity usage ([173a358](https://github.com/ExtendRealityLtd/Malimbe/commit/173a358))
### BREAKING CHANGES
* **MemberChange:** `CalledBySetterAttribute` has been replaced with
`CalledBeforeChangeOfAttribute` and `CalledAfterChangeOfAttribute`.
Please see the latest Readme for more details.
* **PropertyValidation:** Property validation has been removed from Malimbe.
For an alternative solution please look out for a future version of
this project or
[Zinnia](https://github.com/ExtendRealityLtd/Zinnia.Unity).
## [8.2.4](https://github.com/ExtendRealityLtd/Malimbe/compare/v8.2.3...v8.2.4) (2019-02-27)

@@ -4,0 +33,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"description": "A collection of tools to simplify writing public API components in Unity.",
"version": "8.2.4",
"version": "9.0.0",
"unity": "2018.1",

@@ -8,0 +8,0 @@ "keywords": [

@@ -29,3 +29,3 @@ [![Malimbe logo][Malimbe-Image]](#)

1. Download a release from the [Releases] page and extract it into your folder you use to keep your packages. It is recommended to make that folder part of your project and therefore [version controlled][VCS].
1. Open your project created with the Unity software version 2018.3 (or above) project and follow [Unity's instructions][UPM-Instructions] on how to add the package to your project using UPM.
1. Open your project created with the Unity software version 2018.3 (or above) and follow [Unity's instructions][UPM-Instructions] on how to add the package to your project using UPM.
1. Anywhere in your Unity software project add a [`FodyWeavers.xml` file][FodyWeavers].

@@ -43,6 +43,5 @@ 1. Configure the various weavers Malimbe offers, e.g.:

<Malimbe.BehaviourStateRequirementMethod/>
<Malimbe.MemberChangeMethod/>
<Malimbe.MemberClearanceMethod/>
<Malimbe.PropertySerializationAttribute/>
<Malimbe.PropertySetterMethod/>
<Malimbe.PropertyValidationMethod/>
<Malimbe.XmlDocumentationAttribute IdentifierReplacementFormat="`{0}`"/>

@@ -79,3 +78,2 @@ </Weavers>

* There is no need to manually run the weaving process. The library just needs to be part of a Unity software project (it's configured to only run in the Editor) to be used. It hooks into the various callbacks the Unity software offers and automatically weaves any assembly on startup as well as when they change.
* Once the library is loaded in the Editor a menu item `Tools/Malimbe/Weave All Assemblies` allows to manually trigger the weaving process for all assemblies in the current project. This is useful when a `FodyWeavers.xml` file was changed.

@@ -89,2 +87,13 @@ ### `BehaviourStateRequirementMethod`

### `MemberChangeMethod.Fody`
A Unity software specific weaver. Calls a method before or after a data member (field or property) is changed.
* Annotate a method with `[CalledBeforeChangeOf(nameof(SomeFieldOrProperty))]` (or `CalledAfterChangeOfAttribute`) to use this. The accessibility level of the method doesn't matter and the name lookup is case insensitive.
* The method needs to follow the signature pattern `void MethodName()`. Use the data member's accessor in the method body to retrieve the current value. The method will only be called when [`Application.isPlaying`][Application.isPlaying] is `true`.
* The referenced data member needs to be declared in the same type the method is declared in. For a property member a getter is required.
* A custom Editor `InspectorEditor` is part of `FodyRunner.UnityIntegration` and is automatically used to draw the inspector for any type that doesn't use a custom editor. This custom editor calls the configured methods on change of a data member annotated with one of the two attributes above.
* Note that this is only done when the Editor is playing, as changes at design time should be handled by using [`PropertyAttribute`][PropertyAttribute]s and calling the same method that uses `CalledAfterChangeOfAttribute` for this data member in `OnEnable` of the declaring type. With that in place the data member's state will properly be handled, right at startup and from there on by the annotated change handling methods.
* Inherit from `InspectorEditor` in custom editors for types that use one of the two attributes above and override the method `DrawProperty`.
### `MemberClearanceMethod.Fody`

@@ -112,22 +121,2 @@

### `PropertySetterMethod.Fody`
A generic weaver. Calls a method at the end of a property's setter.
* Annotate a method with `[CalledBySetter(nameof(SomeProperty))]` to use this. The accessibility level of the method doesn't matter and the name lookup is case insensitive. A call to this method will be added to the _end_ of the property's setter.
* The method needs to follow the signature pattern `void MethodName(T previousValue, ref T newValue)` where `T` is the property's type. This allows the method's body to use the previous and new values and also offers the ability to change the final value by setting `newValue` if needed.
* The property needs to be declared in the same type the method is declared in. Both a getter and setter are required for the property.
### `PropertyValidationMethod.Fody`
A generic weaver (though made for the Unity software). Creates a `OnValidate()` method that validates a property.
* Annotate a property with `[Validated]` to use this. The property needs both a getter and setter.
* Instead of `OnValidate` the method name can be customized with the XML _attribute_ `MethodName`, e.g.:
```xml
<Malimbe.PropertyValidationMethod MethodName="Validate" />
```
* In case the method already exists the additional instructions will be weaved into the _end_ of the method. The method name lookup is case insensitive.
* If necessary the method and the base type's method will be adjusted to override the method of the same name. Accessibility levels are also adjusted as needed.
### `XmlDocumentationAttribute.Fody`

@@ -193,2 +182,4 @@

[Unity]: https://unity3d.com/
[Application.isPlaying]: https://docs.unity3d.com/ScriptReference/Application-isPlaying.html
[PropertyAttribute]: https://docs.unity3d.com/ScriptReference/PropertyAttribute.html

@@ -195,0 +186,0 @@ [Fody's naming]: https://github.com/Fody/Fody#naming

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc