Releases: gronxb/webview-bridge
v1.7.5
v1.7.4
v1.7.3
Caution
This patch contains a breaking change due to the modification of the @webview-bridge/web
communication method. Ensure @webview-bridge/react-native
explicitly uses version 1.7.3 to avoid potential issues.
The compatibility layer has been added in version 1.7.4, resolving the issue.
Please use version 1.7.4.
What's Changed
Full Changelog: v1.7.2...v1.7.3
v1.7.2
v1.7.1
Guide
https://gronxb.github.io/webview-bridge/using-a-post-message.html#broadcast
What's Changed
Full Changelog: v1.7.0...v1.7.1
v1.7.0
Migration Guide
The postMessage
structure was limited to only zod, yup, and superstruct, making it incompatible with various schema libraries.
Therefore, I separated this layer as validate, allowing integration with any schema library.
https://gronxb.github.io/webview-bridge/using-a-post-message.html
- as-is
const appPostMessageSchema = postMessageSchema({
eventName1: z.object({
message: z.string(),
}),
eventName2: z.string(),
});
- to-be
const appPostMessageSchema = postMessageSchema({
eventName1: {
validate: (data) => z.object({
message: z.string(),
}).parse(data)
},
eventName2: {
validate: (data) => z.string().parse(data);
},
});
What's Changed
- chore(example): bump react native 0.76.0 by @gronxb in #68
- chore: deprecated @webview-bridge/vue by @gronxb in #69
- feat(react-native): post message dynamic validate by @gronxb in #70
- chore: migrate tspc, esbuild to tsup, nx by @gronxb in #71
- chore: build:dev command by @gronxb in #72
- chore: bump react 18.3.1 by @gronxb in #73
- fix: resolution @webview-bridge/utils by @gronxb in #74
Full Changelog: v1.6.2...v1.7.0
v1.6.2
v1.6.1
v1.6.0
What's Changed
- feat: initialBridge mock by @gronxb in #56
- chore: remove deprecated linkNativeMethod by @gronxb in #57
- fix: resolve this binding issue in bridge instance by @gronxb in #58
initialBridge
field
https://gronxb.github.io/webview-bridge/non-react-native-environment.html
It is possible to configure initialBridge
to operate in a non-React Native environment.
Prioritize applying the bridge of the React Native WebView, and if it is unavailable, apply the initialBridge
.
Therefore, if initialBridge
is configured, bridge.isWebViewBridgeAvailable
should be true even in environments that are not React Native.
const bridge = linkBridge<AppBridge>({
// this field
initialBridge: {
count: 0,
data: {
text: "123454",
},
openInAppBrowser: async () => {
alert("openInAppBrowser not supported");
},
increase: async () => {
alert("increase not supported");
},
setDataText: async (text) => {
alert("setDataText not supported");
},
},
onReady: () => {
console.log("nativeMethod is ready");
},
throwOnError: true,
}
Full Changelog: v1.5.3...v1.6.0