This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
[terra-application] Add subpath exports #384
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sdadn
changed the title
[terra-application] Add named exports
[terra-application] Add subpath exports
May 6, 2024
…on into add-named-exports
sycombs
approved these changes
May 8, 2024
@@ -1,7 +1,9 @@ | |||
/* eslint-disable import/no-unresolved */ |
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.
Just wondering, which import is causing the need for this? None of them are standing out to me as different from the other imports in this PR
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 both the imports
import { ApplicationIntlContext } from 'terra-application/application-intl';
import { ThemeContext } from 'terra-application/theme';
It's weird because they are working in other packages and webpack doesn't complain. If I change the name to something nonexistent like terra-application/theme-test
, webpack gives an error so the imports do seem to be working correctly. So I'm not sure why the linter is failing.
adoroshk
approved these changes
May 8, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds subpath exports (https://nodejs.org/api/packages.html#exports) to terra-application to follow better JavaScript conventions and practices. Now, terra-application can be imported a series of submodules instead of utilizing on the internal lib path. It also removes the default ApplicationBase export as that is already provided through the
application-base
submodule.Note: while this has breaking changes, it will be released in the next minor version as terra-application v2 has not been fully deployed to production yet.
before:
After:
Testing
This change was tested using:
In addition to testing these changes locally, this was also tested by installing these changes locally in a consuming project and running successfully running the jest tests and dev-site.
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
Jest started supporting subpath exports in v28, so a companion PR to upgrade Jest was also opened:
cerner/terra-toolkit#863
Thank you for contributing to Terra.
@cerner/terra