Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release v2 #212

Merged
merged 62 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d4a423c
Refactor draft using useSplitTreatments inside SplitTreatments, useSp…
EmilianoSanchez Jul 18, 2023
a1e7939
Updated getSplitClient util to set client lastUpdate timestamp, and u…
EmilianoSanchez Jul 18, 2023
5978e58
removed unnecessary condition: (client !== contextClient || client.la…
EmilianoSanchez Jul 18, 2023
89cf14f
Merge branch 'hooks_polishing' into react_v2_functional_components
EmilianoSanchez Jul 22, 2023
56454e8
Using function as useState initial state in SplitFactory
EmilianoSanchez Jul 22, 2023
849bcb3
Merge branch 'hooks_improvements' into react_v2_functional_components
EmilianoSanchez Nov 21, 2023
e31343a
Merge pull request #200 from splitio/development
EmilianoSanchez Sep 6, 2024
2383f52
Upgrade JS SDK dependency, which includes large segments and factory …
EmilianoSanchez Sep 20, 2024
6647127
rc
EmilianoSanchez Sep 20, 2024
7d004c2
Reuse ISplitComponentProps
EmilianoSanchez Oct 1, 2024
b2df913
useMemo in SplitFactoryProvider
EmilianoSanchez Oct 1, 2024
076151b
Test refactors
EmilianoSanchez Oct 3, 2024
1511d8d
Rename build folders
EmilianoSanchez Oct 19, 2024
044c9b8
Merge pull request #201 from splitio/release_v1.14.0
EmilianoSanchez Oct 19, 2024
13fa499
Remove deprecated modules
EmilianoSanchez Oct 19, 2024
e2681cc
Rename typescript interfaces: ISplitFactoryProviderProps, ISplitFacto…
EmilianoSanchez Oct 19, 2024
88d1f25
Rename SplitSdk to SplitFactory function
EmilianoSanchez Oct 19, 2024
258b4fe
Merge branch 'rename_SplitSdk_to_SplitFactory' into react_v2_function…
EmilianoSanchez Oct 19, 2024
9b9a5ac
Update React support: >=16.8.0
EmilianoSanchez Oct 19, 2024
60a20c5
Polishing
EmilianoSanchez Oct 19, 2024
f669720
Update error handling when components are not wrapped by SplitFactory…
EmilianoSanchez Oct 21, 2024
6d65bf0
Update tests
EmilianoSanchez Oct 21, 2024
e8e0d2a
Refactor context value to use undefined rather than null for factory …
EmilianoSanchez Oct 21, 2024
f23f0a4
Upgrade JS SDK to v11, which has clients without bound traffic type
EmilianoSanchez Oct 22, 2024
4688ff0
Update changelog entry
EmilianoSanchez Oct 22, 2024
628b185
Make factory and client context properties available in first render …
EmilianoSanchez Oct 23, 2024
833d6c9
Added test to validate bugfix
EmilianoSanchez Oct 24, 2024
6bfb15b
Polishing
EmilianoSanchez Oct 24, 2024
e1bad0a
Added test to validate useTrack does not re-render
EmilianoSanchez Oct 24, 2024
e262600
Polishing
EmilianoSanchez Oct 24, 2024
fec84b3
Polishing
EmilianoSanchez Oct 24, 2024
5009c20
Merge pull request #203 from splitio/remove_deprecated_modules
EmilianoSanchez Oct 24, 2024
e633ad2
Merge pull request #204 from splitio/rename_SplitSdk_to_SplitFactory
EmilianoSanchez Oct 24, 2024
7691dd9
Merge pull request #205 from splitio/react_v2_functional_components
EmilianoSanchez Oct 24, 2024
c33577f
Merge pull request #206 from splitio/error_handling_updates
EmilianoSanchez Oct 24, 2024
2cbc1d0
Merge branch 'breaking_changes_baseline' into issue_198_factory_avail…
EmilianoSanchez Oct 24, 2024
695960b
Remove SplitClient and SplitTreatments components
EmilianoSanchez Oct 25, 2024
64a635e
Reduce SplitContext only to the factory
EmilianoSanchez Oct 25, 2024
bafcfd9
Update JS SDK to use updated Type declaration files
EmilianoSanchez Oct 25, 2024
465af41
Fix import
EmilianoSanchez Oct 25, 2024
2d1a0d0
test namespace implicit import
EmilianoSanchez Oct 26, 2024
dff8b1f
Update changelog entry
EmilianoSanchez Oct 26, 2024
2c311b9
Add TSDoc linter rules
EmilianoSanchez Oct 29, 2024
3b55de4
Merge branch 'refactor_type_definitions' into poc_react_sdk_mini
EmilianoSanchez Oct 29, 2024
d26572e
Update changelog entry
EmilianoSanchez Oct 30, 2024
eb475cd
Upgrade JS SDK
EmilianoSanchez Oct 31, 2024
54b13ca
Polishing
EmilianoSanchez Oct 31, 2024
41d960b
rollback ci-cd
EmilianoSanchez Oct 31, 2024
6a723c7
Merge pull request #213 from splitio/refactor_type_definitions
EmilianoSanchez Oct 31, 2024
3b3eabc
Merge pull request #211 from splitio/issue_198_factory_available_in_i…
EmilianoSanchez Oct 31, 2024
6a7c8db
Merge pull request #208 from splitio/clients_without_tt
EmilianoSanchez Oct 31, 2024
b9cbb48
Merge pull request #207 from splitio/refactor_null_to_undefined
EmilianoSanchez Oct 31, 2024
7445552
Polishing
EmilianoSanchez Oct 31, 2024
df99c2b
Merge branch 'breaking_changes_baseline' into remove_render_props
EmilianoSanchez Oct 31, 2024
cdd1396
Update tests
EmilianoSanchez Oct 31, 2024
a715ff4
Revert HOCs and Render Props components
EmilianoSanchez Nov 1, 2024
8521d37
Polishing
EmilianoSanchez Nov 1, 2024
de83b2f
Update changelog entry
EmilianoSanchez Nov 1, 2024
f6f44d6
rc
EmilianoSanchez Nov 1, 2024
b927510
rollback rc
EmilianoSanchez Nov 1, 2024
3e12176
stable version
EmilianoSanchez Nov 2, 2024
1e5ec3e
Merge pull request #215 from splitio/revert_hocs_and_render_props
EmilianoSanchez Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
'plugins': [
'react',
'@typescript-eslint',
'eslint-plugin-tsdoc',
'import'
],
'rules': {
Expand Down Expand Up @@ -63,5 +64,11 @@ module.exports = {
'import/no-self-import': 'error',
'import/no-default-export': 'error',
}
}, {
// Enable TSDoc rules for TypeScript files, allowing the use of JSDoc in JS files.
'files': ['**/*.ts', '**/*.tsx'],
'rules': {
'tsdoc/syntax': 'warn'
}
}]
}
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.DS_Store
/.vscode
/node_modules
/lib
/es
/cjs
/esm
/umd
/types
/coverage
Expand Down
16 changes: 16 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2.0.0 (November 1, 2024)
- Added support for targeting rules based on large segments.
- Added support for passing factory instances to the `factory` prop of the `SplitFactoryProvider` component from other SDK packages that extends the `SplitIO.IBrowserSDK` interface, such as `@splitsoftware/splitio-react-native`, `@splitsoftware/splitio-browserjs` and `@splitsoftware/browser-suite` packages.
- Updated @splitsoftware/splitio package to version 11.0.0 that includes major updates, and updated some transitive dependencies for vulnerability fixes.
- Renamed distribution folders from `/lib` to `/cjs` for CommonJS build, and `/es` to `/esm` for ECMAScript Modules build.
- Bugfixing - When the `config` prop is provided, the `SplitFactoryProvider` now makes the SDK factory and client instances available in the context immediately during the initial render, instead of waiting for the first SDK event (Related to https://github.com/splitio/react-client/issues/198). This change fixes a bug in the `useTrack` hook, which was not retrieving the client's `track` method during the initial render.
- BREAKING CHANGES:
- Updated the default value of the `updateOnSdkUpdate` and `updateOnSdkTimedout` parameters of the `useSplitClient` and `useSplitTreatments` hooks options object to `true`, to re-render on all SDK events by default. The same applies for the equivalent props in the `[with]SplitClient` and `[with]SplitTreatments` components.
- Updated error handling: using the library modules without wrapping them in a `SplitFactoryProvider` component will now throw an error instead of logging it, as the modules requires the `SplitContext` to work properly.
- Updated the `SplitFactoryProvider` component to not accept a child as a function (render prop), to avoid unnecessary re-renders when using the library hooks. Refer to ./MIGRATION-GUIDE.md for instructions on how to migrate the child as a function to a regular component.
- Removed the `core.trafficType` option from the SDK configuration object, and the `trafficType` parameter from the SDK `client()` method, `useSplitClient`, `useTrack`, `withSplitClient` and `SplitClient` component. This is because traffic types can no longer be bound to SDK clients in JavaScript SDK v11.0.0, and so the traffic type must be provided as first argument in the `track` method calls.
- Removed deprecated modules: `SplitFactory` component, `useClient`, `useTreatments` and `useManager` hooks. Refer to ./MIGRATION-GUIDE.md for instructions on how to migrate to the new alternatives.
- Renamed `SplitSdk` to `SplitFactory` function, which is the underlying Split SDK factory, i.e., `import { SplitFactory } from '@splitsoftware/splitio'`.
- Renamed TypeScript interface: `ISplitFactoryProps` to `ISplitFactoryProviderProps`.
- Dropped support for React below 16.8.0, as the library components where rewritten using the React Hooks API available in React v16.8.0 and above. This refactor simplifies code maintenance and reduces bundle size.

1.13.0 (September 6, 2024)
- Updated @splitsoftware/splitio package to version 10.28.0 that includes minor updates:
- Added `sync.requestOptions.getHeaderOverrides` configuration option to enhance SDK HTTP request Headers for Authorization Frameworks.
Expand Down
2 changes: 1 addition & 1 deletion MIGRATION-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Notable changes to consider when migrating:

- When using the `config` prop with `SplitFactoryProvider`, the `factory` and `client` properties in `SplitContext` and the `manager` property in `useSplitManager` results are `null` in the first render, until the context is updated when some event is emitted on the SDK main client (ready, ready from cache, timeout, or update, depending on the configuration of the `updateOn<Event>` props of the component). This differs from the previous behavior where `factory`, `client`, and `manager` were immediately available. Nonetheless, it is not recommended to use the `client` and `factory` properties directly as better alternatives are available. For example, use the `useTrack` and `useSplitTreatments` hooks rather than the client's `track` and `getTreatments` methods.

- Updating the `config` prop in `SplitFactoryProvider` reinitializes the SDK with the new configuration, while `SplitFactory` does not reinitialize the SDK. You should pass a reference to the configuration object (e.g., via a global variable, `useState`, or `useMemo`) rather than a new instance on each render, to avoid unnecessary reinitializations.
- Updating the `config` prop in `SplitFactoryProvider` re-initializes the SDK with the new configuration, while `SplitFactory` does not reinitialize the SDK. You should pass a reference to the configuration object (e.g., via a global variable, `useState`, or `useMemo`) rather than a new instance on each render, to avoid unnecessary re-initializations.

- Updating the `factory` prop in `SplitFactoryProvider` replaces the current SDK instance, unlike `SplitFactory` where it is ignored.

Expand Down
Loading
Loading