@stencil/core 2.12.0 → 2.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/readme.md CHANGED
@@ -1,34 +1,56 @@
1
- [![npm][npm-badge]][npm-badge-url]
2
- [![Build & Test](https://github.com/ionic-team/stencil/workflows/Build%20&%20Test/badge.svg)](https://github.com/ionic-team/stencil/actions)
3
- [![license][npm-license]][npm-license-url]
4
-
5
-
6
- # Stencil: A Compiler for Web Components and PWAs
7
-
8
- ```bash
9
- npm init stencil
10
- ```
11
-
12
- [Stencil](https://stenciljs.com/) is a simple compiler for generating Web Components and static site generated progressive web apps (PWA). Stencil was built by the [Ionic](http://ionic.io/) team for its next generation of performant mobile and desktop Web Components.
13
-
14
- Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. It takes TypeScript, JSX, an asynchronous rendering pipeline to ensure smooth running animations, lazy-loading out of the box, and generates 100% standards-based Web Components that run on both [modern browsers and legacy browsers](https://stenciljs.com/docs/browser-support).
1
+ <p align="center">
2
+ <a href="#">
3
+ <img alt="stencil-logo" src="https://github.com/ionic-team/stencil/blob/main/stencil-logo.png" width="60">
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">
8
+ Stencil
9
+ </h1>
10
+
11
+ <p align="center">
12
+ A compiler for generating <a href="https://www.webcomponents.org/introduction">Web Components</a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/@stencil/core">
17
+ <img src="https://img.shields.io/npm/v/@stencil/core.svg" alt="StencilJS is released under the MIT license." /></a>
18
+ <a href="https://github.com/ionic-team/stencil/blob/main/LICENSE.md">
19
+ <img src="https://img.shields.io/badge/license-MIT-yellow.svg" alt="StencilJS is released under the MIT license." />
20
+ </a>
21
+ <a href="https://github.com/ionic-team/stencil/blob/main/.github/CONTRIBUTING.md">
22
+ <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs welcome!" />
23
+ </a>
24
+ <a href="https://twitter.com/stenciljs">
25
+ <img src="https://img.shields.io/twitter/follow/stenciljs.svg?label=Follow%20@stenciljs" alt="Follow @stenciljs">
26
+ </a>
27
+ </p>
28
+
29
+ <h2 align="center">
30
+ <a href="https://stenciljs.com/docs/getting-started#starting-a-new-project">Quick Start</a>
31
+ <span> · </span>
32
+ <a href="https://stenciljs.com/docs/introduction">Documentation</a>
33
+ <span> · </span>
34
+ <a href="https://github.com/ionic-team/stencil/blob/main/.github/CONTRIBUTING.md">Contribute</a>
35
+ <span> · </span>
36
+ <a href="https://ionicframework.com/blog/tag/stencil/">Blog</a>
37
+ <br />
38
+ Community:
39
+ <a href="https://stencil-worldwide.herokuapp.com">Slack</a>
40
+ <span> · </span>
41
+ <a href="https://forum.ionicframework.com/c/stencil/21/">Forums</a>
42
+ <span> · </span>
43
+ <a href="https://twitter.com/stenciljs">Twitter</a>
44
+ </h2>
45
+
46
+ [Stencil](https://stenciljs.com/) is a simple compiler for generating Web Components and static site generated progressive web apps (PWA). Stencil was built by the [Ionic](https://ionic.io/) team for its next generation of performant mobile and desktop Web Components.
47
+
48
+ Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. It combines TypeScript, JSX, an asynchronous rendering pipeline to ensure smooth running animations and lazy-loading, to generate 100% standards-based Web Components that run on both [modern browsers and legacy browsers](https://stenciljs.com/docs/browser-support).
15
49
 
16
50
  Stencil components are just Web Components, so they work in any major framework or with no framework at all. In many cases, Stencil can be used as a drop in replacement for traditional frontend frameworks given the capabilities now available in the browser, though using it as such is certainly not required.
17
51
 
18
52
  Stencil also enables a number of key capabilities on top of Web Components, in particular Server Side Rendering (SSR) without the need to run a headless browser, pre-rendering, and objects-as-properties (instead of just strings).
19
53
 
20
- *Note: Stencil and [Ionic Framework](https://ionicframework.com/) are completely independent projects. Stencil does not prescribe any specific UI framework, but Ionic Framework is the largest user of Stencil (today!)*
21
-
22
-
23
- ## Why Stencil?
24
-
25
- Stencil is a new approach to a popular idea: building fast and feature-rich apps in the browser. Stencil was created to take advantage of major new capabilities available natively in the browser, such as Custom Elements v1, enabling developers to ship far less code and build faster apps that are compatible with any and all frameworks.
26
-
27
- Stencil is also a solution to organizations and library authors struggling to build reusable components across a diverse spectrum of frontend frameworks, each with their own component system. Stencil components work in React, Vue, Angular and Ember, as well as they work with jQuery or with no framework at all, because they are just plain HTML elements.
28
-
29
- Compared to using Custom Elements directly, inside of every Stencil component is an efficient JSX rendering system, asynchronous rendering pipeline to prevent jank, and more. This makes Stencil components more performant while maintaining full compatibility with plain Custom Elements. Think of Stencil as creating pre-baked Custom Elements as if you wrote in those features yourself.
30
-
31
-
32
54
  ## Getting Started
33
55
 
34
56
  To create a new project using an interactive cli, run:
@@ -43,7 +65,6 @@ To start developing your new Stencil project, run:
43
65
  npm start
44
66
  ```
45
67
 
46
-
47
68
  ## Creating components
48
69
 
49
70
  Stencil components are TypeScript classes with decorator metadata. The decorators themselves are purely build-time annotations so the compiler can read metadata about each component, and removed entirely for smaller efficient components.
@@ -60,7 +81,6 @@ import { Component, Prop, h } from '@stencil/core';
60
81
  export class MyComponent {
61
82
 
62
83
  @Prop() first: string;
63
-
64
84
  @Prop() last: string;
65
85
 
66
86
  render() {
@@ -73,66 +93,13 @@ export class MyComponent {
73
93
  }
74
94
  ```
75
95
 
76
- Note: the `.tsx` extension is required, as this is the standard for TypeScript classes that use JSX.
77
-
78
96
  To use this component, just use it like any other HTML element:
79
97
 
80
98
  ```html
81
99
  <my-component first="Stencil" last="JS"></my-component>
82
100
  ```
83
101
 
84
-
85
- ## API
86
-
87
- The API for stencil closely mirrors the API for Custom Elements v1.
88
-
89
- ### Components
90
-
91
- | Decorator | Description |
92
- | -------------- | --- |
93
- | `@Component()` | Indicate a class is a Stencil component. |
94
- | | |
95
- | `@Prop()` | Creates a property that will exist on the element and be data-bound to this component. |
96
- | `@State()` | Creates a local state variable that will not be placed on the element. |
97
- | `@Method()` | Expose specific methods to be publicly accessible. |
98
-
99
-
100
- ## Why "Stencil?"
101
-
102
- A Stencil is a tool artists use for drawing perfect shapes easily. We want Stencil to be a similar tool for web developers: a tool that helps web developers build powerful Web Components and apps that use them, but without creating non-standard runtime requirements.
103
-
104
- Stencil is a tool developers use to create Web Components with some powerful features baked in, but it gets out of the way at runtime.
105
-
106
- - [Using Web Components in Ionic - Polymer Summit](https://youtu.be/UfD-k7aHkQE)
107
- - [Stencil: A built-time approach to the web - JSConf EU](https://youtu.be/M1F81V-NhP0)
108
- - [Architecting A Component Compiler - dotJS](https://youtu.be/RZ6MLELGsD8)
109
-
110
-
111
- ## Related
112
-
113
- - [Stencil Documentation](https://stenciljs.com/)
114
- - [Stencil Worldwide Slack](https://stencil-worldwide.herokuapp.com)
115
- - [Ionic](https://ionicframework.com/)
116
- - [Ionic Worldwide Slack](http://ionicworldwide.herokuapp.com/)
117
- - [Ionicons](http://ionicons.com/)
118
- - [Capacitor](https://capacitorjs.com/)
119
-
120
- ## Testing powered by
121
- <a target="_blank" href="https://www.browserstack.com/"><img width="200" src="https://www.browserstack.com/images/layout/browserstack-logo-600x315.png"></a><br>
122
- [BrowserStack Open-Source Program](https://www.browserstack.com/open-source)
123
-
124
- ## License
125
-
126
- - [MIT](https://raw.githubusercontent.com/ionic-team/stencil/main/LICENSE.md)
127
-
128
-
129
- [npm-badge]: https://img.shields.io/npm/v/@stencil/core.svg
130
- [npm-badge-url]: https://www.npmjs.com/package/@stencil/core
131
- [npm-license]: https://img.shields.io/npm/l/@stencil/core.svg
132
- [npm-license-url]: https://github.com/ionic-team/stencil/blob/main/LICENSE
133
- [circle-badge]: https://circleci.com/gh/ionic-team/stencil.svg?style=shield
134
- [circle-badge-url]: https://circleci.com/gh/ionic-team/stencil
135
- [browserstack-badge]: https://www.browserstack.com/automate/badge.svg?badge_key=WVNVbkRJdDBJQnBEMzZuWUdlMEZuTjlPUm9sOHZsSVNkUlJTRkJVQkx0ST0tLTFhbk5jRUNEVWxJL1J0SVR0WUFndnc9PQ==--90c84981a2ed2ede760ca48fbfc3fdd5b71d3e5e
136
- [browserstack-badge-url]: https://www.browserstack.com/automate/public-build/WVNVbkRJdDBJQnBEMzZuWUdlMEZuTjlPUm9sOHZsSVNkUlJTRkJVQkx0ST0tLTFhbk5jRUNEVWxJL1J0SVR0WUFndnc9PQ==--90c84981a2ed2ede760ca48fbfc3fdd5b71d3e5e
137
- [appveyor-badge]: https://ci.appveyor.com/api/projects/status/92d75dgkohgyap5r/branch/master?svg=true
138
- [appveyor-badge-url]: https://ci.appveyor.com/project/Ionitron/stencil/branch/master
102
+ ## Thanks
103
+ Stencil's internal testing suite is supported by the [BrowserStack Open-Source Program](https://www.browserstack.com/open-source)
104
+ <br>
105
+ <a target="_blank" href="https://www.browserstack.com/"><img width="200" src="https://www.browserstack.com/images/layout/browserstack-logo-600x315.png"></a>
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "2.12.0",
3
+ "version": "2.12.1",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/sys/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Node System v2.12.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Node System v2.12.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _interopDefaultLegacy(e) {
5
5
  return e && "object" == typeof e && "default" in e ? e : {
@@ -275,21 +275,22 @@ const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = req
275
275
  n.push(o);
276
276
  }
277
277
  }, l = t => e.color(t, "red"), u = t => e.color(t, "yellow"), f = t => e.color(t, "cyan"), h = t => e.color(t, "bold"), d = t => e.color(t, "dim"), p = t => e.color(t, "bgRed"), m = e => LOG_LEVELS.indexOf(e) >= LOG_LEVELS.indexOf(t), g = (t, r, n) => {
278
- var i, o;
279
- let s = t.length - r + n - 1;
278
+ let i = t.length - r + n - 1;
280
279
  for (;t.length + INDENT$1.length > e.getColumns(); ) if (r > t.length - r + n && r > 5) t = t.substr(1),
281
280
  r--; else {
282
- if (!(s > 1)) break;
283
- t = t.substr(0, t.length - 1), s--;
281
+ if (!(i > 1)) break;
282
+ t = t.substr(0, t.length - 1), i--;
284
283
  }
285
- const a = [], c = Math.max(t.length, r + n);
286
- for (i = 0; i < c; i++) o = t.charAt(i), i >= r && i < r + n && (o = p("" === o ? " " : o)),
287
- a.push(o);
288
- return a.join("");
284
+ const o = [], s = Math.max(t.length, r + n);
285
+ for (let e = 0; e < s; e++) {
286
+ let i = t.charAt(e);
287
+ e >= r && e < r + n && (i = p("" === i ? " " : i)), o.push(i);
288
+ }
289
+ return o.join("");
289
290
  }, y = e => e.trim().startsWith("//") ? d(e) : e.split(" ").map((e => JS_KEYWORDS.indexOf(e) > -1 ? f(e) : e)).join(" "), b = e => {
290
291
  let t = !0;
291
292
  const r = [];
292
- for (var n = 0; n < e.length; n++) {
293
+ for (let n = 0; n < e.length; n++) {
293
294
  const i = e.charAt(n);
294
295
  ";" === i || "{" === i ? t = !0 : ".#,:}@$[]/*".indexOf(i) > -1 && (t = !1), t && "abcdefghijklmnopqrstuvwxyz-_".indexOf(i.toLowerCase()) > -1 ? r.push(f(i)) : r.push(i);
295
296
  }
@@ -386,7 +387,7 @@ const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = req
386
387
  l += f(h), "number" == typeof r.lineNumber && r.lineNumber > -1 && (l += d(":"),
387
388
  l += u(`${r.lineNumber}`), "number" == typeof r.columnNumber && r.columnNumber > -1 && (l += d(":"),
388
389
  l += u(`${r.columnNumber}`)))), l.length > 0 && c.unshift(INDENT$1 + l), c.push(""),
389
- r.lines && r.lines.length && (prepareLines(r.lines).forEach((e => {
390
+ r.lines && r.lines.length && (removeLeadingWhitespace(r.lines).forEach((e => {
390
391
  if (!isMeaningfulLine(e.text)) return;
391
392
  let t = "";
392
393
  for (e.lineNumber > -1 && (t = `L${e.lineNumber}: `); t.length < INDENT$1.length; ) t = " " + t;
@@ -432,7 +433,7 @@ const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = req
432
433
  r.push(INDENT$1 + e), i = INDENT$1) : e.length + i.length > t - 1 ? (r.push(i),
433
434
  i = INDENT$1 + e + " ") : i += e + " ");
434
435
  })), i.trim().length && r.push(i), r.map((e => e.trimRight()));
435
- }, prepareLines = e => {
436
+ }, removeLeadingWhitespace = e => {
436
437
  const t = JSON.parse(JSON.stringify(e));
437
438
  for (let e = 0; e < 100; e++) {
438
439
  if (!eachLineHasLeadingWhitespace(t)) return t;
@@ -442,7 +443,7 @@ const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = req
442
443
  return t;
443
444
  }, eachLineHasLeadingWhitespace = e => {
444
445
  if (!e.length) return !1;
445
- for (var t = 0; t < e.length; t++) {
446
+ for (let t = 0; t < e.length; t++) {
446
447
  if (!e[t].text || e[t].text.length < 1) return !1;
447
448
  const r = e[t].text.charAt(0);
448
449
  if (" " !== r && "\t" !== r) return !1;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/sys/node",
3
- "version": "2.12.0",
3
+ "version": "2.12.1",
4
4
  "description": "Stencil Node System.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Node System Worker v2.12.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Node System Worker v2.12.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _interopNamespace(e) {
5
5
  if (e && e.__esModule) return e;
package/testing/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Testing v2.12.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Testing v2.12.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _lazyRequire(e) {
5
5
  return new Proxy({}, {
@@ -2863,7 +2863,7 @@ const createSystem = e => {
2863
2863
  u("/");
2864
2864
  const S = {
2865
2865
  name: "in-memory",
2866
- version: "2.12.0",
2866
+ version: "2.12.1",
2867
2867
  events: o,
2868
2868
  access: async e => c(e),
2869
2869
  accessSync: c,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/testing",
3
- "version": "2.12.0",
3
+ "version": "2.12.1",
4
4
  "description": "Stencil testing suite.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",