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 path imports #706

Merged
merged 9 commits into from
Feb 7, 2017
Merged

Fix path imports #706

merged 9 commits into from
Feb 7, 2017

Conversation

jondlm
Copy link
Contributor

@jondlm jondlm commented Feb 3, 2017

PR Checklist

  • Manually tested across supported browsers
    • Chrome
    • Firefox
    • Safari
    • IE11 (Win 7)
    • Edge (Win 10)
  • Unit tests written (common at minimum)
  • PR has one of the semver- labels
  • Two core team engineer approvals
  • One core team UX approval

@jondlm jondlm self-assigned this Feb 3, 2017
gulp/build.js Outdated

// Sorry, this is a little hard to read, it was hard for me to figure
// out :facepalm:
const exportCode = specifierType === 'ImportSpecifier' ? `
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are three kinds of imports, this covers all three of those cases and most importantly ensures there's a default export in each case.

@codecov-io
Copy link

codecov-io commented Feb 3, 2017

Codecov Report

Merging #706 into master will increase coverage by 0.03%.

@@            Coverage Diff             @@
##           master     #706      +/-   ##
==========================================
+ Coverage   91.38%   91.42%   +0.03%     
==========================================
  Files         157      157              
  Lines        2671     2671              
  Branches      739      739              
==========================================
+ Hits         2441     2442       +1     
  Misses        219      219              
+ Partials       11       10       -1
Impacted Files Coverage Δ
src/util/dom-helpers.js 93.33% <ø> (-6.67%)
src/components/Collapsible/Collapsible.jsx 79.41% <ø> (+5.88%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4164e23...346c797. Read the comment docs.

gulp/build.js Outdated

// Sorry, this is a little hard to read, it was hard for me to figure
// out :facepalm:
const exportCode = specifierType === 'ImportSpecifier' ? `
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a switch statement might make this a little more clear.

Copy link
Contributor Author

@jondlm jondlm Feb 6, 2017

Choose a reason for hiding this comment

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

I dunno, the switch is pretty ugly too:

let exportCode = '';

				switch (specifierType) {
				case 'ImportSpecifier':
					exportCode = `
import { ${exportName} } from '${specifierPath}';
export default ${exportName};
export * from '${specifierPath}';
`;
					break;
				case 'ImportDefaultSpecifier':
					exportCode = `
import def from '${specifierPath}';
export default def;
`;
					break;
				case 'ImportNamespaceSpecifier':
					exportCode = `
import * as def from '${specifierPath}';
export default def;
export * from '${specifierPath}'
`;
				}

it('should align to bottom if the bottom of the node is below the fold', () => {
// This test cannot be run anymore because `clientHeight` cannot be mutated
// and I wasn't able to figure out how to set it
it.skip('should align to bottom if the bottom of the node is below the fold', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

☝️

Copy link
Contributor

Choose a reason for hiding this comment

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

clientHeight can't be mutated in jsdom anymore? Is this from a jest update?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe so, I couldn't find an alternative either.

Copy link
Contributor

Choose a reason for hiding this comment

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

it was never a great test to begin with... i vote for delete

gulp/build.js Outdated

// Sorry, this is a little hard to read, it's effectively a switch
// statement on specifierType
const exportCode = specifierType === 'ImportSpecifier' ? `
Copy link
Contributor

Choose a reason for hiding this comment

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

i think it would be cleaner with our usual

condition
? then
: else

format, esp. if combined with https://github.com/declandewet/common-tags#stripindent

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "lucid-ui",
"version": "2.13.0",
"version": "2.13.1-path-imports.4",
Copy link
Contributor

Choose a reason for hiding this comment

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

remove?

@jondlm jondlm merged commit 3b6a9c0 into master Feb 7, 2017
@jondlm jondlm deleted the 693-path-imports branch February 7, 2017 19:14
@jondlm jondlm removed the in progress label Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants