-
Notifications
You must be signed in to change notification settings - Fork 25
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
refactor(*): refactor imports, exports, and jsdocs #309
Conversation
Deploy preview for helix-ui ready! Built with commit cdcfb4e |
33b91e2
to
64f7ad1
Compare
@@ -38,70 +38,45 @@ let eslintPlugin = eslint({ | |||
], | |||
}); | |||
|
|||
// Intro/Outro placed INSIDE the applied dependency function | |||
let intro = `window.addEventListener('WebComponentsReady', function () {`; |
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.
Removed. Redundant to HelixUI.initialize()
logic.
{ | ||
input: 'src/node-entry.js', |
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.
After refactoring, node-entry.js
was providing nothing of value.
@@ -1,158 +0,0 @@ | |||
# Compatibility Notes |
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.
This file is no longer needed. More concise documentation was added to Guides > Polyfills
in the docs.
minor, | ||
patch, | ||
}; | ||
VERSION.toString = () => { return SEMVER }; // eslint-disable-line |
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.
🚨BREAKING CHANGE 🚨
HelixUI.VERSION
changed from the complex object (seen above) to a string literal (line 3 to the right).
VERSION.toString = () => { return SEMVER }; // eslint-disable-line | ||
|
||
export default { | ||
elements, |
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.
🚨BREAKING CHANGE 🚨
Rename HelixUI.elements
namespace to HelixUI.Elements
. I doubt that anybody is using this API, but we'll be sure to announce the breaking change.
@@ -0,0 +1,28 @@ | |||
export { HXAccordionElement } from './HXAccordionElement'; |
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.
- file moved from
src/helix-ui/elements.js
- simplified import paths from
./elements/<HXFileName>.js
to./<HXFileName>
@@ -1,169 +0,0 @@ | |||
import _account from './icons/account.svg'; |
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.
File moved to src/helix-ui/icons/index.js
with modified contents.
@@ -0,0 +1,169 @@ | |||
import _account from './account.svg'; |
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.
simplified import paths from ./icons/<icon>.svg
to ./<icon>.svg
import * as Elements from './elements'; | ||
export { version as VERSION } from '../../package.json'; | ||
export { default as ICONS } from './icons'; | ||
export { default as Utils } from './utils'; |
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.
Adds HelixUI.Utils.*
to generated JavaScript.
@@ -1,3 +0,0 @@ | |||
/** @module */ |
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.
Moved to src/helix-ui/util/index.js
4fd106b
to
5f8e2f9
Compare
* add documentation around `<hx-icon>` being an inline element * add Shadow Markup for HXIconElement * add Shadow Styles for HXIconElement * remove unnecessary @imports for hx-icon styles * remove unnecessary `fill-rule` attributes from SVG files * remove HXIconElement.icons property (see #309) Closes: * SURF-1244 (inconsistent button heights w/ icons) * SURF-1260 (multiple rendering of hx-icon) * SURF-1293 (JSX: `<hx-error>`) * SURF-1272 (JSX: Icons)
* add documentation around `<hx-icon>` being an inline element * add Shadow Markup for HXIconElement * add Shadow Styles for HXIconElement * remove unnecessary @imports for hx-icon styles * remove unnecessary `fill-rule` attributes from SVG files * remove HXIconElement.icons property (see #309) * update regression snapshots Closes: * SURF-1244 (inconsistent button heights w/ icons) * SURF-1260 (multiple rendering of hx-icon) * SURF-1293 (JSX: `<hx-error>`) * SURF-1272 (JSX: Icons)
* add documentation around `<hx-icon>` being an inline element * add Shadow Markup for HXIconElement * add Shadow Styles for HXIconElement * remove unnecessary @imports for hx-icon styles * remove unnecessary `fill-rule` attributes from SVG files * remove HXIconElement.icons property (see #309) * update regression snapshots Closes: * SURF-1244 (inconsistent button heights w/ icons) * SURF-1260 (multiple rendering of hx-icon) * SURF-1293 (JSX: `<hx-error>`) * SURF-1272 (JSX: Icons) * SURF-1114 (focus style of "X" in `<hx-search>`)
* add documentation around `<hx-icon>` being an inline element * add Shadow Markup for HXIconElement * add Shadow Styles for HXIconElement * remove unnecessary @imports for hx-icon styles * remove unnecessary `fill-rule` attributes from SVG files * remove HXIconElement.icons property (see #309) * update regression snapshots Closes: * SURF-1224 (inconsistent button heights w/ icons) * SURF-1260 (multiple rendering of hx-icon) * SURF-1293 (JSX: `<hx-error>`) * SURF-1272 (JSX: Icons) * SURF-1114 (focus style of "X" in `<hx-search>`)
This comment has been minimized.
This comment has been minimized.
* add documentation around `<hx-icon>` being an inline element * add Shadow Markup for HXIconElement * add Shadow Styles for HXIconElement * remove unnecessary @imports for hx-icon styles * remove unnecessary `fill-rule` attributes from SVG files * remove HXIconElement.icons property (see #309) * update regression snapshots Closes: * SURF-1224 (inconsistent button heights w/ icons) * SURF-1260 (multiple rendering of hx-icon) * SURF-1293 (JSX: `<hx-error>`) * SURF-1272 (JSX: Icons) * SURF-1114 (focus style of "X" in `<hx-search>`)
ad2558a
to
90fa31d
Compare
src/helix-ui/utils/index.js
Outdated
export default { | ||
KEYS, | ||
Position, | ||
}; |
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.
add the onScroll as well
src/helix-ui/utils/index.js
Outdated
* (because 'scroll' events do not bubble). | ||
* | ||
* The event is dispatched from the `document` object, instead of bubbling from | ||
* the oritinal element, to avoid interfering with 'scroll' event listeners |
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.
original element
* add `HelixUI.Utils` namespace * refactor utils to better adhere to ES6 module format * remove redundant `src/COMPATIBILITY.md` documentation * remove redundant initialization logic from `helix-ui.browser[.min].js` * remove unnecessary `node-entry.js` * normalize all import paths to use the Node ES6 format (no `.js` extensions) BREAKING: * rename `HelixUI.elements` namespace to `HelixUI.Elements` * convert `HelixUI.VERSION` from an object to a string literal
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.
zoom lgtm
Dev LGTM |
JIRA: n/a (2018-08-10 free friday)
LGTM's
Before
helix-ui
as a namespace to consumeelements
namespace looks more like a propertyAfter
helix-ui
as a namespace is optional. You could import individual items.elements
renamed toElements
to better communicate it as a namespace (breaking change)Utils
namespaceOption 1: import module as namespace (retain status quo)
Option 2: import module items separately