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

feat: leverage "exports" field in package.json #776

Merged
merged 1 commit into from
Jul 17, 2020
Merged

Conversation

Westbrook
Copy link
Contributor

Description

CDNs like https://jspm.org/ generally rely on statistical analysis to decide what parts of a package to deploy to their servers. This works best when there is a large number (which we don't have) of uniform usages, but even with this, things like sp-*.js being very similar to sp-* across various build settings can lead to only some of the artifacts of a package being served. This PR expands our package.json files to support the exports field so that we can tell these sorts of tools what files we export explicitly so as to overcome our early low usage rate and any compatibility issues that might arise later of users leveraging file extension or not.

Motivation and Context

Easier end-user implementation.

How Has This Been Tested?

Previously:
https://jspm.dev/npm:@spectrum-web-components/icon@0.4/lib/spectrum-icon-checkmark-medium.css.js

Now (canary release):
https://jspm.dev/npm:@spectrum-web-components/icon@0.4.9-alpha.38/src/spectrum-icon-checkmark-medium.css.js

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Collaborator

@andrewhatran andrewhatran left a comment

Choose a reason for hiding this comment

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

Looks good to me! The usage-based constraint of jspm is very interesting 🤔

@Westbrook Westbrook merged commit 321abd7 into main Jul 17, 2020
@Westbrook Westbrook deleted the westbrook/exports branch July 17, 2020 18:03
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants