-
Notifications
You must be signed in to change notification settings - Fork 53
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
fix!: Remove unecessary exports, utilize core types instead of SynchroCharts #600
Conversation
What is the breaking change? |
669411b
to
7eb2962
Compare
Added to PR overview, will update commit message with a bit more detail for |
LGTM. No blockers to merge. |
@@ -26,5 +25,5 @@ export const round = (num: number): number => { | |||
/** | |||
* Checks if value can be used as a number | |||
*/ | |||
export const isNumeric = (value: ThresholdDataTypes): boolean => | |||
export const isNumeric = (value: Primitive): boolean => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason why these predicates are not written as type predicates?
expect(isMinimalStaticViewport(viewport as unknown as MinimalLiveViewport)).toBeFalse(); | ||
expect(isHistoricalViewport({ start: new Date() } as unknown as DurationViewport)).toBeFalse(); | ||
}); | ||
|
||
it('returns false when the start date is missing', () => { | ||
const viewport: Omit<MinimalStaticViewport, 'start'> = { | ||
yMin: 0, | ||
yMax: 10, | ||
end: new Date(), | ||
}; | ||
|
||
expect(isMinimalStaticViewport(viewport as unknown as MinimalLiveViewport)).toBeFalse(); | ||
expect(isHistoricalViewport({ end: new Date() } as unknown as DurationViewport)).toBeFalse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these object literals cast as unknown? Looks like a hack?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is necessary because i'm passing invalid inputs into the utility function that don't adhere to the typescript types but open to other suggestions
7eb2962
to
70fe73c
Compare
…oChart types BREAKING CHANGES: * Removed optional types yMin and yMax from Viewport type exported from @iot-app-kit/core * Updated TimeSeriesDataModule to utilize Viewport from @iot-app-kit/core instead of MinimalViewPortConfig from ‘@synchro-charts/core’ * Updated TimeSeriesDataRequest type to refer to Viewport from @iot-app-kit/core instead of @synchro-charts/core * Removed exported mock widget properties from @iot-app-kit/core * Updated viewportManager to utilize Viewport from @iot-app-kit/core instead of @synchro-charts/core * Export the data types as DATA_TYPE constant from @iot-app-kit/core, instead of as a DataType enum.
70fe73c
to
65c6942
Compare
…oChart types (#600) BREAKING CHANGES: * Removed optional types yMin and yMax from Viewport type exported from @iot-app-kit/core * Updated TimeSeriesDataModule to utilize Viewport from @iot-app-kit/core instead of MinimalViewPortConfig from ‘@synchro-charts/core’ * Updated TimeSeriesDataRequest type to refer to Viewport from @iot-app-kit/core instead of @synchro-charts/core * Removed exported mock widget properties from @iot-app-kit/core * Updated viewportManager to utilize Viewport from @iot-app-kit/core instead of @synchro-charts/core * Export the data types as DATA_TYPE constant from @iot-app-kit/core, instead of as a DataType enum.
Overview
This pull request cleans up the IoT App Kit APIs, untangling it from Synchro Charts. There is more work required to fully untangle IoT App Kit from Synchro Charts - but this PR takes major strides towards that direction.
Breaking Changes
yMin
andyMax
fromViewport
type exported from@iot-app-kit/core
TimeSeriesDataModule
to utilizeViewport
from@iot-app-kit/core
instead ofMinimalViewPortConfig
from ‘@synchro-charts/core’TimeSeriesDataRequest
type to refer toViewport
from@iot-app-kit/core
instead of@synchro-charts/core
viewportManager
to utilizeViewport
from @iot-app-kit/core instead of @synchro-charts/coreDATA_TYPE
constant from @iot-app-kit/core, instead of as aDataType
enum.Notable, non-breaking changes
DurationViewport
andHistoricalViewport
from @iot-app-kit/corePrimitive
,DataStreamid
,Timestamp
,StreamAssociation
, andDataPoint
from @iot-app-kit/coreLegal
This project is available under the Apache 2.0 License.