Skip to content

Commit

Permalink
Merge pull request #213 from splitio/refactor_type_definitions
Browse files Browse the repository at this point in the history
Polishing: upgrade JS SDK, add TSDoc linter
  • Loading branch information
EmilianoSanchez authored Oct 31, 2024
2 parents 2cbc1d0 + 41d960b commit 6a723c7
Show file tree
Hide file tree
Showing 9 changed files with 215 additions and 58 deletions.
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'
}
}]
}
9 changes: 5 additions & 4 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
2.0.0 (October XX, 2024)
- Added support for targeting rules based on large segments for browsers.
2.0.0 (November XX, 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.
- 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 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.
- Removed the `core.trafficType` configuration option and the `trafficType` parameter from the SDK `client()` method, `useSplitClient`, `useTrack`, 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, and `withSplitFactory`, `withSplitClient` and `withSplitTreatments` high-order components. Refer to ./MIGRATION-GUIDE.md for instructions on how to migrate to the new alternatives.
- Renamed TypeScript interfaces `ISplitFactoryProps` to `ISplitFactoryProviderProps`, and `ISplitFactoryChildProps` to `ISplitFactoryProviderChildProps`.
- Renamed some TypeScript interfaces: `ISplitFactoryProps` to `ISplitFactoryProviderProps`, and `ISplitFactoryChildProps` to `ISplitFactoryProviderChildProps`.
- Renamed `SplitSdk` to `SplitFactory` function, which is the underlying Split SDK factory, i.e., `import { SplitFactory } from '@splitsoftware/splitio'`.
- 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.

Expand Down
Loading

0 comments on commit 6a723c7

Please sign in to comment.