Repository navigation
feat(angular, react, vue): export additional core APIs #31864
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
Changes from all commits
799d9d0
ecbe59d
a5e1573
339481b
e6c1615
ee694a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| <ul> | ||
| <li>Keyboard Height: <span id="keyboard-height">{{ keyboardHeight }}</span></li> | ||
| <li>Core Exports Loaded: <span id="core-exports-loaded">{{ coreExportsLoaded }}</span></li> | ||
| </ul> | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import { componentOnReady, getMode, menuController, setNonce } from '@ionic/react'; | ||
| import type { OverlayEventDetail, RangeValue, SelectInterface } from '@ionic/react'; | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| describe('core exports', () => { | ||
| it('should export the core utilities', () => { | ||
| expect(getMode).toEqual(expect.any(Function)); | ||
| expect(componentOnReady).toEqual(expect.any(Function)); | ||
| expect(menuController.open).toEqual(expect.any(Function)); | ||
| expect(setNonce).toEqual(expect.any(Function)); | ||
| }); | ||
|
|
||
| it('should export the core types', () => { | ||
| /* The app build type checks this file, so it fails if one of these types is no longer exported. */ | ||
| const detail: OverlayEventDetail<string> = { data: 'saved', role: 'confirm' }; | ||
| const value: RangeValue = { lower: 10, upper: 50 }; | ||
| const selectInterface: SelectInterface = 'popover'; | ||
|
|
||
| expect(detail.role).toBe('confirm'); | ||
| expect(value).toEqual({ lower: 10, upper: 50 }); | ||
| expect(selectInterface).toBe('popover'); | ||
| }); | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import type { OverlayEventDetail, RangeValue, SelectInterface } from "./index"; | ||
|
|
||
| export type CoreTypeExports = [OverlayEventDetail, RangeValue, SelectInterface]; | ||
|
Comment on lines
+1
to
+3
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since typescript({ exclude: ['**/*.type-test.ts'] }),The pattern resolves from
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! Added your exclude in 339481b. The file is no longer in |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { componentOnReady, getMode, menuController, setNonce } from '@ionic/vue'; | ||
|
ShaneK marked this conversation as resolved.
Resolved
|
||
|
|
||
| describe('core exports', () => { | ||
| it('should export the core utilities', () => { | ||
| expect(getMode).toEqual(expect.any(Function)); | ||
| expect(componentOnReady).toEqual(expect.any(Function)); | ||
| expect(menuController.open).toEqual(expect.any(Function)); | ||
| expect(setNonce).toEqual(expect.any(Function)); | ||
| }); | ||
| }); | ||
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.
Nothing in CI fails if one of these exports is dropped from
@ionic/angularor@ionic/angular/standalone.verify-exports.jsonly checks the per-component entries inpackage.json, and the Angular test app doesn't import any of them.The Angular docs examples will import
OverlayEventDetailand the rest from here too, so please add a usage ofcomponentOnReady,setNonce,OverlayEventDetail,RangeValueandSelectInterfaceto the test app, once understandaloneand once underlazy. That way a removed export fails CI, the same way the Vue type-test file does.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.
Good call! Added the five exports to the
providerspages in bothlazyandstandalonein e6c1615, with a spec for each. Removing any of them now fails the test app build.