Code Monkey home page Code Monkey logo

reflect-stencil's Introduction

Built With Stencil

Stencil Assignment

Passion

Stencil is a really nice tool for building and maintaining of web components.

Pretty impressed how fast it can be learned as well as how many integrations it has.

Also I find fascinating Shadow DOM feature, which makes you components fully isolated (HTML, JavaScript, CSS) and accessible only through documented public methods.

Added form animation on successful submit.

Assignment

  • the form should be unaware of the component's multiple separate input fields, the input should be accessible as a single, combined value.
  • the form should only be submittable when the combined value passes a self-chosen pattern / validation.
  • basic input behaviour / state should apply (e.g. disabled, required).

Getting Started

To run the task for development, run:

npm install
npm start

To build the components for tests and production, run:

npm run build

To run the unit tests for the components, run:

npm test

Notes

Estimation of working hours

Most of the time I spent for learning how to develop with Stencil and related challenges.

  • Read Stencil documentation - 1h
  • Implement From and Input components - 2h
  • Implement Styling - 1h
  • Add Unit and E2E tests - 1h
  • Fixing bugs and other challenges - 1h

Attention points

  • Component documentation
  • Components and classes namings
  • Components are fully isolated using Shadow DOM
  • Styles are constructed with Sass and easy adjustable using variables

Improvements

  • From the UX perspective in my opinion better:
    • Submit button should be always active
    • Validation happens on submit
    • Better performance - validation happens once instead of per every keypress
    • On Submit click with invalid inputs:
      • focus on first invalid input
      • show validation captions per every input
  • Add CSS cross-browser compatibility (e.g. with Webpack plugins)

Challenges / Todo's

  • Investigate why globalStyles are not applied in stencil.config.js (used index.html inline styles instead)
  • Investigate how to get node with Input invalid class: expect(inputName).toHaveClass(':invalid') in reflect-input.e2e.ts

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.