Re-arrange common.ts and React specific exports
Acceptance Criteria:
-Move Margins out of common.ts into a new types.ts
-Any Props (e.g. GoabTabsProps, GoabTableProps, etc), move them out of common.ts into their corresponding tsx components if not already there
-replace existing Margins import statements to import from "common/types.ts";
-update index.ts to export common/types.ts
When creating a new React app, 2. We want to be able to build without @abgov/ui-components-common in package.json 3. Import only from the @abgov/react-components
Desired Result
After the above changes, it eliminates the dependency on "@abgov/ui-components-common"
and all you need is import "@abgov/react-components"
@syedszeeshan In future could you please add acceptance criteria to the issue?
@Spark450 @ArakTaiRoth I mentioned this in our daily standup, but I think I should have mentioned it somewhere in this new user story also, that it is a continuation/improvement of #2389
Vanessa, Chris and I discussed and we decided to do the changes that you see in the new PR #2484 ..... but since US 2389 was already merged and closed, I created this new US for myself, just for tracking purpose. I could have made these changes without creating a new US also.
I have updated the Acceptance criteria.
Okay, thanks @syedszeeshan !
QA Testing
In ui-components/playground/react there is intellisense to import types:
In a separate react project there is no intellisense to import types, although Quick Fix > import works:
However, in that separate project if we install "@abgov/ui-components-common" then intellisense comes along with that:
@syedszeeshan we had discussion about a workaround without needing intellisense in VSCode is to use Quick fix the import the type. But, in my opinion this shouldn't be needed.
As discussed in the Dev meeting:
I think the PR does the job as outlined in the acceptance criteria. I will let the team decide on whether this VSCode specific issue is a blocker for this PR.
Below is a quick overview, for future reference
WebStorm 1-manually importing the type works 2-Hover mouse on the missing reference, and click "Insert import" works 3-The keyboard shortcut "Alt+Shift+Enter" also works fine (which is like the equivalent of Ctrl+Space in VSCode)
VSCode 1-manual import works 2-Hover Mouse on the missing reference, and click on "Quick Fix" works 3-For the shortcut "Ctrl+Space", the VSCode intellisense does not give suggestions for some of the types like 'GoabInputOnChangeDetail' but it does work for types like 'GoabFormItem'
Found a way to get intellisense to work like it used to: https://github.com/GovAlta/ui-components/pull/2484#pullrequestreview-2777077691
Closing, as this story is no longer needed