open-source JavaScript library of Web Components
Polymer library - Polymer Project
The Polymer library uses the latest web technologies to let you create custom HTML elements.
polymer-project.org →Link to the official site · 11,968 chars · not written by Vinony
If you're starting a new project, we recommend that you consider using LitElement instead. If you have a project you've built with an earlier version of the Polymer library, we recommend that you migrate to 3.0 for best compatibility with the JavaScript ecosystem. Thanks to the interoperability of Web Components, elements built with Polymer 3.0 and LitElement can be mixed and matched in the same app, so once you have updated your project to Polymer 3.0, you can migrate to LitElement incrementally, one element at a time. See our blog post on the Polymer Project roadmap for more information. Polymer lets you build encapsulated, reusable Web Components that work just like standard HTML elements, to use in building web applications. Using a Web Component built with Polymer is as simple as importing its definition then using it like any other HTML element: Web Components are now implemented natively on Safari and Chrome (~70% of installed browsers), and run well on Firefox, Edge, and IE11 using polyfills. Read more below. You can also save this HTML file to a local file and run it in any browser that supports JavaScript Modules). 1. Create an element by extending PolymerElement and calling customElements.define with your class (see the examples below). 1. Run the development server and open a browser pointing to its URL: Polymer 3.0 is published on npm using JavaScript Modules. This means it can take advantage of the standard native JavaScript module loader available in all current major browsers. However, since Polymer uses npm conventions to reference dependencies by name, a light transform to rewrite specifiers to URLs is required to run in the browser. The polymer-cli's development server polymer serve , as well as polymer build (for building an optimized app for deployment) automatically handles this transform. Tools like webpack and Rollup can also be used to serve and/or bundle Polymer elements. 1. Create a class that extends PolymerElement . 1. Implement a static properties getter that describes the element's public property/attribute API (these automatically become observed attributes). 1. Then implement a template getter that returns an HTMLTemplateElement describing the element's rendering, including encapsulated styling and any property bindings. Web components are an incredibly powerful new set of primitives baked into the web platform, and open up a whole new world of possibility when it comes to componentizing front-end code and easily creating powerful, immersive, app-like experiences on the web. Polymer is a lightweight library built on top of the web standards-based Web Components APIs, and makes it easier to build your very own custom HTML elements. Creating reusable custom elements - and using elements built by others - can make building complex web applications easier and more efficient. Among many ways to leverage custom elements, they can be particularly useful for building reusable UI components. Instead of continually re-building a specific navigation bar or button in different frameworks and for different projects, you can define this element once using Polymer, and then reuse it throughout your project or in any future project. Polymer provides a declarative syntax to easily create your own custom elements, using all standard web technologies - define the structure of the element with HTML, style it with CSS, and add interactions to the element with JavaScript. 1. When properties in the model for an element get updated, the element can update itself in response. 2. When the element is updated internally, the changes can be propagated back to the model. Polymer is designed to be flexible, lightweight, and close to the web platform - the library doesn't invent complex new abstractions and magic, but uses the best features of the web platform in straightforward ways to simply sugar the creation of custom elements. However, the polymer-modulizer tool automates the vast majority of this migrat
Excerpt from the source-code README · 9,494 chars · not written by Vinony
via Wikidata · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).