@builder.io/sdk-qwik 0.1.15 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -0
- package/lib/index.qwik.cjs +450 -431
- package/lib/index.qwik.mjs +452 -433
- package/package.json +2 -2
- package/types/blocks/columns/columns.d.ts +3 -3
- package/types/blocks/image/image.d.ts +2 -2
- package/types/blocks/symbol/symbol.d.ts +2 -2
- package/types/components/render-block/block-styles.d.ts +2 -2
- package/types/components/render-block/render-block.d.ts +4 -2
- package/types/components/render-block/render-component.d.ts +2 -2
- package/types/components/render-block/render-repeated-block.d.ts +2 -2
- package/types/components/render-blocks.d.ts +1 -1
- package/types/components/render-content/components/render-styles.d.ts +1 -1
- package/types/components/render-content/render-content.d.ts +3 -3
- package/types/context/builder.context.d.ts +1 -1
- package/types/context/types.d.ts +1 -1
- package/types/functions/get-content/index.d.ts +5 -5
- package/types/functions/get-content/types.d.ts +1 -1
- package/types/functions/get-global-this.d.ts +4 -2
- package/types/types/api-version.d.ts +1 -0
package/README.md
CHANGED
|
@@ -107,6 +107,63 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
107
107
|
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
+
### [Beta] Guide to use API Version v3 to query for content
|
|
111
|
+
|
|
112
|
+
For using API Version `v3`, you need to add `apiVersion: 'v3'` to the `getContent` function and in the `RenderContent` tag. For example:
|
|
113
|
+
|
|
114
|
+
```typscript
|
|
115
|
+
import { component$ } from "@builder.io/qwik";
|
|
116
|
+
import { loader$ } from "@builder.io/qwik-city";
|
|
117
|
+
import {
|
|
118
|
+
getBuilderSearchParams,
|
|
119
|
+
getContent,
|
|
120
|
+
RenderContent,
|
|
121
|
+
} from "@builder.io/sdk-qwik";
|
|
122
|
+
|
|
123
|
+
export const BUILDER_PUBLIC_API_KEY = "YOUR_API_KEY_GOES_HERE";
|
|
124
|
+
export const MODEL = "page";
|
|
125
|
+
|
|
126
|
+
export const builderContentLoader = loader$(({ url }) => {
|
|
127
|
+
return getContent({
|
|
128
|
+
model: MODEL,
|
|
129
|
+
apiKey: BUILDER_PUBLIC_API_KEY,
|
|
130
|
+
apiVersion: "v3",
|
|
131
|
+
options: {
|
|
132
|
+
...getBuilderSearchParams(url.searchParams),
|
|
133
|
+
cachebust: true,
|
|
134
|
+
},
|
|
135
|
+
userAttributes: {
|
|
136
|
+
urlPath: url.pathname || "/",
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
export default component$(() => {
|
|
142
|
+
const builderContent = builderContentLoader.use();
|
|
143
|
+
return (
|
|
144
|
+
<div>
|
|
145
|
+
<RenderContent
|
|
146
|
+
model={MODEL}
|
|
147
|
+
content={builderContent.value}
|
|
148
|
+
apiKey={BUILDER_PUBLIC_API_KEY}
|
|
149
|
+
apiVersion="v3"
|
|
150
|
+
/>
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Reasons to switch to API Version v3
|
|
158
|
+
|
|
159
|
+
- Better, more scalable infra: Query v3 is built on global scale infrastructure to ensure fast response times and high availability
|
|
160
|
+
- Ability to ship more features, faster: Query V3 will allow us to keep shipping the latest features to our customers without breaking fundamental flows. These will be shipped only to Query V3 and not to the older versions of the query API
|
|
161
|
+
|
|
162
|
+
_Coming soon..._
|
|
163
|
+
|
|
164
|
+
- Better support for localization: Some of the newer features of localization and querying based on it will be better supported in Query V3
|
|
165
|
+
- Support multi-level nested references: Query V3 will allow you to query, resolve, and return content that has nested references of other contents and symbols.
|
|
166
|
+
|
|
110
167
|
## Mitosis
|
|
111
168
|
|
|
112
169
|
This SDK is generated by [Mitosis](https://github.com/BuilderIO/mitosis). To see the Mitosis source-code, go [here](https://github.com/BuilderIO/builder/tree/main/packages/sdks/src).
|