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(overlay): use esm build from popper and point through to types #996

Merged
merged 1 commit into from Nov 19, 2020

Conversation

Westbrook
Copy link
Collaborator

Description

Move to the ESM build from Popper so as to remove the need to process.env workarounds in no build contexts.

I wish that floating-ui/floating-ui#1188 and floating-ui/floating-ui#1188 and floating-ui/floating-ui#933 would have gotten us a better solution. Needing to use an off main entry point build while hand managing the connectivity to the types is not my favorite thing in the world.

Related Issue

refs 963

Motivation and Context

process.env should be removed from production facing code.

How Has This Been Tested?

Works locally and in CI

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

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.

@@ -13,17 +13,19 @@ governing permissions and limitations under the License.
// Bundle only what we want from popper
// See: https://popper.js.org/docs#popper-lite-tree-shaking

// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="../local.d.ts" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the weirdest part. Even though I could get this to connect via yarn tsc --build packages/overlay/tsconfig.json without this reference, I could never get yarn tsc --build packages/*/tsconfig.json, our standard usage, to work without this... 😞

Copy link
Collaborator

@cuberoot cuberoot left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for this. I tried to use the esm build, but my typescript-fu was not as strong as yours. I wasn't able to get the types to work. It's good to get rid of the Env.debug hack.

@Westbrook Westbrook merged commit 1b216cb into next Nov 19, 2020
@Westbrook Westbrook deleted the westbrook/popper branch November 19, 2020 01:48
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.

None yet

2 participants