Gathering detailed insights and metrics for @evergreen-wc/lazyroute
Gathering detailed insights and metrics for @evergreen-wc/lazyroute
npm install @evergreen-wc/lazyroute
Typescript
Module System
Node Version
NPM Version
JavaScript (66.42%)
CSS (33.58%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
1,019
Last Day
1
Last Week
1
Last Month
4
Last Year
103
Apache-2.0 License
3 Stars
61 Commits
1 Forks
2 Watchers
4 Branches
1 Contributors
Updated on May 23, 2021
Minified
Minified + Gzipped
Latest Version
0.1.1
Package Id
@evergreen-wc/lazyroute@0.1.1
Unpacked Size
15.48 kB
Size
5.72 kB
File Count
5
NPM Version
lerna/3.22.1/node@v12.19.0+x64 (linux)
Node Version
12.19.0
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
-77.8%
4
Compared to previous month
Last Year
-37.2%
103
Compared to previous year
1
Deprecated: This functionality has now been merged into lit-redux-router > 0.7.0
See the bottom of lit-redux-router's README.md for more information on using lazy loaded routes.
Lazyload routes with lit-redux-router
1$ npm i @evergreen-wc/lazyroute lit-html lit-redux-router pwa-helpers redux redux-thunk 2$ npm i --save-dev babel-eslint @babel/plugin-syntax-dynamic-import
First modify your babel.config.js
to enable dynamic imports
1module.exports = { 2 3 presets: ['@babel/preset-env'], 4 5 plugins: [ 6 ['babel-plugin-transform-builtin-classes', { 7 globals: ['LitElement'] 8 }], 9 '@babel/plugin-syntax-dynamic-import' 10 ] 11};
Modify your .eslintrc
to contain
1{ 2 "parser": "babel-eslint", 3 "parserOptions": { 4 "ecmaVersion": 2018, 5 "sourceType": "module" 6 } 7}
Then you can add routes with an object:
1const AboutRoute = { 2 load: () => import(/* webpackChunkName: "aboutPage" */ '../pages/about/about'), 3 element: 'about-page', 4 path: '/about', 5 activeRoute: this.activeRoute 6};
with the element:
1<lazy-route .loader="${AboutRoute}"></lazy-route>
1import { html, LitElement } from 'lit'; 2import { connectRouter } from 'lit-redux-router'; 3import { connect } from 'pwa-helpers/connect-mixin.js'; 4import '@evergreen-wc/lazyroute'; 5 6// Create a redux store see: https://github.com/hutchgrant/evergreen-web-components/blob/master/docs/store.js 7import store from './store.js'; 8 9// Connect the redux store 10connectRouter(store); 11 12class MyComponent extends connect(store)(LitElement) { 13 14 // Initialize activeRoute 15 constructor() { 16 super(); 17 this.activeRoute = ''; 18 } 19 20 // Listen for redux changes 21 stateChanged(state) { 22 if (state.router.activeRoute !== this.activeRoute) { 23 this.activeRoute = state.router.activeRoute; 24 super.performUpdate(); 25 } 26 } 27 28 render() { 29 // Two lazy route example objects 30 const AboutRoute = { 31 load: () => import(/* webpackChunkName: "aboutPage" */ '../pages/about/about'), 32 element: 'about-page', 33 path: '/about', 34 activeRoute: this.activeRoute 35 }; 36 const DocsRoute = { 37 load: () => import(/* webpackChunkName: "docsPage" */ '../pages/docs/docs'), 38 element: 'docs-page', 39 path: '/docs', 40 loading: 'eve-test', // Optional custom loading component 41 activeRoute: this.activeRoute 42 }; 43 44 return html` 45 <div> 46 <!-- Regular lit route --> 47 <lit-route path="/" component="home-page"></lit-route> 48 <!-- Lazy loaded routes --> 49 <lazy-route .loader="${AboutRoute}"></lazy-route> 50 <lazy-route .loader="${DocsRoute}"></lazy-route> 51 </div> 52 `; 53 } 54} 55customElements.define('my-component', MyComponent);
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
122 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More