Skip to content

Instantly share code, notes, and snippets.

View web-padawan's full-sized avatar
🇺🇦
Stand with Ukraine

Serhii Kulykov web-padawan

🇺🇦
Stand with Ukraine
View GitHub Profile
┌─────────┬───────────────────────────────────────────────────────────────────────┬───────┐
│ (index) │ repository │ stars │
├─────────┼───────────────────────────────────────────────────────────────────────┼───────┤
│ 0 │ 'https://github.com/tailwindlabs/tailwindcss' │ 48059 │
│ 1 │ 'https://github.com/remix-run/react-router' │ 44238 │
│ 2 │ 'https://github.com/cypress-io/cypress' │ 34105 │
│ 3 │ 'https://github.com/vitejs/vite' │ 32711 │
│ 4 │ 'https://github.com/nolimits4web/swiper' │ 28863 │
│ 5 │ 'https://github.com/vuejs/vue-next' │ 25410 │
│ 6 │ 'https://github.com/react-hook-form/react-hook-form' │ 23613 │
@web-padawan
web-padawan / index.js
Created October 17, 2021 12:31
GitHub dependents
#!/usr/bin/env node
const cliProgress = require('cli-progress');
const gh = require('github-url-to-object');
const meow = require('meow');
const puppeteer = require('puppeteer');
const usage = `Usage
$ github-dependents <repository>
@web-padawan
web-padawan / @4tw+cypress-drag-drop+1.4.0.patch
Created January 22, 2021 13:24
patch to support Shadow DOM
diff --git a/node_modules/@4tw/cypress-drag-drop/index.js b/node_modules/@4tw/cypress-drag-drop/index.js
index efde88e..05a0733 100644
--- a/node_modules/@4tw/cypress-drag-drop/index.js
+++ b/node_modules/@4tw/cypress-drag-drop/index.js
@@ -1,7 +1,7 @@
const dataTransfer = new DataTransfer()
function isAttached(element) {
- return !!element.closest('html')
+ return element.isConnected;
const $hello = Symbol('hello');
const $world = Symbol('world');
class HelloWorld extends HTMLElement {
static get observedAttributes() {
return ['hello', 'world'];
}
set hello(hello) {
this[$hello] = hello;
const $value = Symbol('value');
class MyElement extends HTMLElement {
static get observedAttributes() {
return ['value'];
}
set value(value) {
this[$value] = value;
}

Using TypeScript definitions

Vaadin components come with TypeScript definitions helping to use web components in TypeScript views. The type definitions are d.ts files generated every time when new release is published to npm.

Support for TypeScript definitions is added in Vaadin 17. In most of cases, it does not require any changes to the code. At the same time, using proper types for the web components helps to make the client side views more reliable. Depending on the IDE you use, TypeScript definitions can also give additional benefits like better code completion and auto import.

If you are using Visual Studio Code, we recommend to install

@web-padawan
web-padawan / RFC: Buildless.md
Last active January 29, 2021 22:52
RFC: fight for simplicity with regards to Open Web Components project future

Goal

  1. Help the adoption of Going Buildless by frontend developers, regardless of frameworks or libraries they use.

  2. Make the most valuable tools related to Going Buildless easy to discover, use and contribute to.

Overview

@open-wc has become an umbrella project which consists of lots of parts mixed in the same repo and docs site:

What?

Testing Polymer 2 web components against headless browsers: Chrome and Firefox.

Why ?

  • name: Guake
  • window: full-width top of the screen
  • screen: main screen
  • space: all spaces
  • columns: 80
  • rows: 50
  • hotkeys: a hotkey opens a dedicated window with this profile