Skip to content

Releases: NearSocial/VM

2.6.1

22 Apr 16:51
6047c6a
Compare
Choose a tag to compare

2.6.1

  • Add option to bypass the commit modal and skip transaction confirmation modal for all widgets (features.commitModalBypass.bypassAll and features.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 and BN 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

28 Feb 02:47
8dbb065
Compare
Choose a tag to compare

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

31 Jan 17:21
fe647fe
Compare
Choose a tag to compare

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

08 Jan 21:42
d8eb167
Compare
Choose a tag to compare

2.5.5

  • FIX: Restrict attributes of Files component to a whitelist. Reported by BrunoModificato from OtterSec.

2.5.4

04 Jan 23:21
e9e6173
Compare
Choose a tag to compare

2.5.4

  • Added optional commitModalBypass feature config. When the <CommitButton /> component is used inside of a widget with a matching src prop, the CommitModal will be bypassed and onCommit() will be called instantly when the button is clicked. If for some reason the requested transaction is invalid, the CommitModal 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 a redirectMap in combination with the new commitModalBypass feature. With this enabled, any widget that is overridden via redirectMap can still reference its src prop to respect your commitModalBypass 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 the a tag. Reported by BrunoModificato from OtterSec.

2.5.3

04 Dec 21:01
b1e7886
Compare
Choose a tag to compare

2.5.3

  • FIX: Remove cachedPropery from elliptic.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 with hasOwnProperty on dictionaries to avoid exposing certain built-in methods and properties. Reported by BrunoModificato from OtterSec.
  • FIX: atob and btoa are working correctly now.

2.5.2

25 Oct 20:55
9fe2d4e
Compare
Choose a tag to compare
  • Use styled-components in combination with customElements like Link:
const MyLink = styled("Link")`
  color: red;
`;

return (
  <MyLink href="/my/page">
    Click Me!
  </MyLink>
);

2.5.1

16 Oct 18:31
32a404f
Compare
Choose a tag to compare

2.5.1

  • FIX: Add back Ethers.send, that was incorrectly removed as part of the #128
  • FIX: Disable is attribute to avoid conflicts with React. Reported by @brunomodificato

2.5.0

13 Oct 21:20
2794f26
Compare
Choose a tag to compare

2.5.0

  • Fix default case for the switch statement in VM.
  • Add a VM feature, enableComponentSrcDataKey, which adds the data-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 and onImage 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() and stopPropagation() functions.
      NOTE: Previously, all React's SyntheticEvents were getting preventDefault() called by default.
    • For errors, expose message, name and type.
  • 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

20 Sep 16:37
a6ed652
Compare
Choose a tag to compare

2.4.2

  • Add missing code changes (cacheOptions and lodash) from 2.4.0.

This happened due to revert from master that later cleaned changes from dev at merge conflict.