ibm / pwa-lit-template Goto Github PK
View Code? Open in Web Editor NEWA template for building Progressive Web Applications using Lit and Vaadin Router.
Home Page: https://pwa-lit-template.mybluemix.net
License: MIT License
A template for building Progressive Web Applications using Lit and Vaadin Router.
Home Page: https://pwa-lit-template.mybluemix.net
License: MIT License
IBM Cloud deploy action is not working
The issue is from: cloudfoundry/cli#2033
We can see the logs here:
https://github.com/IBM/pwa-lit-template/runs/1049897169?check_suite_focus=true
Deploy working
Keeping track of Service Worker can be tricky, so we could make it opt-in.
Keep the Service Worker disabled by default.
Allowing the user to activate / uncomment it in a simple way.
Right now, when build the project (npm run build
), the output doesn't work.
Seems like the this.main
is undefined
:
pwa-lit-template/src/components/app-index.ts
Lines 101 to 103 in 4993ec8
From the @query
decorator:
pwa-lit-template/src/components/app-index.ts
Lines 18 to 19 in 4993ec8
Just build and run the project.
Working as always.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are awaiting their schedule. Click on a checkbox to get an update now.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
These updates await pending status checks before automerging. Click on a checkbox to abort the branch automerge, and create a PR instead.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/verify.yml
actions/checkout v3
actions/setup-node v3
actions/checkout v3
actions/setup-node v3
actions/checkout v3
actions/setup-node v3
package.json
@vaadin/router ^1.7.5
lit ^2.7.1
pwa-helper-components ~0.2.10
tslib ^2.5.0
@open-wc/building-rollup ^2.2.2
@rollup/plugin-replace ^4.0.0
@rollup/plugin-typescript ^8.5.0
@typescript-eslint/eslint-plugin ^5.57.1
@typescript-eslint/parser ^5.57.1
@web/dev-server ~0.1.37
@web/dev-server-esbuild ~0.3.5
@web/dev-server-rollup ~0.3.21
@web/rollup-plugin-copy ~0.3.0
deepmerge ^4.3.1
eslint ^8.37.0
eslint-config-ibmresearch ~0.25.1
eslint-plugin-lit ^1.8.2
eslint-plugin-lit-a11y ^2.4.0
eslint-plugin-wc ^1.4.0
lit-analyzer ^1.2.1
nano-staged ^0.8.0
npm-run-all ^4.1.5
picocolors ^1.0.0
postcss-html ^1.5.0
postcss-lit ^1.1.0
prettier ~2.8.7
prettier-plugin-package ^1.3.0
rimraf ^4.4.1
rollup ^2.79.1
simple-git-hooks ^2.8.1
stylelint ^14.16.1
stylelint-config-ibmresearch ~0.16.0
typescript ~4.9.5
server/package.json
prpl-server ^1.4.2
Right now we use the PRPL server just to use Rendertron, for crawlers (social networks and SEO).
It would be nice to find an alternative.
Current LitElement draft: lit/lit#1231
Work in progress PR: #202
Line 26 in ecb5073
Our objective is to add Lighthouse as a GitHub Action to measure the impact of each RP and try to maintain a score of 100.
Some references:
https://github.com/GoogleChrome/lighthouse
https://github.com/GoogleChrome/lighthouse-ci
pwa-lit-template/src/router/index.ts
Line 27 in ecb5073
With #456 we disabled by default the service worker so we need to include in the README a section where to explain how to configure it.
When it's ready, we should replace the es-dev-server
with @web/dev-server
.
Core issue: stylelint/stylelint#4761
Run the Stylelint script: npm run lint:stylelint
It doesn't warn of possible errors.
Warn of possible errors.
There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.
Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.
As svg icons are supported in all modern browsers right now, maybe we can update it.
Some references:
Reference to Web Vitals: https://web.dev/vitals/
It would be great if there was a way to measure track performance metrics via a simple function. Developers would be able to log values to the console and/or send results to an analytics endpoint for all users on their site.
Reference to CRA:
I think it would be good to include an example of styling the active navigation links based on the current route as this probably a pretty common ask, its basically one of the first things I tried to get working and the right approach is not immediately obvious.
To be complete it would be good to have an example of styling a link that has child routes e.g.
if the link was to /items
which displayed a list of items.
Then navigating to /items/item1
should still consider the link as active as it is a child route of items.
Not sure how best to do this, seems vaadin router passes route information down to the routed elements, e.g. location.params.id
.
However since the navigation links are in app-index.ts
where the router itself is attached it won't have access to that .
So one option would be to move the navigation links into one of the routed components (maybe an overall parent layout component that matches all routes, which handles the navigation bar itself with a slot for the content - then have child routes to '/' and '/about' for the home and about content.
Or another option would be to add an event listener in the app-index.ts
that updates some state containing the current routing information (bit like this: vaadin/router#483).
window.addEventListener('vaadin-router-location-changed', this.handleRouteChange)
Maybe there is a better way, any thoughts?
Right now the lit-analyzer
found two problems (warnings) about the pwa-helper-components
. You can the npm run typescript:type-checking
to see it.
> lit-analyzer "src/{components,pages}/**/*.ts" --strict
Analyzing 4 files...
./src/components/app-index.ts
Unknown tag <pwa-install-button>.
63: <pwa-install-button>
no-unknown-tag-name
Unknown tag <pwa-update-available>.
67: <pwa-update-available>
no-unknown-tag-name
โ 2 problems in 1 file (0 errors, 2 warnings)
Related issues:
The page-not-found.ts
add the render:status_code
The page-element.ts
update the HTML meta tags based on the route metatada
property. Also the user can override the metadata()
method to use dynamic data.
The renderPageNotFound
helper. The user can use this helper in the render()
method in a page. For example, in a user route when the user doesn't exists. We will know that the user does not exist after making the request to the API.
Related Vaadin Router issue: vaadin/router#408
Because the vaadin-router dynamically replaces the page-elements shown inside the <main>
tag, there is no chance for the app-index
to pass some properties down to the page-elements.
Whats the best way to achieve this?
Manifest, Service Workers, offline, install & update buttons, ...
On Firefox Ubuntu
I use npm start and then the content doesn't appear, only the menu.
Uncaught (in promise) TypeError: [Vaadin.Router] Expected router outlet to be a valid DOM Node (but got undefined)
__ensureOutlet router.js:752
__addAppearingContent router.js:786
ready router.js:498
promise callback*render router.js:469
attachRouter index.ts:29
firstUpdated app-index.ts:103
_$didUpdate reactive-element.ts:1350
performUpdate reactive-element.ts:1317
scheduleUpdate reactive-element.ts:1235
__enqueueUpdate reactive-element.ts:1207
requestUpdate reactive-element.ts:1182
_initialize reactive-element.ts:924
ReactiveElement reactive-element.ts:907
LitElement lit-element.js:82
AppIndex app-index.ts:18
legacyCustomElement custom-element.ts:21
customElement custom-element.ts:64
__decorateClass app-index.ts:7
app-index.ts:18
router.js:752:12
GEThttp://192.168.1.108:8000/src/pages/page-about.ts
[HTTP/1.1 304 Not Modified 1ms]
When the app grows, keep the import ordering can get awkward.
Enforce import ordering with ESLint.
https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
'import/order': ['error', { groups: [['builtin', 'external', 'internal']] }],
For example, something like navigate to each route and get the expected title & description
The Vaadin Router doesn't help us to restore scroll position on navigation.
There is already an issue about it: vaadin/router#43
Meanwhile, for now, we have created a simple patch to deal with it: now when you perform a click event, the scroll will be reset to the top position.
But we wish we could find a good solution soon.
We already mentioned it here:
https://github.com/IBM/pwa-lit-template#things-to-be-aware
Right now we lazy import and initialize the router here:
pwa-lit-template/src/components/app-index.ts
Lines 81 to 89 in 5fb2c63
This router.init()
function doesn't export anything:
pwa-lit-template/src/router/index.ts
Lines 13 to 27 in 5fb2c63
Doing it this way, we found a problem:
We can't import the router instance to use the router helpers.
For example, we want to replace the hardcoded link in the not found page to use the router name. From this:
To something like this:
<a href="${router.urlForName('home')}">Back to home</a>
And the same for the navigation links:
pwa-lit-template/src/components/app-index.ts
Lines 57 to 61 in 5fb2c63
[!] Error: ENOENT: no such file or directory, lstat 'C:\Users\saadon\AppData\Local\Temp\6'
Type npm run build
I am interested to build for different env (CI, QA, EA and PRD), and each build should use the relevant config file (config.ci.ts, config.qa.ts etc.).
Thank you
We want to try setup Renovate to test and merge minor and patch releases without PR.
Current config:
pwa-lit-template/.github/renovate.json
Lines 1 to 22 in de1f205
Replace lit-analyzer
dependency in favor of ts-lit-plugin
.
Add this in the tsconfig.json
:
"plugins": [
{
"name": "ts-lit-plugin",
"strict": true
}
]
Also remove the lit:type-checking
script, because with the typescript:type-checking
will be enough.
Depends on: runem/lit-analyzer#82
Fixed by: runem/lit-analyzer@83d49d7
Now waiting the new release.
We wan an updated online demo from the template.
We can do it from a GitHub Action.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.