@atlassian/clientside-extensions-docs 2.4.0-docs-1 → 2.4.1-docs-2
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/guides/how-to/debugging-and-troubleshooting-an-extension/abd-finding-web-resource.jpg +0 -0
- package/content/server/framework/clientside-extensions/guides/how-to/debugging-and-troubleshooting-an-extension.md +4 -4
- 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/package.json +2 -2
- package/content/server/framework/clientside-extensions/guides/how-to/debugging-and-troubleshooting-an-extension/asd-finding-web-resource.png +0 -0
|
Binary file
|
|
@@ -4,7 +4,7 @@ platform: server
|
|
|
4
4
|
product: clientside-extensions
|
|
5
5
|
category: devguide
|
|
6
6
|
subcategory: how-to
|
|
7
|
-
date: '
|
|
7
|
+
date: '2022-01-04'
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
# Debugging and troubleshooting an extension
|
|
@@ -55,16 +55,16 @@ If you haven't found the plugin on the list, you should try checking and inspect
|
|
|
55
55
|
|
|
56
56
|
Now that you know your plugin was loaded, you can check if the extension was loaded on the page.
|
|
57
57
|
|
|
58
|
-
1. Install the **[
|
|
58
|
+
1. Install the **[Atlassian Browser DevTools Chrome extension](https://chrome.google.com/webstore/detail/atlassian-server-devtools/ifdlelpkchpppgmhmidenfmlhdafbnke)**. Open a web browser, turn on the DevTools and select the **ABD** tab.
|
|
59
59
|
2. Navigate to the page where you should see the extension point.
|
|
60
60
|
3. If the extension point is located in a different tab, e.g. Diff tab, select this tab on the page.
|
|
61
|
-
4. Now, in the DevTools window, select the **
|
|
61
|
+
4. Now, in the DevTools window, select the **ABD** tab and choose the **WRM Inspector** option.
|
|
62
62
|
5. The **WRM inspector** allows you to see a list of all the web-resources loaded on the page. To filter the list and find a web-resource with your extension code:
|
|
63
63
|
|
|
64
64
|
- Click on the **All context** option and select the name of the extension point
|
|
65
65
|
- In the **Filter** field, type in part of your plugin name
|
|
66
66
|
|
|
67
|
-

|
|
68
68
|
|
|
69
69
|
6. If you can find your web-resource on the list, it means that your extension was configured correctly, and it can be loaded on the page.
|
|
70
70
|
|
|
@@ -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-2",
|
|
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
|
}
|