Skip to content

Commit 36c4ab0

Browse files
authored
chore: update changelog with breaking changes and update docs (#345)
1 parent ad4b8ac commit 36c4ab0

10 files changed

+98
-85
lines changed

CHANGELOG.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
- Fixed state tax boolean validation issues
1010
- Updated Gusto embedded-api version to the latest
1111

12+
### Breaking changes
13+
14+
Be sure to note the breaking change listed below for version 0.8.2 around component renaming and removal of the top level Flow component.
15+
1216
## 0.8.2
1317

1418
- Refactored employee flow components structure and improved organization within Employee namespace
@@ -17,6 +21,56 @@
1721
- Fixed commission Zod schema validation issues
1822
- Fixed issue with headers not being passed properly through our API client
1923

24+
### Breaking changes
25+
26+
> Note: We are pre alpha and are regularly iterating on the SDK as we learn more about our consumers and their needs which sometimes involves breaking changes. [Read more about our current versioning strategy here](./docs/04/01/versioning.md).
27+
28+
#### Rename components to remove the "Flow" naming suffix
29+
30+
The following components have been updated to remove the "Flow" naming suffix.
31+
32+
| Old name | Updated name |
33+
| ----------------------------- | ------------------------- |
34+
| `Employee.DocumentSignerFlow` | `Employee.DocumentSigner` |
35+
| `Company.LocationsFlow` | `Company.Locations` |
36+
| `Company.BankAccountFlow` | `Company.BankAccount` |
37+
| `Company.StateTaxesFlow` | `Company.StateTaxes` |
38+
| `Company.DocumentSignerFlow` | `Company.DocumentSigner` |
39+
40+
#### Removed top level Flow component and renamed flow subcomponents
41+
42+
We have removed the top level `Flow` component and have migrated the flow subcomponents to `Employee` and `Company` respectively.
43+
44+
| Old name | Updated name |
45+
| --------------------------------- | ----------------------------- |
46+
| `Flow.EmployeeOnboardingFlow` | `Employee.OnboardingFlow` |
47+
| `Flow.EmployeeSelfOnboardingFlow` | `Employee.SelfOnboardingFlow` |
48+
49+
Some examples of before/after:
50+
51+
_Before_
52+
53+
```tsx
54+
import { Flow } from '@gusto/embedded-react-sdk'
55+
56+
...
57+
58+
<Flow.EmployeeOnboardingFlow ... />
59+
<Flow.EmployeeSelfOnboardingFlow ... />
60+
61+
```
62+
63+
_After_
64+
65+
```tsx
66+
import { Employee } from '@gusto/embedded-react-sdk'
67+
68+
...
69+
70+
<Employee.OnboardingFlow ... />
71+
<Employee.SelfOnboardingFlow ... />
72+
```
73+
2074
## 0.8.1
2175

2276
- Replaced Valibot with Zod for bundle size reduction. Also included zod as a dependency
@@ -125,7 +179,9 @@ You would do the following instead::
125179
>
126180
```
127181

128-
#### DocumentSigner has been renamed to DocumentSigner
182+
#### DocumentSigner has been renamed to DocumentSignerFlow
183+
184+
> This was actually reverted in 0.8.2. If you have DocumentSigner as the component name, you can continue to use that if you are on 0.8.2 or later. Between 0.7.0 up until 0.8.2 the naming is DocumentSignerFlow
129185

130186
Where you would previously do
131187

@@ -136,7 +192,7 @@ Where you would previously do
136192
You should update the naming as follows:
137193

138194
```tsx
139-
<Employee.DocumentSigner employeeId="some-id" onEvent={() => {}} />
195+
<Employee.DocumentSignerFlow employeeId="some-id" onEvent={() => {}} />
140196
```
141197

142198
## 0.6.0

docs/03/01/authentication-1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ The most simple implementation is one where a partner has a backend service that
1212

1313
![](https://files.readme.io/161c4c0c0952486a811a18c71d959a8bd74ca4884f2fc1abe39737c988f3a05f-image.png)
1414

15-
The `<GustoApiProvider>` can receive a `baseUrl` that can be configured with the address of your backend proxy service and can also be used if necessary to pass along vendor authentication credentials.
15+
The `<GustoProvider>` can receive a `baseUrl` that can be configured with the address of your backend proxy service and can also be used if necessary to pass along vendor authentication credentials.
1616

1717
```jsx react
18-
import { GustoApiProvider } from '@gusto/embedded-react-sdk'
18+
import { GustoProvider } from '@gusto/embedded-react-sdk'
1919

2020
function App() {
21-
return <GustoApiProvider config={{ baseUrl: '/proxy-url/' }}>Your app here!</GustoApiProvider>
21+
return <GustoProvider config={{ baseUrl: '/proxy-url/' }}>Your app here!</GustoProvider>
2222
}
2323

2424
export default App

docs/03/getting-started-1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ npm i @gusto/embedded-react-sdk
1414

1515
## Configuring the API provider
1616

17-
The `GustoApiProvider` is used to configure the SDK at the application level. It must wrap the top-level component tree (typically at the root of the application) to ensure SDK components have access to the necessary configurations.
17+
The `GustoProvider` is used to configure the SDK at the application level. It must wrap the top-level component tree (typically at the root of the application) to ensure SDK components have access to the necessary configurations.
1818

1919
```jsx
20-
import { GustoApiProvider } from '@gusto/embedded-react-sdk'
20+
import { GustoProvider } from '@gusto/embedded-react-sdk'
2121

2222
function App() {
23-
return <GustoApiProvider config={{ baseUrl: '/proxy-url/' }}>...</GustoApiProvider>
23+
return <GustoProvider config={{ baseUrl: '/proxy-url/' }}>...</GustoProvider>
2424
}
2525

2626
export default App

docs/04/01/composition.md

Lines changed: 4 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import { EmployeeOnboardingFlow } from '@gusto/embedded-react-sdk';
1111

1212
function MyApp({ companyId }) {
1313
return(
14-
<GustoApiProvider
14+
<GustoProvider
1515
config={{
1616
baseUrl: `/myapp/`,
1717
}}
1818
>
1919
<EmployeeOnboardingFlow companyId={companyId} onEvent={() => {...}} />
20-
</GustoApiProvider>
20+
</GustoProvider>
2121
);
2222
}
2323
```
@@ -33,7 +33,7 @@ import { Employee } from '@gusto/embedded-react-sdk';
3333

3434
function MyApp({ employeeId, startDate }) {
3535
return(
36-
<GustoApiProvider
36+
<GustoProvider
3737
config={{
3838
baseUrl: `/myapp/`,
3939
}}
@@ -43,7 +43,7 @@ function MyApp({ employeeId, startDate }) {
4343
startDate={startDate}
4444
onEvent={() => {...}}
4545
/>
46-
</GustoApiProvider>
46+
</GustoProvider>
4747
);
4848
}
4949
```
@@ -53,46 +53,3 @@ function MyApp({ employeeId, startDate }) {
5353
Each step of the employee onboarding flow can be imported like this in isolation and used directly as needed. (For a comprehensive list of employee onboarding components available [see the Employee Onboarding documentation here](?tab=t.ueez3pueaqpd#heading=h.ojoq455ctuev)).
5454

5555
Because each step is available for direct use in isolation, it is also possible to rearrange steps, compose them with your own content, or [integrate them with your routing infrastructure as outlined here](?tab=t.kl25ghwrpy9i#heading=h.n2ha5hq6v67a). For example, we could place this compensation form inside of an existing page inline with our own components, or we could use this as a step in a different flow entirely.
56-
57-
### Further customization
58-
59-
Individual flow components can be further decomposed, modified or rearranged. Every flow component makes its individual pieces available (header, actions, content, etc). This enables developers and designers to customize the layout and order according to their needs. The following example demonstrates how to break down the `Employee.Compensation` component (from the previous section) into subcomponents, insert additional content after the header, and insert custom styles around the actions.
60-
61-
```jsx
62-
import { Employee } from '@gusto/embedded-react-sdk'
63-
64-
function MyApp({ employeeId, startDate }) {
65-
return (
66-
<GustoApiProvider
67-
config={{
68-
baseUrl: `/myapp/`,
69-
}}
70-
>
71-
<Employee.Compensation startDate={startDate} employeeId={employeeId} onEvent={() => {}}>
72-
<Employee.Compensation.Head />
73-
{/* Custom instructional message */}
74-
<p>Fill out all fields as best you can</p>
75-
<Employee.Compensation.List />
76-
<Employee.Compensation.Edit />
77-
{/* Actions wrapped in custom styling */}
78-
<div
79-
style={{
80-
borderTop: '1px solid #6C6C72',
81-
width: '100%',
82-
padding: '1rem',
83-
backgroundColor: '#F4F4F3',
84-
}}
85-
>
86-
<Employee.Compensation.Actions />
87-
</div>
88-
</Employee.Compensation>
89-
</GustoApiProvider>
90-
)
91-
}
92-
```
93-
94-
![](https://files.readme.io/b2108cbc99e8dda2b7e89fe95ea4b7dcc3ab18f4d96f36313a0be226ea6baed3-image.png)
95-
96-
The `Employee.Compensation` component can be broken out into individual subcomponents which can be rearranged or customized as needed. These subcomponents can be set as children, and provided in any order.
97-
98-
In the code sample above, we’ve provided some additional “Fill out all fields as best you can” helper text between the header and the edit form. We’ve also updated the actions to have a top border, gray background, and some more prominent actions by wrapping them in a dedicated div.

docs/04/01/event-handling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ const handleEvent = (eventType, data) => {
3737

3838
function MyApp({ companyId }) {
3939
return (
40-
<GustoApiProvider
40+
<GustoProvider
4141
config={{
4242
baseUrl: `/myapp/`,
4343
}}
4444
>
4545
<Employee.Profile companyId={companyId} employeeId={employeeId} onEvent={handleEvent} />
46-
</GustoApiProvider>
46+
</GustoProvider>
4747
)
4848
}
4949
```

docs/04/01/providing-your-own-data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function MyApp({ employeeId, startDate }) {
1818
};
1919

2020
return(
21-
<GustoApiProvider
21+
<GustoProvider
2222
config={{
2323
baseUrl: `/myapp/`,
2424
}}
@@ -29,7 +29,7 @@ function MyApp({ employeeId, startDate }) {
2929
onEvent={() => {...}}
3030
defaultValues={someApplicationData}
3131
/>
32-
</GustoApiProvider>
32+
</GustoProvider>
3333
);
3434
}
3535
```

docs/04/01/routing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ export default function App({ companyId, employeeId }: AppProps) {
279279
employeeId,
280280
});
281281
return (
282-
<GustoApiProvider
282+
<GustoProvider
283283
config={{
284284
baseUrl: `/myapp/`,
285285
}}
286286
>
287287
<RouterProvider router={router} />
288-
</GustoApiProvider>
288+
</GustoProvider>
289289
);
290290
}
291291

0 commit comments

Comments
 (0)