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: use 'ably' as import path from react-hooks #1509

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

owenpearson
Copy link
Member

@owenpearson owenpearson commented Nov 20, 2023

Resolves #1495

The import paths here only worked before by accident - tsc would compile then to from '../../../ably' which in most cases would resolve to node_modules/ably however in certain environments (pnpm) this would not be the case and therefore the types would not be imported correctly. I've updated the tsconfig compilerOptions.paths field so that these are resolved correctly for development, and when consumed as a library these will just import directly from the 'ably' module.

@github-actions github-actions bot temporarily deployed to staging/pull/1509/features November 20, 2023 12:22 Inactive
@owenpearson owenpearson force-pushed the fix-react-hooks-ably-import branch from bd66801 to 77b50ea Compare November 20, 2023 12:28
@github-actions github-actions bot temporarily deployed to staging/pull/1509/features November 20, 2023 12:28 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1509/typedoc November 20, 2023 12:29 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/1509/bundle-report November 20, 2023 12:29 Inactive
The import paths here only worked before by accident - tsc would compile
then to `from '../../../ably'` which in most cases would resolve to
`node_modules/ably` however in certain environments (pnpm) this would
not be the case and therefore the types would not be imported correctly.
I've updated the tsconfig compilerOptions.paths field so that these are
resolved correctly for development, and when consumed as a library these
will just import directly from the 'ably' module.
Copy link
Collaborator

@ttypic ttypic left a comment

Choose a reason for hiding this comment

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

LGTM!

@owenpearson owenpearson merged commit c3c09dd into main Nov 20, 2023
11 checks passed
@owenpearson owenpearson deleted the fix-react-hooks-ably-import branch November 20, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Cannot find module '../../../../../ably.js'
2 participants