Giter VIP home page Giter VIP logo

ebay / ebayui-core Goto Github PK

View Code? Open in Web Editor NEW
209.0 29.0 97.0 148.53 MB

Collection of Marko widgets; considered to be the core building blocks for all eBay components, pages & apps

Home Page: https://ebay.github.io/ebayui-core/

License: Other

JavaScript 4.86% Marko 6.69% Less 0.04% Shell 0.01% CSS 0.01% HTML 8.44% TypeScript 79.96%
ebay-components html accessibility marko components a11y nodejs javascript marko-widgets ebay

ebayui-core's Issues

BUG: transform does not walk the tree of all nested tags

Currently the transform expects direct nested tags, and does not allow any other Marko tags.

For example, the <ebay-select> expects a direct nested tag <ebay-select-option>, and if you add any control tags, like <if()> or <for()>, you will break rendering.

The fix is to walk the entire tree of children tags and apply the transform to any tag that matches, regardless of whether the nested tag is an immediate child of the tag.

Build: Rename build script to make clear it's optimized for CI machine only

The build script makes some assumptions about it's env and leaves the env in a v4 state. So running this script back to back locally causes an error (because it assume v3 state). This is because it's optimized for CI machine, not local. Let's rename the script to make this obvious. I propose cibuild or cijob or the like.

Related to: #52

Scoped CSS capabilities per-component

The current Skin scoped CSS does not provide scoping for individual components which are used from the eBayUI Core library. It only provides scoping when Skin is used in isolation (no eBayUI components).

Therefore, we need to provide a way to scope the individual components when they are used within a project.

Some ideas:

  1. Allow a specifically scoped .ds6 version of the Skin css within each component
  2. Create a special scoped class on the main container when a certain flag is encountered
  3. Use ARC to provide a wholly separate component path
  4. Copy the corresponding Skin module CSS into a local LESS file for each component

Please let me know if any of you have questions about the reasons, and please chime in if you have an idea about possible solutions.

New Component: Icon

Placeholder issue created. More details to follow....

(basically a carbon copy of ebayui-image I think)

Bug: Carousel Memory Leak

Bug Report

Details

Currently the carousel component is attaching a resize event to the window object that is not being cleaned up when the component is removed which will slowly leak memory.

Possible Fix

#10

New Component: Tooltip

https://ebay.invisionapp.com/share/CWN9X1JF6MA#/screens/299234476

Some additional thoughts:

  • The component should allow the application to suggest a position to open the tooltip, but use JS to override that in order to keep the tooltip on page.
  • A11y guidelines:
  • Based on my implementation of tourtips in the past
    • It looks bad if there are many tourtips open on the page at the same time. They can even overlap each other. It would be good to add some management to prevent this.
    • Tourtips usually only show up once and then the user never sees them again (using local storage). We could create this functionality to prevent applications from having to duplicate it. Applications will probably also want ways to reset the timeout period.

Unnecessarily transforming nested tag syntax

The nested tag transformer is a bit aggressive and renames all nested tags, even if they are already using Marko's nested tag syntax.

<ebay-menu>
    <ebay-menu:item>Item</ebay-menu:item>
</ebay-menu>

becomes:

<ebay-menu>
    <ebay:menu:item>Item</ebay:menu:item>
</ebay-menu>

Honestly, probably not much of an issue once #11 and #13 are fixed, but ran into this trying to work around those issues.

Bug: Error when rendering empty listbox.

Bug Report

Details

Currently when the <ebay-listbox> is rendered without any options there is an error thrown from here.

Possible Fix

We should either update the component to support having no selected option (currently tries to select the default), or provide a better error message to users.

Notes

If the listbox will support having no options then we should also support a placeholder attribute or come up with something to display in that case.

Tests: Improve integration and v4 testing

Porting over some notes from the old repo:

  • Improve cleanup in failure case
  • Use npm pack
  • Verify no errors in browser console
  • Move main functionality to standalone package
  • Investigate improvements to Marko to allow multiple versions to be installed at the same time
  • Improve local debugging of testing against v4

Marko 4 unrecognized tag thrown for nested tag transformers

When using a component that has nested tags that are created using the nested tag transformer (like <ebay-menu-item> rather than <ebay-menu:item>, Marko 4 will throw an error during the parse stage (which occurs before the transform stage) saying it found an unrecognized tag.

Solution:
Add an empty tag definition for all valid nested tags:

{
    "<ebay-menu-item>": {}
}

Docs: show secondary button instead of raw button by default

Looks better if we show the secondary button instead of the raw button:

screen shot 2018-03-08 at 11 19 56 am

Also tempted for us to make secondary the default instead of raw. Raw button has practical aspects for people consuming skin directly (horrible imagery there!) - but perhaps not so useful in ebayui.

Polyfill strategy

Bug Report

Details

Currently in IE there are two runtime features being used that are not polyfilled.

  1. Array.prototype.find (https://github.com/eBay/ebayui-core/blob/0.1.0/src/components/ebay-select/index.js#L31)
  2. Promise (used by Marko internally).

Possible Fix

  1. We should probably just avoid Array methods added post IE9 (moved to #50).
  2. I'm not sure if it was intended for Promise to sneak into the Marko codebase, @mlrawlings what are your thoughts? For now we could just include a promise polyfill with this library, or at least recommend a polyfill.

Tests: run all tests against Marko v4

All tests (server and browser) should ideally run against both v3 and v4. We may want to limit the v4 testing to CI (like with the integration suite), since it modifies dependencies.

Build: allow local demo to optionally run on transpiled dist code

So that we can catch and fix bugs in all browsers, we need to be running the transpiled dist code in our local demo.

Running yarn start should add a transpile step to it's pipeline, and local demo should have capability to be running on the transpiled code in dist.

Related to: #59

Components with nested transform tags don't work outside demos

The marko.json that specifies the nested tag transformer is only scoped to the demo and test components.

Any outside user of the components will not have their nested tags transformed:

ebay_listbox_tag({
        name: "name"
      }, out, 0, function renderBody(out, ebay_listbox0) {
      out.w("<ebay-listbox-option value=\"1\" label=\"Option 1\"></ebay-listbox-option><ebay-listbox-option value=\"2\" label=\"Option 2\" selected></ebay-listbox-option><ebay-listbox-option value=\"3\" label=\"Option 3\"></ebay-listbox-option>");
    });

Docs: listbox/select README consistency.

There are currently some inconsistencies with the ebay-listbox components README.md vs the other components:

  1. Headings contain code blocks.
  2. "Examples" used instead of "Usage".
  3. Headings prefixed with component name.

I'm not sure which format works best but I do believe we should make these consistent.


ebay-listbox readme
screen shot 2018-03-08 at 9 51 28 am

ebay-button readme
screen shot 2018-03-08 at 9 52 22 am

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.