v3.0.0
Build Process
Migrate to Storybook v4
We updated our storybook to the latest version, adding support for detecting accessibility recommendations and automatic structural components snapshots.
Scoped Packages
In order to follow the same pattern over different SDK connectors, from now they are shipped using a scoped name
microlinkjs
→@microlink/vanilla
.react-microlink
→@microlink/react
.
That's also applied for CDN:
<!-- Microlink SDK Vanilla/UMD bundle -->
<script src="//cdn.jsdelivr.net/npm/@microlink/vanilla@latest/umd/microlink.min.js"></script>
<!-- Microlink SDK AMD bundle -->
<script src="//cdn.jsdelivr.net/npm/@microlink/vanilla@latest/amd/microlink.min.js"></script>
<!-- Microlink SDK CJS bundle -->
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/@microlink/vanilla@latest/cjs/microlink.min.js"></script>
API Parameters
Rename data
→ setData
The API Parameter data has been rename into setData.
In addition, you can use setData passing an object
:
<Microlink setData={{title: 'hello world'}}
In this case, the object will assign after the microlink API response payload, so it will replace values from the payload.
In case you need more granularity control, (for example, assign defaults values but not replacing them if they exist from the API response) you can pass a function
<Microlink setData={(data) => {
// You need to return the final value for the card preview
if (!data.title) data.title = 'hello world'
return data
}}
The function works like a mapper. The returned value will used for the card preview.