@atlassian/clientside-extensions-docs 2.4.0 → 2.4.1-docs-1
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/content/server/framework/clientside-extensions/get-help.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/creating-an-extension-point.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/extension-point-documentation.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/index.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/providing-context.md +1 -1
- package/content/server/framework/clientside-extensions/guides/extension-points/rendering-extensions.md +1 -1
- package/content/server/framework/clientside-extensions/guides/how-to/debugging-and-troubleshooting-an-extension.md +1 -1
- package/content/server/framework/clientside-extensions/guides/how-to/setup-page-bootstrapper.md +1 -1
- package/content/server/framework/clientside-extensions/guides/how-to/setup-schema-loader.md +37 -65
- package/content/server/framework/clientside-extensions/guides/how-to/setup-webpack-plugin.md +2 -2
- package/content/server/framework/clientside-extensions/guides/introduction/creating-a-modal.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/creating-a-page.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/creating-an-extension.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/custom-HTML-content.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/discovering-extension-points.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/index.md +1 -1
- package/content/server/framework/clientside-extensions/guides/introduction/using-extension-api.md +1 -1
- package/content/server/framework/clientside-extensions/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-api/async-panel-api.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-api/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-api/modal-api.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-api/panel-api.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-api/render-element-as-react.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/async-panel.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/button.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/link.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/modal.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/page.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-factories/panel.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points/extension-handlers.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points/hooks-and-components.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points/schemas.md +1 -1
- package/content/server/framework/clientside-extensions/reference/api/extension-points-v1-deprecated.md +1 -1
- package/content/server/framework/clientside-extensions/reference/glossary/index.md +1 -1
- package/content/server/framework/clientside-extensions/reference/webpack-plugin/annotations.md +1 -1
- package/content/server/framework/clientside-extensions/reference/webpack-plugin/webpack-plugin.md +1 -1
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ platform: server
|
|
|
4
4
|
product: clientside-extensions
|
|
5
5
|
category: devguide
|
|
6
6
|
subcategory: how-to
|
|
7
|
-
date: '2021-
|
|
7
|
+
date: '2021-11-29'
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Setting up the CSE schema-loader
|
|
@@ -36,10 +36,16 @@ In your webpack configuration, configure the loader to match `.cse.graphql` file
|
|
|
36
36
|
|
|
37
37
|
module.exports = {
|
|
38
38
|
// your webpack config
|
|
39
|
-
entry: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
entry: {
|
|
40
|
+
/**/
|
|
41
|
+
},
|
|
42
|
+
output: {
|
|
43
|
+
/**/
|
|
44
|
+
},
|
|
45
|
+
plugins: [
|
|
46
|
+
/**/
|
|
47
|
+
],
|
|
48
|
+
// ...
|
|
43
49
|
|
|
44
50
|
module: {
|
|
45
51
|
rules: [
|
|
@@ -52,13 +58,13 @@ module.exports = {
|
|
|
52
58
|
cwd: path.resolve(__dirname, 'src', 'schemas'),
|
|
53
59
|
},
|
|
54
60
|
},
|
|
55
|
-
]
|
|
56
|
-
}
|
|
61
|
+
],
|
|
62
|
+
},
|
|
57
63
|
};
|
|
58
64
|
```
|
|
59
65
|
|
|
60
66
|
After configuring the loader, you will be able to import the [hooks and components](/server/framework/clientside-extensions/reference/api/extension-points/hooks-and-components/)
|
|
61
|
-
directly from the schema as
|
|
67
|
+
directly from the schema as follows:
|
|
62
68
|
|
|
63
69
|
`schema.cse.graphql`
|
|
64
70
|
|
|
@@ -97,7 +103,7 @@ const ExampleExtensionPoint = ({ context }) => {
|
|
|
97
103
|
|
|
98
104
|
return (
|
|
99
105
|
<>
|
|
100
|
-
{extensions.map(({attributes}) => <a href={attributes.url}>{attributes.label}</a>}
|
|
106
|
+
{extensions.map(({attributes}) => (<a href={attributes.url}>{attributes.label}</a>)}
|
|
101
107
|
</>
|
|
102
108
|
)
|
|
103
109
|
}
|
|
@@ -105,65 +111,29 @@ const ExampleExtensionPoint = ({ context }) => {
|
|
|
105
111
|
export default ExampleExtensionPoint;
|
|
106
112
|
```
|
|
107
113
|
|
|
108
|
-
## 3.
|
|
109
|
-
|
|
110
|
-
If you do not use React, there is a way to instead generate plain vanilla JavaScript code.
|
|
111
|
-
For this to happen, set the _generic_ option to `true`.
|
|
112
|
-
|
|
113
|
-
```js
|
|
114
|
-
// #webpack.config.js
|
|
115
|
-
|
|
116
|
-
module.exports = {
|
|
117
|
-
// your webpack config
|
|
118
|
-
entry: { /**/ },
|
|
119
|
-
output: {/**/},
|
|
120
|
-
plugins: [/**/],
|
|
121
|
-
...
|
|
122
|
-
|
|
123
|
-
module: {
|
|
124
|
-
rules: [
|
|
125
|
-
// Add a rule entry to the list of loaders
|
|
126
|
-
{
|
|
127
|
-
test: /\.cse.graphql$/,
|
|
128
|
-
loader: '@atlassian/clientside-extensions-schema/loader',
|
|
129
|
-
options: {
|
|
130
|
-
// You can specify a working dir
|
|
131
|
-
cwd: path.resolve(__dirname, 'src', 'schemas'),
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
// Rule to handle non-react extensions
|
|
135
|
-
{
|
|
136
|
-
test: /\.cse.generic.graphql$/,
|
|
137
|
-
loader: '@atlassian/clientside-extensions-schema/loader',
|
|
138
|
-
options: {
|
|
139
|
-
cwd: path.resolve(__dirname, 'src', 'schemas'),
|
|
140
|
-
// Enables vanilla javascript code generation
|
|
141
|
-
generic: true
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
};
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
## 4. Sharing scalars and types
|
|
114
|
+
## 3. Sharing scalars and types
|
|
150
115
|
|
|
151
116
|
CSE provides a set of default [scalars and types](/server/framework/clientside-extensions/reference/api/extension-points/schemas/#provided-scalars)
|
|
152
117
|
that you will be using very often, but there are cases where you would like to share your own types and scalars
|
|
153
118
|
between schema definitions.
|
|
154
119
|
|
|
155
|
-
To do so, you can declare files with a name like `*.type.graphql` and configure the loader to include those
|
|
156
|
-
definition for all your schemas as follow:
|
|
120
|
+
To do so, you can declare files with a name like `*.type.graphql` and configure the loader to include those definitions for all your schemas as follows:
|
|
157
121
|
|
|
158
122
|
```js
|
|
159
123
|
// #webpack.config.js
|
|
160
124
|
|
|
161
125
|
module.exports = {
|
|
162
126
|
// your webpack config
|
|
163
|
-
entry: {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
127
|
+
entry: {
|
|
128
|
+
/**/
|
|
129
|
+
},
|
|
130
|
+
output: {
|
|
131
|
+
/**/
|
|
132
|
+
},
|
|
133
|
+
plugins: [
|
|
134
|
+
/**/
|
|
135
|
+
],
|
|
136
|
+
// ...
|
|
167
137
|
|
|
168
138
|
module: {
|
|
169
139
|
rules: [
|
|
@@ -173,11 +143,11 @@ module.exports = {
|
|
|
173
143
|
options: {
|
|
174
144
|
cwd: path.resolve(__dirname, 'src', 'schemas'),
|
|
175
145
|
// configure a pattern for your own shared types
|
|
176
|
-
providedTypes: '**/*.type.graphql'
|
|
146
|
+
providedTypes: '**/*.type.graphql',
|
|
177
147
|
},
|
|
178
148
|
},
|
|
179
|
-
]
|
|
180
|
-
}
|
|
149
|
+
],
|
|
150
|
+
},
|
|
181
151
|
};
|
|
182
152
|
```
|
|
183
153
|
|
|
@@ -237,13 +207,15 @@ When using `webpack` to load your extensions with the schema-loader at `@atlassi
|
|
|
237
207
|
you need to tell your test-runner how to interpret those imports. This `jest-transformer` will do exactly this, if you
|
|
238
208
|
run your tests using jest.
|
|
239
209
|
|
|
240
|
-
To use it add the following to your `jest`config:
|
|
210
|
+
To use it, add the following entry to your Jest `jest.config.js` config file:
|
|
241
211
|
|
|
242
212
|
```js
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
213
|
+
module.exports = {
|
|
214
|
+
transform: {
|
|
215
|
+
// A custom GraphQL transformer that provides React hooks and components for CSE
|
|
216
|
+
'^.+\\.extension\\.graphql$': require.resolve('@atlassian/clientside-extensions-schema/jest-graphql-transformer.js'),
|
|
217
|
+
},
|
|
218
|
+
};
|
|
247
219
|
```
|
|
248
220
|
|
|
249
221
|
{{% note %}}
|
package/content/server/framework/clientside-extensions/guides/how-to/setup-webpack-plugin.md
CHANGED
|
@@ -4,7 +4,7 @@ platform: server
|
|
|
4
4
|
product: clientside-extensions
|
|
5
5
|
category: devguide
|
|
6
6
|
subcategory: how-to
|
|
7
|
-
date: '2021-
|
|
7
|
+
date: '2021-11-29'
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Setting up the CSE webpack plugin
|
|
@@ -181,4 +181,4 @@ npx @atlassian/wrm-troubleshooting
|
|
|
181
181
|
|
|
182
182
|
The tool will ask you a few questions and guide you if it finds issues with your projects' configuration.
|
|
183
183
|
|
|
184
|
-
You can read more about the troubleshooting tool on the [NPM page for the `@atlassian/wrm-troubleshooting` package]
|
|
184
|
+
You can read more about the troubleshooting tool on the [NPM page for the `@atlassian/wrm-troubleshooting` package](https://www.npmjs.com/package/@atlassian/wrm-troubleshooting).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlassian/clientside-extensions-docs",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1-docs-1",
|
|
4
4
|
"description": "Holds the official documentation for Altassian Server client-side extensions API.",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"homepage": "https://bitbucket.org/atlassian/atlassian-clientside-extensions#readme",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"optionalDependencies": {
|
|
80
80
|
"@atlassian/doc-scripts": "^5.0.0"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "4c98bad371a4fff8afcef318bb67ed86727fb877"
|
|
83
83
|
}
|