@stencil/core 3.0.0-alpha.1 → 3.0.0-beta.0
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/cli/config-flags.d.ts +16 -16
- package/cli/index.cjs +5 -4
- package/cli/index.js +5 -4
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +308 -70
- package/compiler/lib.dom.iterable.d.ts +6 -2
- package/compiler/lib.es2015.promise.d.ts +9 -4
- package/compiler/lib.es2015.proxy.d.ts +1 -1
- package/compiler/lib.es2015.reflect.d.ts +25 -2
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2019.d.ts +1 -0
- package/compiler/lib.es2019.intl.d.ts +25 -0
- package/compiler/lib.es2020.intl.d.ts +1 -1
- package/compiler/lib.es5.d.ts +26 -13
- package/compiler/lib.webworker.d.ts +266 -30
- package/compiler/lib.webworker.iterable.d.ts +10 -2
- package/compiler/package.json +1 -1
- package/compiler/stencil.d.ts +1 -23
- package/compiler/stencil.js +1413 -323
- package/compiler/stencil.min.js +2 -2
- package/compiler/sys/in-memory-fs.d.ts +3 -3
- package/compiler/transpile.d.ts +32 -0
- package/dependencies.json +2 -1
- package/dev-server/client/app-error.d.ts +1 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/open-in-editor-api.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/index.cjs +4 -0
- package/internal/app-data/index.js +4 -0
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +20 -3
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +15 -2
- package/internal/client/patch-esm.js +3 -1
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -2
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +4 -4
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +37 -37
- package/internal/stencil-public-compiler.d.ts +43 -35
- package/internal/stencil-public-runtime.d.ts +3 -3
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.d.ts +2 -2
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +8 -8
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +1 -1
- package/sys/node/glob.js +1 -1
- package/sys/node/index.js +29 -42
- package/sys/node/package.json +1 -1
- package/sys/node/prompts.js +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +19 -13
- package/testing/jest/jest-preprocessor.d.ts +3 -3
- package/testing/package.json +1 -1
- package/testing/puppeteer/puppeteer-declarations.d.ts +4 -4
- package/testing/testing-utils.d.ts +1 -1
|
@@ -245,13 +245,18 @@ export interface ConfigExtras {
|
|
|
245
245
|
/**
|
|
246
246
|
* Include the CSS Custom Property polyfill/shim for legacy browsers. ESM builds will
|
|
247
247
|
* not include the css vars shim. Defaults to `false`
|
|
248
|
+
*
|
|
249
|
+
* @deprecated Since Stencil v3.0.0. IE 11, Edge <= 18, and old Safari
|
|
250
|
+
* versions are no longer supported.
|
|
248
251
|
*/
|
|
249
|
-
|
|
252
|
+
__deprecated__cssVarsShim?: boolean;
|
|
250
253
|
/**
|
|
251
|
-
* Dynamic `import()` shim. This is only needed for Edge 18 and below, and
|
|
252
|
-
* and below. Defaults to `false`.
|
|
254
|
+
* Dynamic `import()` shim. This is only needed for Edge 18 and below, and
|
|
255
|
+
* Firefox 67 and below. Defaults to `false`.
|
|
256
|
+
* @deprecated Since Stencil v3.0.0. IE 11, Edge <= 18, and old Safari
|
|
257
|
+
* versions are no longer supported.
|
|
253
258
|
*/
|
|
254
|
-
|
|
259
|
+
__deprecated__dynamicImportShim?: boolean;
|
|
255
260
|
/**
|
|
256
261
|
* Experimental flag. Projects that use a Stencil library built using the `dist` output target may have trouble lazily
|
|
257
262
|
* loading components when using a bundler such as Vite or Parcel. Setting this flag to `true` will change how Stencil
|
|
@@ -268,8 +273,10 @@ export interface ConfigExtras {
|
|
|
268
273
|
* `<script nomodule>`. When set to `true`, the runtime will patch support for Safari 10
|
|
269
274
|
* due to its lack of `nomodule` support.
|
|
270
275
|
* Defaults to `false`.
|
|
276
|
+
*
|
|
277
|
+
* @deprecated Since Stencil v3.0.0, Safari 10 is no longer supported.
|
|
271
278
|
*/
|
|
272
|
-
|
|
279
|
+
__deprecated__safari10?: boolean;
|
|
273
280
|
/**
|
|
274
281
|
* It is possible to assign data to the actual `<script>` element's `data-opts` property,
|
|
275
282
|
* which then gets passed to Stencil's initial bootstrap. This feature is only required
|
|
@@ -286,8 +293,11 @@ export interface ConfigExtras {
|
|
|
286
293
|
* if it's determined that shadow dom is already natively supported by the browser then
|
|
287
294
|
* it does not request the shim. When set to `false` it will avoid all shadow dom tests.
|
|
288
295
|
* Defaults to `false`.
|
|
296
|
+
*
|
|
297
|
+
* @deprecated Since Stencil v3.0.0. IE 11, Edge <= 18, and old Safari versions
|
|
298
|
+
* are no longer supported.
|
|
289
299
|
*/
|
|
290
|
-
|
|
300
|
+
__deprecated__shadowDomShim?: boolean;
|
|
291
301
|
/**
|
|
292
302
|
* When a component is first attached to the DOM, this setting will wait a single tick before
|
|
293
303
|
* rendering. This works around an Angular issue, where Angular attaches the elements before
|
|
@@ -351,12 +361,12 @@ export interface Config extends StencilConfig {
|
|
|
351
361
|
* conforming to a given interface. For best results, pair with a validation
|
|
352
362
|
* function as shown in the example.
|
|
353
363
|
*/
|
|
354
|
-
|
|
364
|
+
type Loose<T extends Object> = Record<string, any> & Partial<T>;
|
|
355
365
|
/**
|
|
356
366
|
* A Loose version of the Config interface. This is intended to let us load a partial config
|
|
357
367
|
* and have type information carry though as we construct an object which is a valid `Config`.
|
|
358
368
|
*/
|
|
359
|
-
export
|
|
369
|
+
export type UnvalidatedConfig = Loose<Config>;
|
|
360
370
|
/**
|
|
361
371
|
* Helper type to strip optional markers from keys in a type, while preserving other type information for the key.
|
|
362
372
|
* This type takes a union of keys, K, in type T to allow for the type T to be gradually updated.
|
|
@@ -366,20 +376,20 @@ export declare type UnvalidatedConfig = Loose<Config>;
|
|
|
366
376
|
* type ReqFieldFoo = RequireFields<Foo, 'bar'>; // { bar: number, baz?: string }
|
|
367
377
|
* ```
|
|
368
378
|
*/
|
|
369
|
-
|
|
379
|
+
type RequireFields<T, K extends keyof T> = T & {
|
|
370
380
|
[P in K]-?: T[P];
|
|
371
381
|
};
|
|
372
382
|
/**
|
|
373
383
|
* Fields in {@link Config} to make required for {@link ValidatedConfig}
|
|
374
384
|
*/
|
|
375
|
-
|
|
385
|
+
type StrictConfigFields = 'flags' | 'logger' | 'outputTargets' | 'rootDir' | 'sys' | 'testing';
|
|
376
386
|
/**
|
|
377
387
|
* A version of {@link Config} that makes certain fields required. This type represents a valid configuration entity.
|
|
378
388
|
* When a configuration is received by the user, it is a bag of unverified data. In order to make stricter guarantees
|
|
379
389
|
* about the data from a type-safety perspective, this type is intended to be used throughout the codebase once
|
|
380
390
|
* validations have occurred at runtime.
|
|
381
391
|
*/
|
|
382
|
-
export
|
|
392
|
+
export type ValidatedConfig = RequireFields<Config, StrictConfigFields>;
|
|
383
393
|
export interface HydratedFlag {
|
|
384
394
|
/**
|
|
385
395
|
* Defaults to `hydrated`.
|
|
@@ -533,8 +543,8 @@ export interface DevServerEditor {
|
|
|
533
543
|
supported?: boolean;
|
|
534
544
|
priority?: number;
|
|
535
545
|
}
|
|
536
|
-
export
|
|
537
|
-
export
|
|
546
|
+
export type TaskCommand = 'build' | 'docs' | 'generate' | 'g' | 'help' | 'info' | 'prerender' | 'serve' | 'telemetry' | 'test' | 'version';
|
|
547
|
+
export type PageReloadStrategy = 'hmr' | 'pageReload' | null;
|
|
538
548
|
/**
|
|
539
549
|
* The prerender config is used when prerendering a `www` output target.
|
|
540
550
|
* Within `stencil.config.ts`, set the path to the prerendering
|
|
@@ -1225,7 +1235,7 @@ export interface HmrStyleUpdate {
|
|
|
1225
1235
|
styleTag: string;
|
|
1226
1236
|
styleText: string;
|
|
1227
1237
|
}
|
|
1228
|
-
export
|
|
1238
|
+
export type BuildOnEventRemove = () => boolean;
|
|
1229
1239
|
export interface BuildEvents extends BuildOnEvents, BuildEmitEvents {
|
|
1230
1240
|
unsubscribeAll(): void;
|
|
1231
1241
|
}
|
|
@@ -1233,19 +1243,19 @@ export interface CompilerBuildStart {
|
|
|
1233
1243
|
buildId: number;
|
|
1234
1244
|
timestamp: string;
|
|
1235
1245
|
}
|
|
1236
|
-
export
|
|
1237
|
-
export
|
|
1238
|
-
export
|
|
1239
|
-
export
|
|
1240
|
-
export
|
|
1241
|
-
export
|
|
1242
|
-
export
|
|
1243
|
-
export
|
|
1244
|
-
export
|
|
1245
|
-
export
|
|
1246
|
-
export
|
|
1247
|
-
export
|
|
1248
|
-
export
|
|
1246
|
+
export type CompilerFileWatcherCallback = (fileName: string, eventKind: CompilerFileWatcherEvent) => void;
|
|
1247
|
+
export type CompilerFileWatcherEvent = CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventFileUpdate | CompilerEventDirAdd | CompilerEventDirDelete;
|
|
1248
|
+
export type CompilerEventName = CompilerEventFsChange | CompilerEventFileUpdate | CompilerEventFileAdd | CompilerEventFileDelete | CompilerEventDirAdd | CompilerEventDirDelete | CompilerEventBuildStart | CompilerEventBuildFinish | CompilerEventBuildNoChange | CompilerEventBuildLog;
|
|
1249
|
+
export type CompilerEventFsChange = 'fsChange';
|
|
1250
|
+
export type CompilerEventFileUpdate = 'fileUpdate';
|
|
1251
|
+
export type CompilerEventFileAdd = 'fileAdd';
|
|
1252
|
+
export type CompilerEventFileDelete = 'fileDelete';
|
|
1253
|
+
export type CompilerEventDirAdd = 'dirAdd';
|
|
1254
|
+
export type CompilerEventDirDelete = 'dirDelete';
|
|
1255
|
+
export type CompilerEventBuildStart = 'buildStart';
|
|
1256
|
+
export type CompilerEventBuildFinish = 'buildFinish';
|
|
1257
|
+
export type CompilerEventBuildLog = 'buildLog';
|
|
1258
|
+
export type CompilerEventBuildNoChange = 'buildNoChange';
|
|
1249
1259
|
export interface CompilerFileWatcher {
|
|
1250
1260
|
close(): void | Promise<void>;
|
|
1251
1261
|
}
|
|
@@ -1659,7 +1669,7 @@ export interface EmulateViewport {
|
|
|
1659
1669
|
* in this array without good reason!
|
|
1660
1670
|
*/
|
|
1661
1671
|
export declare const LOG_LEVELS: readonly ["debug", "info", "warn", "error"];
|
|
1662
|
-
export
|
|
1672
|
+
export type LogLevel = typeof LOG_LEVELS[number];
|
|
1663
1673
|
/**
|
|
1664
1674
|
* Common logger to be used by the compiler, dev-server and CLI. The CLI will use a
|
|
1665
1675
|
* NodeJS based console logging and colors, and the web will use browser based
|
|
@@ -1873,7 +1883,7 @@ export declare const CustomElementsExportBehaviorOptions: readonly ["default", "
|
|
|
1873
1883
|
* This type is auto-generated based on the values in `CustomElementsExportBehaviorOptions` array.
|
|
1874
1884
|
* This is used on the output target config for intellisense in typed configs.
|
|
1875
1885
|
*/
|
|
1876
|
-
export
|
|
1886
|
+
export type CustomElementsExportBehavior = typeof CustomElementsExportBehaviorOptions[number];
|
|
1877
1887
|
export interface OutputTargetDistCustomElements extends OutputTargetBaseNext {
|
|
1878
1888
|
type: 'dist-custom-elements';
|
|
1879
1889
|
empty?: boolean;
|
|
@@ -1885,7 +1895,6 @@ export interface OutputTargetDistCustomElements extends OutputTargetBaseNext {
|
|
|
1885
1895
|
*/
|
|
1886
1896
|
externalRuntime?: boolean;
|
|
1887
1897
|
copy?: CopyTask[];
|
|
1888
|
-
inlineDynamicImports?: boolean;
|
|
1889
1898
|
includeGlobalScripts?: boolean;
|
|
1890
1899
|
minify?: boolean;
|
|
1891
1900
|
/**
|
|
@@ -1904,7 +1913,6 @@ export interface OutputTargetDistCustomElementsBundle extends OutputTargetBaseNe
|
|
|
1904
1913
|
empty?: boolean;
|
|
1905
1914
|
externalRuntime?: boolean;
|
|
1906
1915
|
copy?: CopyTask[];
|
|
1907
|
-
inlineDynamicImports?: boolean;
|
|
1908
1916
|
includeGlobalScripts?: boolean;
|
|
1909
1917
|
minify?: boolean;
|
|
1910
1918
|
}
|
|
@@ -1917,7 +1925,7 @@ export interface OutputTargetBase {
|
|
|
1917
1925
|
*/
|
|
1918
1926
|
type: string;
|
|
1919
1927
|
}
|
|
1920
|
-
export
|
|
1928
|
+
export type OutputTargetBuild = OutputTargetDistCollection | OutputTargetDistLazy;
|
|
1921
1929
|
export interface OutputTargetCopy extends OutputTargetBase {
|
|
1922
1930
|
type: 'copy';
|
|
1923
1931
|
dir: string;
|
|
@@ -1997,7 +2005,7 @@ export interface OutputTargetWww extends OutputTargetBase {
|
|
|
1997
2005
|
serviceWorker?: ServiceWorkerConfig | null | false;
|
|
1998
2006
|
appDir?: string;
|
|
1999
2007
|
}
|
|
2000
|
-
export
|
|
2008
|
+
export type OutputTarget = OutputTargetCopy | OutputTargetCustom | OutputTargetDist | OutputTargetDistCollection | OutputTargetDistCustomElements | OutputTargetDistCustomElementsBundle | OutputTargetDistLazy | OutputTargetDistGlobalStyles | OutputTargetDistLazyLoader | OutputTargetDocsJson | OutputTargetDocsCustom | OutputTargetDocsReadme | OutputTargetDocsVscode | OutputTargetWww | OutputTargetHydrate | OutputTargetStats | OutputTargetDistTypes;
|
|
2001
2009
|
export interface ServiceWorkerConfig {
|
|
2002
2010
|
unregister?: boolean;
|
|
2003
2011
|
swDest?: string;
|
|
@@ -2136,7 +2144,7 @@ export interface OptimizeCssInput {
|
|
|
2136
2144
|
* Instead, this basically just serves as a label type to track
|
|
2137
2145
|
* that arguments are being passed consistently.
|
|
2138
2146
|
*/
|
|
2139
|
-
export
|
|
2147
|
+
export type AutoprefixerOptions = Object;
|
|
2140
2148
|
/**
|
|
2141
2149
|
* Output from CSS optimization functions, wrapping up optimized
|
|
2142
2150
|
* CSS and any diagnostics produced during optimization.
|
|
@@ -2306,7 +2314,7 @@ export interface TranspileOptions {
|
|
|
2306
2314
|
*/
|
|
2307
2315
|
sys?: CompilerSystem;
|
|
2308
2316
|
}
|
|
2309
|
-
export
|
|
2317
|
+
export type CompileTarget = 'latest' | 'esnext' | 'es2020' | 'es2019' | 'es2018' | 'es2017' | 'es2015' | 'es5' | string | undefined;
|
|
2310
2318
|
export interface TranspileResults {
|
|
2311
2319
|
code: string;
|
|
2312
2320
|
data?: any[];
|
|
@@ -133,7 +133,7 @@ export interface ListenOptions {
|
|
|
133
133
|
*/
|
|
134
134
|
passive?: boolean;
|
|
135
135
|
}
|
|
136
|
-
export
|
|
136
|
+
export type ListenTargetOptions = 'body' | 'document' | 'window';
|
|
137
137
|
export interface StateDecorator {
|
|
138
138
|
(): PropertyDecorator;
|
|
139
139
|
}
|
|
@@ -214,8 +214,8 @@ export declare const State: StateDecorator;
|
|
|
214
214
|
* https://stenciljs.com/docs/reactive-data#watch-decorator
|
|
215
215
|
*/
|
|
216
216
|
export declare const Watch: WatchDecorator;
|
|
217
|
-
export
|
|
218
|
-
export
|
|
217
|
+
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
218
|
+
export type ErrorHandler = (err: any, element?: HTMLElement) => void;
|
|
219
219
|
/**
|
|
220
220
|
* `setMode()` is used for libraries which provide multiple "modes" for styles.
|
|
221
221
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
package/mock-doc/index.cjs
CHANGED
package/mock-doc/index.d.ts
CHANGED
|
@@ -714,7 +714,7 @@ declare function parseHtmlToDocument(html: string, ownerDocument?: MockDocument)
|
|
|
714
714
|
declare function parseHtmlToFragment(html: string, ownerDocument?: MockDocument): any;
|
|
715
715
|
declare function parseDocumentUtil(ownerDocument: any, html: string): any;
|
|
716
716
|
declare function parseFragmentUtil(ownerDocument: any, html: string): any;
|
|
717
|
-
|
|
717
|
+
type DOMParserSupportedType = 'text/html' | 'text/xml' | 'application/xml' | 'application/xhtml+xml' | 'image/svg+xml';
|
|
718
718
|
declare class MockDOMParser {
|
|
719
719
|
parseFromString(htmlToParse: string, mimeType: DOMParserSupportedType): MockDocument;
|
|
720
720
|
}
|
|
@@ -744,7 +744,7 @@ declare class MockPerformance implements Performance {
|
|
|
744
744
|
toJSON(): void;
|
|
745
745
|
}
|
|
746
746
|
declare function resetPerformance(perf: Performance): void;
|
|
747
|
-
|
|
747
|
+
type MockRequestInfo = MockRequest | string;
|
|
748
748
|
interface MockRequestInit {
|
|
749
749
|
body?: any;
|
|
750
750
|
cache?: string;
|
package/mock-doc/index.js
CHANGED
package/mock-doc/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./internal/stencil-core/index.cjs",
|
|
6
6
|
"module": "./internal/stencil-core/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@ionic/prettier-config": "^2.0.0",
|
|
61
61
|
"@rollup/plugin-commonjs": "15.1.0",
|
|
62
|
-
"@rollup/plugin-json": "
|
|
62
|
+
"@rollup/plugin-json": "6.0.0",
|
|
63
63
|
"@rollup/plugin-node-resolve": "9.0.0",
|
|
64
64
|
"@rollup/plugin-replace": "2.3.4",
|
|
65
65
|
"@rollup/pluginutils": "5.0.2",
|
|
@@ -103,10 +103,10 @@
|
|
|
103
103
|
"jest-cli": "^27.4.5",
|
|
104
104
|
"jest-environment-node": "^27.4.4",
|
|
105
105
|
"listr": "^0.14.3",
|
|
106
|
-
"magic-string": "^0.
|
|
106
|
+
"magic-string": "^0.27.0",
|
|
107
107
|
"merge-source-map": "^1.1.0",
|
|
108
108
|
"mime-db": "^1.46.0",
|
|
109
|
-
"minimatch": "5.1.
|
|
109
|
+
"minimatch": "5.1.1",
|
|
110
110
|
"node-fetch": "2.6.7",
|
|
111
111
|
"open": "^8.4.0",
|
|
112
112
|
"open-in-editor": "2.2.0",
|
|
@@ -114,15 +114,15 @@
|
|
|
114
114
|
"path-browserify": "^1.0.1",
|
|
115
115
|
"pixelmatch": "5.3.0",
|
|
116
116
|
"postcss": "^8.2.8",
|
|
117
|
-
"prettier": "2.8.
|
|
117
|
+
"prettier": "2.8.1",
|
|
118
118
|
"prompts": "2.4.2",
|
|
119
|
-
"puppeteer": "^19.
|
|
119
|
+
"puppeteer": "^19.4.1",
|
|
120
120
|
"rollup": "2.42.3",
|
|
121
121
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
122
122
|
"semver": "^7.3.7",
|
|
123
123
|
"sizzle": "^2.3.6",
|
|
124
|
-
"terser": "5.
|
|
125
|
-
"typescript": "4.
|
|
124
|
+
"terser": "5.16.1",
|
|
125
|
+
"typescript": "4.9.4",
|
|
126
126
|
"webpack": "^4.46.0",
|
|
127
127
|
"ws": "7.4.6"
|
|
128
128
|
},
|