Skip to content

Commit 2def18a

Browse files
authored
chore: react-19 compatibility (#14)
## Background Adding support for React 19 ## Changes - [x] Update types - [x] Update rollup - [x] Update dependencies - [x] Swap yarn for npm - [x] Add Github action ## Notes @simplepdf/[email protected] was published as part of this PR
1 parent 2a83391 commit 2def18a

File tree

10 files changed

+2276
-1167
lines changed

10 files changed

+2276
-1167
lines changed

.github/workflows/react.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: React
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- react/**
9+
- .github/workflows/react.yaml
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- react/**
15+
- .github/workflows/react.yaml
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
defaults:
21+
run:
22+
working-directory: react
23+
24+
steps:
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: "22"
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
36+
- name: Test formatting
37+
run: npm run test:format
38+
39+
- name: Test types
40+
run: npm run test:types

react/.prettierignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dist/
2+
dev/
3+
4+
package-lock.json
5+
6+
.prettierignore
7+
.prettierrc
8+
.DS_Store

react/.prettierrc

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all",
4+
"bracketSpacing": true,
5+
"printWidth": 120,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"semi": true,
9+
"parser": "typescript",
10+
"overrides": [
11+
{
12+
"files": "*.scss",
13+
"options": {
14+
"parser": "scss"
15+
}
16+
},
17+
{
18+
"files": "*.json",
19+
"options": {
20+
"parser": "json"
21+
}
22+
},
23+
{
24+
"files": "*.html",
25+
"options": {
26+
"parser": "html"
27+
}
28+
},
29+
{
30+
"files": "*.md",
31+
"options": {
32+
"parser": "markdown"
33+
}
34+
}
35+
]
36+
}

react/README.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ While the component does not require any account to be used (without any limits)
5656
_Example_
5757

5858
```jsx
59-
import { EmbedPDF } from "@simplepdf/react-embed-pdf";
59+
import { EmbedPDF } from '@simplepdf/react-embed-pdf';
6060

6161
<EmbedPDF companyIdentifier="yourcompany">
62-
<a href="https://cdn.simplepdf.com/simple-pdf/assets/sample.pdf">
63-
Opens sample.pdf
64-
</a>
62+
<a href="https://cdn.simplepdf.com/simple-pdf/assets/sample.pdf">Opens sample.pdf</a>
6563
</EmbedPDF>;
6664
```
6765

@@ -111,15 +109,15 @@ import { EmbedPDF } from "@simplepdf/react-embed-pdf";
111109
Specify `react-viewer` as `companyIdentifier` to disable the editing features:
112110

113111
```jsx
114-
import { EmbedPDF } from "@simplepdf/react-embed-pdf";
112+
import { EmbedPDF } from '@simplepdf/react-embed-pdf';
115113

116114
// The PDF is displayed using the viewer: all editing features are disabled
117-
<EmbedPDF
115+
<EmbedPDF
118116
companyIdentifier="react-viewer"
119117
mode="inline"
120118
style={{ width: 900, height: 800 }}
121119
documentURL="https://cdn.simplepdf.com/simple-pdf/assets/sample.pdf"
122-
/>
120+
/>;
123121
```
124122

125123
### <a id="available-props"></a>Available props

0 commit comments

Comments
 (0)