GithubHelp home page GithubHelp logo

sashafirsov / css-chain-test Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.42 MB

test for ApiChain, a collection which simulates the item API with chain-able methods inspired by jQuery, xml4jQuery, eorroe/NodeList.js

License: Apache License 2.0

JavaScript 37.65% HTML 56.25% Shell 0.33% CSS 1.76% TypeScript 4.02%

css-chain-test's People

Contributors

dependabot[bot] avatar sashafirsov avatar

Watchers

 avatar

css-chain-test's Issues

slot(name) api

slots(name)

returns assignedNodes as substitution for

const slotContent = this.$('slot')[0].assignedNodes()[0].textContent;

slots(name,value)

as alias to slots(name) .innerHTML=value

implementation thoughts

API Initialization Performance

CssChain is serving css query which could return any html element including custom elements (Web Components) in NodeSet. It means the API should cover all of them. In general it is possible as HTML elements are known and custom elements are available from registry. It looks impractical to initialize the API on each CssChain() call, not to mention on each chain operations CssChain().a().b(). Instead the united API could be preserved in CssChain prototype.

API prototype life cycle

potential options:

  • module load - initial pre-population for standard HTML elements, not all custom elements are loaded
  • dom loaded event - as lazy load option
  • worker thread - immediately upon module loaded, the web components registry most likely is not available
  • each instantiation - going over 1st element prototype chain and skipping already applied and each object member. The 1st element is taken in assumption that result set comprise similar( with identical members) objects.

The last option should be efficient overall as applied API during module load would not need the merge again as the following calls with same object types.

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.