-
Notifications
You must be signed in to change notification settings - Fork 34
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
[map-layers] migrate map layers to itwinui 3 #1136
base: master
Are you sure you want to change the base?
Conversation
@mdastous-bentley I did a visual check against the test-viewer in this repo, everything looks fine and is interactable to me, can you double check as well? |
@@ -0,0 +1,7 @@ | |||
{ | |||
"type": "patch", |
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.
updating peers will technically be a major ver bump,
might be able to get away with minor here but that might piss off some,
if we do a major ver bump, id want to make sure we are going to the latest versions of 4.x and react to all deprecations
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.
I changed this to minor, could be keen on doing major, after running the linter I've reacted to the deprecations in appui, no other deprecations were found (aside from event.Keycode)
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.
id ant to update core and all other peer deps to the latest as well if we do a major bump
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.
we could split that into multiple prs, just need to hold off on publishing map-layers pkg until we are ready, or we do pre-releases
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.
I switched the changefile type
to major and bumped all core pkgs and other peerDeps to the latest, minus appui-react and imodel-components-react (which would require bumping up to their 5.x vers). Do we want to bump those 2? Should we also update the peerDeps to the latest as well?
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.
i would look at what that change means, im not sure how big of an update it will be for those pkgs
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.
it's quite big... some of the components used from `imodel-components-react' are marked deprecated. On top of that, these 2 packages drop support for react 17, so we have to bump up to react 18, and respectively update peer deps of React. We'll have to use new components, edit the test cases and update type definitions for some of the react hooks in the package. Probably a larger amount of effort than what this PR is about
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.
there are only 3 imports from imodel-components-react
i imagine the colorswatch components are deprecated in favor of itwinui v3 components which we should be using
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.
also now that im looking i see there was a mixup on what latest meant, i meant the latest 4.x, not latest version of appui which is 5.0, my apologies, shouldve been more clear
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.
instead of going directly to a major, we should publish a pre-release to make sure everything works, and can also look updating other peer dep majors to include in the full major release
… new unnecessary no internal disable rule
Code changes look fine to me and I also did a quick test of the widget in the test viewer. (I did have trouble adding a new map layer, but ran into the same problem on master so I'm probably doing it wrong and it's unrelated to these changes). @mdastous-bentley would be able to better confirm |
* See LICENSE.md in the project root for license terms and full copyright notice. | ||
*--------------------------------------------------------------------------------------------*/ | ||
import iTwinPlugin from "@itwin/eslint-plugin"; | ||
import reactPlugin from "eslint-plugin-react"; |
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.
shouldnt we use the itwin ui eslint plugin config?
https://github.com/iTwin/eslint-plugin/blob/main/dist/configs/ui.js
@@ -389,6 +388,7 @@ function AttachLayerPanel({ isOverlay, onLayerAttached, onHandleOutsideClick }: | |||
await MapLayerPreferences.deleteByName(source, iTwinId, iModelId); | |||
const msg = MapLayersUI.localization.getLocalizedString("mapLayers:CustomAttach.RemoveLayerDefSuccess", { layerName }); | |||
IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg)); | |||
// eslint-disable-next-line unused-imports/no-unused-vars |
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.
you could just delete err
catch {
blah
}
@@ -70,7 +68,6 @@ export const getMapFeatureInfoToolItemDef = (): ToolItemDef => | |||
}); | |||
|
|||
export class FeatureInfoUiItemsProvider implements UiItemsProvider { | |||
// eslint-disable-line deprecation/deprecation |
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.
i dont get how this resolved the deprecation
@@ -23,7 +22,7 @@ export interface TransparencyPopupButtonProps { | |||
} | |||
|
|||
/** @alpha */ | |||
// eslint-disable-next-line @typescript-eslint/naming-convention | |||
// eslint-disable-next-line @typescript-eslint/unbound-method |
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.
what is unbound?
@@ -114,7 +111,7 @@ export function SubLayersTree(props: SubLayersTreeProps) { | |||
// it selects/deselects node when checkbox is checked/unchecked and vice versa. | |||
// `useDisposable` takes care of disposing old event handler when new is created in case 'nodeLoader' has changed | |||
// `React.useCallback` is used to avoid creating new callback that creates handler on each render | |||
const eventHandler = useDisposable( | |||
const eventHandler = useOptionalDisposable( |
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.
was this due to deprecation?
@@ -249,7 +242,6 @@ export function MapLayerDroppable(props: MapLayerDroppableProps) { | |||
activeViewport={props.activeViewport} | |||
mapLayerSettings={activeLayer} | |||
onMenuItemSelection={props.onMenuItemSelected} | |||
disabled={props.disabled} |
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 the change?
@@ -1,10 +1,10 @@ | |||
import * as React from "react"; |
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 a little gross with the imports above the copyright, you could just nuke all the copyrights or turn off your formatter
@@ -105,18 +101,18 @@ | |||
"source-map-support": "^0.5.6", | |||
"ts-node": "^10.9.1", | |||
"typemoq": "^2.1.0", | |||
"typescript": "~4.6.0" | |||
"typescript": "~5.0.0" | |||
}, | |||
"peerDependencies": { | |||
"@itwin/appui-abstract": "^4.0.0", |
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.
maybe you should update the core peers to the latest?
…d TODO to remove enzyme and etc
For map-layers package:
@itwin/itwinui-react
to3.16.0
- tests have been updated to no longer use.iui-xxxx
class selectors, instead using[role="xxx"]
. Also useddata-testid
where possible.9.18.0
, and relevant peerDeps of the pkg to latest.event.Keycode
is deprecated, replaced usage withevent.key
in MapManagerSettings.SpecialKey
enums fromappui-abstract
, used string literals instead.