Skip to content

Commit

Permalink
Merge pull request #32 from ultraleap/feat/TF-1028_api-audit
Browse files Browse the repository at this point in the history
Feat/tf 1028 api audit
  • Loading branch information
Craig-J authored Sep 8, 2023
2 parents 8c86a36 + 7a932c9 commit 09d435f
Show file tree
Hide file tree
Showing 82 changed files with 2,609 additions and 3,090 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ build::bundle:
- win10
script:
# Get the TF Tooling for web version
- set -Name TF_TOOLING_API_VERSION -Value "$((Select-String -Path ".\src\TouchFreeToolingTypes.ts" "public static readonly API_VERSION. string = '(.*)';" | Select-Object * -First 1).Matches.Groups[1].Value)"
- set -Name TF_TOOLING_API_VERSION -Value "$((Select-String -Path ".\src\internal\Connection\ServiceTypes.ts" "API_VERSION. '(.*)'," | Select-Object * -First 1).Matches.Groups[1].Value)"

# Update Version.txt with latest information before packaging
- python ./Scripts/UpdateVersionFile.py --path ${CI_PROJECT_DIR}/Version.txt --swVer $TF_TFW_VERSION --apiVer $TF_TOOLING_API_VERSION --ref ${CI_COMMIT_SHORT_SHA} --branchName "$CI_COMMIT_REF_NAME"
Expand Down
51 changes: 44 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,54 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- `SVGCursor` can now be scaled to increase or decreased the size of the cursor.
- New API to reset the interaction settings to their defaults.
- `SVGCursor.SetCursorOptimise(bool)` allows control over whether the SVG cursor is rendered optimised for speed or not.
- New `TouchFree.ControlAnalyticsSession()` function that can start and stop an analytics session in the Service.
- New `TouchFree.RegisterAnalyticEvents()` and `TouchFree.UnegisterAnalyticEvents()` functions to register / unregister non-TouchFree analytic events (e.g. `pointerdown` or `touchstart`)
- New `TouchFree.IsAnalyticsActive()` that allows users to determine if there is an active session.
- Updated documentation to TSDocs and generate a markdown file detailing the public API
- New `resetInteractionConfigFileToDefault` function to reset the interaction settings.
- `SVGCursor.setCursorOptimise(bool)` allows control over whether the SVG cursor is rendered optimised for speed or not.
- New Analytics API supporting logging both TouchFree interaction events and non-TouchFree events:
- `startAnalyticsSession` and `stopAnalyticsSession` functions to start and stop an analytics session in the Service.
- `registerAnalyticEvents`, `unregisterAnalyticEvents` and `getRegisteredAnalyticEventKeys` functions to register / unregister / view registered non-TouchFree analytic events (e.g. `pointerdown` or `touchstart`).
- `isAnalyticsActive` that allows users to determine if there is an active session.
- Generated markdown files detailing the public API.
- An api report detailing the public API is now generated in `api/touchfree.api.md`.
- `DeepPartial` type was added to support situations where all properties (nested included) of a type should be optional.

### Changed

- Updated syntax throughout the library to follow [Google's TS styleguide](https://google.github.io/styleguide/tsguide.html)
- All documentation comments changed to [TSDoc](https://tsdoc.org/) format.
- Exports have been flattened into a single top level module without nested namespaces for the public API of the library and a single `internal` module below that includes all exported content for modules in the library.
- In the javascript bundle internal content is exported in the `internal` namespace.
- Content only exported via the `internal` module is not subject to semantic versioning and changes to only internal content will not be present in this changelog.
- The public API can be viewed in top level module `index` or in the generated api report `api/touchfree.api.md` on the [GitHub repo](https://github.com/ultraleap/TouchFreeWebTooling).
- Updated syntax throughout the library to follow [Google's TS styleguide](https://google.github.io/styleguide/tsguide.html). Many symbols names have changed as a result of this.
- Bundle package name changed from `TouchFree` to `touchfree` to match NPM package name.
- `ConfigurationManager` and `ConnectionManager` are no longer classes - they have been changed to modules with functions and types exported at the top level.
- `ConnectionApi` changes includes:
- `connect(Address?)` and `disconnect` to connect to connect and disconnect from the service (optionally at a different address than default).
- `isConnected` and `getCurrentServiceAddress` functions added to query the TouchFree service connection status and current address. `getDefaultServiceAddress` added to retrieve the default address.
- `setAddress` was removed as it's functionally equivalent to connect with the optional Address parameter.
- `init` was removed and internal state previously within the `ConnectionManager` was moved to the internal class `ServiceConnection`.
- `handleHandPresenceEvent` and `handleInteractionZoneEvent` were moved to internal class `ServiceConnection`.
- `ConfigurationApi` has not changed significantly.
- Several data types that were previously declared as classes are now interfaces. These changes should not be functionally impactful unless constructor for these types were are called in consuming code.
- Several now-internal types used for events have been replaced with new types for use in the public API - these changes impact several events subscribed to via `registerEventCallback` and request functions:
- `WebSocketResponse` -> `ResponseState`: General purpose response type.
- `WebSocketCallback` -> `ResponseCallback`: General purpose responses callback type for requests from the service.
- `ConfigState` -> `TouchFreeConfig`: returned by `requestConfigChange`, `requestConfigFileChange` and `resetInteractionConfigFileToDefault`.
- `ServiceStatus` -> `ServiceState`: returned by `requestServiceStatus`.
- `dispatchEvent` renamed to `dispatchEventCallback` to avoid conflict with `dispatchEvent` in base libraries.
- `EventHandle` renamed to `TouchFreeEventHandle`.

### Fixed

- All exports within the library are now relative to resolve common issues when processing source with other tools e.g. compilers/bundlers.
- Circular dependencies between modules within the library have been (mostly) eliminated.
- Fixed an issue where pending callbacks could be removed before being given any chance to be processed due to issue with expiration logic.

### Removed

- Top level `TouchFree` module was removed. `init` and `TfInitParams` has moved to the `Initialization` module and are exported in the top level module. Other functionality has been redistributed to `Cursors`, `TouchFreeEvents`, `CurrentInputController` and `ConnectionApi` modules.
- Previously deprecated or internal unused functionality has been removed.
- `InteractionConfigFull` has been removed - the base `InteractionConfig` no longer has partial fields.
- `DeepPartial` is used in situations where fields of the configuration should be optional.

## [1.4.0] - 2023-04-06

Expand Down
4 changes: 2 additions & 2 deletions Plugins/SnappingPlugin/src/SnappingPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InputActionPlugin } from '../../../src/Plugins/InputActionPlugin';
import { TouchFreeInputAction } from '../../../src/TouchFreeToolingTypes';
import { TouchFreeInputAction } from '../../../src/index';
import { InputActionPlugin } from '../../../src/internal/index';
import { SnappableElement } from './SnappableElement';
import { Vector2 } from './Vector2';

Expand Down
3 changes: 3 additions & 0 deletions api-extractor.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@
* DEFAULT VALUE: false
*/
// "addToApiReportFile": false
},
"TS2411": {
"logLevel": "none"
}

// "TS2551": {
Expand Down
Loading

0 comments on commit 09d435f

Please sign in to comment.