Releases: NearSocial/VM
Releases · NearSocial/VM
2.6.1
2.6.1
- Add option to bypass the commit modal and skip transaction confirmation modal for all widgets (
features.commitModalBypass.bypassAllandfeatures.bypassTransactionConfirmation). This is intended to use by the gateways that expects external wallet to confirm all transactions.
initNear({
features: {
commitModalBypass: {
bypassAll: true,
},
bypassTransactionConfirmation: true,
},
});- Support
BigandBNduring a deep copy. - Fix typo.
- FIX: Addresses a scoping error on the optional
config.errorCallbackfunction triggerd during Compliation errors and 'VM is dead' errors. - FIX: Prevent adding
data-componentkey to<Fragment>elements.
2.6.0
2.6.0
-
Support multiple Limited Access Keys on BOS gateway to enable "Don't ask me again" when interacting with third-party contracts on BOS. See #148
-
Provide an error callback in the vm init method to allow gateways to capture handled errors
-
FIX: Styled components were not possible to be extended due to an issue parsing Radix components
2.5.6
2.5.6
- FIX: Restrict native object prototypes from being accessed. To address BN issue, reported by BrunoModificato from OtterSec.
- FIX: Filter out some ethers.js utils. Reported by BrunoModificato from OtterSec.
- FIX: Remove potential XSS vulnerability for some SVG tags. Reported by BrunoModificato from OtterSec.
- Minor: report widget
srcwhen VM throws an exception during rendering.
2.5.5
2.5.5
- FIX: Restrict attributes of
Filescomponent to a whitelist. Reported by BrunoModificato from OtterSec.
2.5.4
2.5.4
- Added optional
commitModalBypassfeature config. When the<CommitButton />component is used inside of a widget with a matchingsrcprop, theCommitModalwill be bypassed andonCommit()will be called instantly when the button is clicked. If for some reason the requested transaction is invalid, theCommitModalwill still appear to show an error message to the user. View example below to see configuration options. - Added optional
enableWidgetSrcWithCodeOverrideboolean feature flag. This is helpful to enable when developing in a local environment when using aredirectMapin combination with the newcommitModalBypassfeature. With this enabled, any widget that is overridden viaredirectMapcan still reference itssrcprop to respect yourcommitModalBypassconfig.
initNear({
features: {
commitModalBypass: {
authorIds: ["mob.near", "root.near"], // Bypass for all widgets published by these accounts
sources: [
"cool.near/widget/CoolComponent",
"awesome.near/widget/AwesomeComponent",
], // Bypass for specific components
},
enableWidgetSrcWithCodeOverride: isLocalEnvironment,
},
});- Add string type check to the
hrefproperty on theatag. Reported by BrunoModificato from OtterSec.
2.5.3
2.5.3
- FIX: Remove
cachedProperyfromelliptic.utils. Reported by BrunoModificato from OtterSec. - FIX: Replace url-sanitize library with dompurify. Reported by BrunoModificato from OtterSec.
- FIX: Replace internal usage of
inoperator withhasOwnPropertyon dictionaries to avoid exposing certain built-in methods and properties. Reported by BrunoModificato from OtterSec. - FIX:
atobandbtoaare working correctly now.
2.5.2
- Use
styled-componentsin combination withcustomElementslikeLink:
const MyLink = styled("Link")`
color: red;
`;
return (
<MyLink href="/my/page">
Click Me!
</MyLink>
);2.5.1
2.5.0
2.5.0
- Fix
defaultcase for the switch statement inVM. - Add a VM feature,
enableComponentSrcDataKey, which adds thedata-componentattribute specifying the path of the comonent responsible for rendering the DOM element. - Add support for VM.require when using redirectMap.
- Fixes an issue with VM.require not retaining context in migration to initGlobalFunctions.
- Add
onLinkandonImageto Markdown component. It allows to display links and images differently. - Expose all VM functions into the state directly, it simplifies VM readability and implementation.
- Expose certain native objects directly into the state. It should improve access to the functions.
- Update the way events and errors are passed to the functions.
- For events, expose
preventDefault()andstopPropagation()functions.
NOTE: Previously, all React'sSyntheticEvents were gettingpreventDefault()called by default. - For errors, expose
message,nameandtype.
- For events, expose
- Fix
vm.depthnot being initialized. - Introduce
useMemohook. Similar to the React hook, it calculates a value and memoizes it, only recalculating when one of its dependencies changes.
const data = [
//...some large array
];
const filteredData = useMemo(() => {
console.log("Filtering data");
return data.filter(/* some filtering criteria */);
}, [data]);
return (
<div>
{filteredData.map(item => (
<div key={item.id}>{item.name}</div>
))}
</div>
);- Introduce
useCallbackhook. Similarly to the React hook, it memoizes a callback function and returns that memoized version unless one of its dependencies changes.
const incrementCounter = useCallback(() => {
setCounter(counter + 1);
}, [counter]);
return (
<div>
Counter = {counter}
<div>
<button onClick={incrementCounter}>Increment</button>
</div>
</div>
);2.4.2
2.4.2
- Add missing code changes (
cacheOptionsandlodash) from 2.4.0.
This happened due to revert from master that later cleaned changes from dev at merge conflict.