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.bypassAll
andfeatures.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
Big
andBN
during a deep copy. - Fix typo.
- FIX: Addresses a scoping error on the optional
config.errorCallback
function triggerd during Compliation errors and 'VM is dead' errors. - FIX: Prevent adding
data-component
key 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
src
when VM throws an exception during rendering.
2.5.5
2.5.5
- FIX: Restrict attributes of
Files
component to a whitelist. Reported by BrunoModificato from OtterSec.
2.5.4
2.5.4
- Added optional
commitModalBypass
feature config. When the<CommitButton />
component is used inside of a widget with a matchingsrc
prop, theCommitModal
will be bypassed andonCommit()
will be called instantly when the button is clicked. If for some reason the requested transaction is invalid, theCommitModal
will still appear to show an error message to the user. View example below to see configuration options. - Added optional
enableWidgetSrcWithCodeOverride
boolean feature flag. This is helpful to enable when developing in a local environment when using aredirectMap
in combination with the newcommitModalBypass
feature. With this enabled, any widget that is overridden viaredirectMap
can still reference itssrc
prop to respect yourcommitModalBypass
config.
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
href
property on thea
tag. Reported by BrunoModificato from OtterSec.
2.5.3
2.5.3
- FIX: Remove
cachedPropery
fromelliptic.utils
. Reported by BrunoModificato from OtterSec. - FIX: Replace url-sanitize library with dompurify. Reported by BrunoModificato from OtterSec.
- FIX: Replace internal usage of
in
operator withhasOwnProperty
on dictionaries to avoid exposing certain built-in methods and properties. Reported by BrunoModificato from OtterSec. - FIX:
atob
andbtoa
are working correctly now.
2.5.2
- Use
styled-components
in combination withcustomElements
likeLink
:
const MyLink = styled("Link")`
color: red;
`;
return (
<MyLink href="/my/page">
Click Me!
</MyLink>
);
2.5.1
2.5.0
2.5.0
- Fix
default
case for the switch statement inVM
. - Add a VM feature,
enableComponentSrcDataKey
, which adds thedata-component
attribute 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
onLink
andonImage
to 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'sSyntheticEvent
s were gettingpreventDefault()
called by default. - For errors, expose
message
,name
andtype
.
- For events, expose
- Fix
vm.depth
not being initialized. - Introduce
useMemo
hook. 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
useCallback
hook. 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 (
cacheOptions
andlodash
) from 2.4.0.
This happened due to revert from master that later cleaned changes from dev at merge conflict.