Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from Lit monorepo (manually) #23

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7357f59
[lit-next] Add tsconfig for dowleveling polyfill-support to ES5 (#1579)
kevinpschaaf Feb 5, 2021
6b7472a
[lit-next] Prepare next pre-releases
justinfagnani Feb 11, 2021
8934599
[lit-starter-*] Fix tests on macOS 11.2
justinfagnani Feb 12, 2021
f5ce5b5
New copyright headers (#1630)
aomarks Feb 26, 2021
882ce5f
Update package-locks to v2
justinfagnani Mar 24, 2021
3a903b2
[localize] Replace msgdesc comment with desc option (#1702)
aomarks Mar 31, 2021
21c8db4
[labs] Add @lit-labs/ssr-client and move renderLight (#1689)
kevinpschaaf Mar 31, 2021
6158391
Prepare releases (#1709)
justinfagnani Mar 31, 2021
5ee50e2
[all] Release rc 1 (#1773)
rictic Apr 21, 2021
8147bf1
Update starter kit versions (#1785)
rictic Apr 21, 2021
3f86bac
[all] Remove Polymer references and update links (#1795)
abdonrd Apr 22, 2021
d00d59e
Release all packages with changes (#1860)
justinfagnani May 7, 2021
f5b6fff
Upgrade dependencies. Separate `upgrade` and `nuke`. (#1892)
kevinpschaaf May 12, 2021
bee9669
[all] Update Prettier to v2.3.0 (#1903)
abdonrd May 25, 2021
6e00285
[localize] SSR localization (#1836)
aomarks Jul 13, 2021
b645f89
Replace local type declarations for polyfill APIs with those imported…
bicknellr Aug 6, 2021
c215138
Enable noImplicitOverride in our tsconfigs, requiring us to add the `…
rictic Aug 26, 2021
bb6eb3e
[all] Upgrade all package locks, includes TypeScript 4.4.2 (#2113)
aomarks Aug 31, 2021
3ed0012
[all] Take (almost) all major upgrades to dependencies (#2115)
aomarks Aug 31, 2021
2487241
Remove subpath folder mapping from packages' `exports` field. (#2103)
bicknellr Sep 1, 2021
c458144
[starter-kits] Update starter kits to use open-wc CEM analyzer (#2117)
kevinpschaaf Sep 1, 2021
450a96c
Bump package locks (#2131)
aomarks Sep 2, 2021
3ebb4c3
[all] Prepare Lit 2.0 GA release (#2170)
kevinpschaaf Sep 21, 2021
f301ef4
[starter-kits] Fix starter kits so `npm run serve` isn't `npm run doc…
AndrewJakubowicz Nov 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[lit-next] Add tsconfig for dowleveling polyfill-support to ES5 (#1579)
* Add tsconfig for dowleveling polyfill-support to ES5

* Feature detect when patching as opposed to load
Makes the polyfill-support agnostic to wcjs load ordering

* Inject polyfill-support into tests when needed; add styling test

* Add sauce and browserstack examples

* Make super call ES5 downlevel-safe

* Pass super args and tear off Reflect.construct

* Avoid Reflect.construct

* Fix ENABLE_SHADYDOM_NOPATCH replacement when downleveling

* Warn on unconfigured browser

* Replace var to var for ES5
  • Loading branch information
kevinpschaaf authored Feb 5, 2021
commit 7357f59c73e0fce24e961ea6158432659cd847f6
6 changes: 6 additions & 0 deletions test/my-element_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,10 @@ suite('my-element', () => {
`
);
});

test('styling applied', async () => {
const el = await fixture(html`<my-element></my-element>`);
await el.updateComplete;
assert.equal(getComputedStyle(el).paddingTop, '16px');
});
});
94 changes: 84 additions & 10 deletions web-test-runner.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,80 @@
import {playwrightLauncher} from '@web/test-runner-playwright';
import {legacyPlugin} from '@web/dev-server-legacy';
import {playwrightLauncher} from '@web/test-runner-playwright';

// Uncomment for testing on Sauce Labs
// Must run `npm i --save-dev @web/test-runner-saucelabs` and set
// SAUCE_USERNAME and SAUCE_USERNAME environment variables
// ===========
// import {createSauceLabsLauncher} from '@web/test-runner-saucelabs';
// const sauceLabsLauncher = createSauceLabsLauncher(
// {
// user: process.env.SAUCE_USERNAME,
// key: process.env.SAUCE_USERNAME,
// },
// {
// 'sauce:options': {
// name: 'unit tests',
// build: `${process.env.GITHUB_REF ?? 'local'} build ${
// process.env.GITHUB_RUN_NUMBER ?? ''
// }`,
// },
// }
// );

// Uncomment for testing on BrowserStack
// Must run `npm i --save-dev @web/test-runner-browserstack` and set
// BROWSER_STACK_USERNAME and BROWSER_STACK_ACCESS_KEY environment variables
// ===========
// import {browserstackLauncher as createBrowserstackLauncher} from '@web/test-runner-browserstack';
// const browserstackLauncher = (config) => createBrowserstackLauncher({
// capabilities: {
// 'browserstack.user': process.env.BROWSER_STACK_USERNAME,
// 'browserstack.key': process.env.BROWSER_STACK_ACCESS_KEY,
// project: 'my-element',
// name: 'unit tests',
// build: `${process.env.GITHUB_REF ?? 'local'} build ${
// process.env.GITHUB_RUN_NUMBER ?? ''
// }`,
// ...config,
// }
// });

const browsers = {
// Local browser testing via playwright
// ===========
chromium: playwrightLauncher({product: 'chromium'}),
firefox: playwrightLauncher({product: 'firefox'}),
webkit: playwrightLauncher({product: 'webkit'}),

// Uncomment example launchers for running on Sauce Labs
// ===========
// chromium: sauceLabsLauncher({browserName: 'chrome', browserVersion: 'latest', platformName: 'Windows 10'}),
// firefox: sauceLabsLauncher({browserName: 'firefox', browserVersion: 'latest', platformName: 'Windows 10'}),
// edge: sauceLabsLauncher({browserName: 'MicrosoftEdge', browserVersion: 'latest', platformName: 'Windows 10'}),
// ie11: sauceLabsLauncher({browserName: 'internet explorer', browserVersion: '11.0', platformName: 'Windows 10'}),
// safari: sauceLabsLauncher({browserName: 'safari', browserVersion: 'latest', platformName: 'macOS 10.15'}),

// Uncomment example launchers for running on Sauce Labs
// ===========
// chromium: browserstackLauncher({browserName: 'Chrome', os: 'Windows', os_version: '10'}),
// firefox: browserstackLauncher({browserName: 'Firefox', os: 'Windows', os_version: '10'}),
// edge: browserstackLauncher({browserName: 'MicrosoftEdge', os: 'Windows', os_version: '10'}),
// ie11: browserstackLauncher({browserName: 'IE', browser_version: '11.0', os: 'Windows', os_version: '10'}),
// safari: browserstackLauncher({browserName: 'Safari', browser_version: '14.0', os: 'OS X', os_version: 'Big Sur'}),
};

// Prepend BROWSERS=x,y to `npm run test` to run a subset of browsers
// e.g. `BROWSERS=chromium,firefox npm run test`
const noBrowser = (b) => {
throw new Error(`No browser configured named '${b}'; using defaults`);
};
let commandLineBrowsers;
try {
commandLineBrowsers = process.env.BROWSERS?.split(',').map((b) =>
playwrightLauncher({product: b})
commandLineBrowsers = process.env.BROWSERS?.split(',').map(
(b) => browsers[b] ?? noBrowser(b)
);
} catch {
console.warn(`BROWSER ${process.env.BROWSERS} unknown; using defaults`);
} catch (e) {
console.warn(e);
}

// https://modern-web.dev/docs/test-runner/cli-and-configuration/
Expand All @@ -16,11 +83,7 @@ export default {
files: ['./test/**/*_test.js'],
nodeResolve: true,
preserveSymlinks: true,
browsers: commandLineBrowsers ?? [
playwrightLauncher({product: 'chromium'}),
playwrightLauncher({product: 'firefox'}),
playwrightLauncher({product: 'webkit'}),
],
browsers: commandLineBrowsers ?? Object.values(browsers),
testFramework: {
// https://mochajs.org/api/mocha
config: {
Expand All @@ -33,6 +96,17 @@ export default {
legacyPlugin({
polyfills: {
webcomponents: true,
// Inject lit's polyfill-support module into test files, which is required
// for interfacing with the webcomponents polyfills
custom: [
{
name: 'lit-polyfill-support',
path: 'node_modules/lit/polyfill-support.js',
test:
"!('attachShadow' in Element.prototype) || !('getRootNode' in Element.prototype) || window.ShadyDOM && window.ShadyDOM.force",
module: false,
},
],
},
}),
],
Expand Down