Skip to content
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 policy modal #1458

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/long-doors-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/ui-extensions': patch
'@shopify/ui-extensions-react': patch
---

fix policy modal handling
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ export interface PolicyModalProps {
type: PolicyType;
}

export const PolicyModal = createRemoteReactComponent('PolicyModal');
export const PolicyModal = createRemoteReactComponent<
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have honestly no idea how/why this worked before 🤔
We never combined the Component with its types. We're now passing the props so that the type is complete.

'PolicyModal',
PolicyModalProps
>('PolicyModal');
3 changes: 2 additions & 1 deletion packages/ui-extensions-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"outDir": "build/ts",
"rootDir": "src",
"jsx": "react-jsx"
"jsx": "react-jsx",
"stripInternal": true
Copy link
Member Author

@robin-drexler robin-drexler Oct 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed this when moving back to unstable. We had in internal already. https://github.com/Shopify/ui-extensions/pull/1399/files#diff-62ec3f3adce17523e1588b957e8483dbc86b81ab9b6062022b35c69880faa6b2R6

But not for the non-react package. I've also added it here. I don't think it makes sense to only strip internals for react.

},
"include": ["config/typescript/faker.d.ts", "src/**/*.ts", "src/**/*.tsx"],
"exclude": ["src/**/*.example.tsx", "src/**/tests/**"],
Expand Down
3 changes: 2 additions & 1 deletion packages/ui-extensions/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../config/typescript/tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build/ts"
"outDir": "build/ts",
"stripInternal": true
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["src/**/*.example.*", "src/**/tests/**"]
Expand Down
Loading