Releases: wpdas/near-social-bridge
Releases · wpdas/near-social-bridge
v1.3.3
v1.3.2
v1.3.1
v1.3.0
- Support to Server-side Rendering;
- Now, it's necessary to import the
near-social-bridge.css
to the main application; - Fixed an error that occurred when a new route was requested and the properties of the previous route were lost before changing the screen;
- Performance improvement;
- Auto iframe height resizer added (own solution);
- When using
Navigator
withautoHeightSync
set astrue
, the height of the iframe is automatically adjusted to the initial screen content. If more content is inserted inside the screen after the first render, you can useuseSyncContentHeight
hook to sync the height again; - Added
useSyncContentHeight
hook:
You can use this hook to do a content height sync. Thus, the height of the viewer's iframe will always have the updated height.
import { useSyncContentHeight } from 'near-social-bridge'
const MyComponent = () => {
const { done, syncAgain } = useSyncContentHeight()
console.log('is sync done?', done)
const [list, setList] = useState(['a'])
useEffect(() => {
setList(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'])
syncAgain()
}, [])
return (
<div className="flex flex-col">
<p>list</p>
{list.map((item) => (
<p key={item}>{item}</p>
))}
</div>
)
}
Or, you can just use useSyncContentHeight()
:
import { useSyncContentHeight } from 'near-social-bridge'
const MyComponent = () => {
useSyncContentHeight()
const list = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k']
return (
<div className="flex flex-col">
<p>list</p>
{list.map((item) => (
<p key={item}>{item}</p>
))}
</div>
)
}
v1.2.5
v1.2.4
v1.2.3
v1.2.1
v1.2.0
- Fixed issue where
localStorage
was not available inside VM - Fixed bug where
hydrate-view
request was failing - Auto refresh fixed
- Added Spinner to be used as default Fallback
- Added a palliative feature to fix a bug that happens with react.
When content inside an iframe is updated, react adds an iframe covering the entire
screen using the maximum z-index, thus making any interaction with the application impossible. - Widget
NearSocialBridgeCore
updated. An issue while fetching data with Storage API was fixed.
TheUtils.promisify
method was also updated, now it's possible to set the timeout manually. - Added
Spinner
component to be used as defaultFallback
forcreateStackNavigator
andNearSocialBridgeProvider
.
E.g:
var myTimeout = 3000; // 3 sec
Utils.promisify(() => getCachedObject(), (res) => console.log(res), (err) => console.log(err), myTimeout)
v1.1.0
- feature
mockInitialPayload
added
During the development, use mockInitialPayload
to mock the initial payload (sent by the Widget).
// Mock
import { mockInitialPayload } from 'near-social-bridge'
mockInitialPayload({
defaultRoom: 'dragon-ball-z',
})
// App
import { useInitialPayload } from 'near-social-bridge/hooks'
const MyComponent = () => {
const { defaultRoom } = useInitialPayload() // 'dragon-ball-z'
}