Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
lll-components
Advanced tools
This is a poc to:
have a component library for all web UI components.
Install yarn install wae-components@1.0.0
or from the repos url yarn install https://github.com/Lululemon/wae-components
Use it in your project!
// import it
import Page from 'wae-components/components/Page';
import Header from 'wae-components/components/Header';
// use it
const HomePage = () => (
<Page>
<Header
title="my title"
/>
</Page>
);
This renders static markup *per-*component
yarn export
this runs
"export": "node generate-static-markup.js"
and outputs html fragments based off of the partials to the markup
directory.
Example.*
Input src/component/Header.js
:
import React from "react";
export default class Header extends React.Component {
render(){
return <div>Hello Header</div>;
}
}
Output markup/Header.html
:
<div>Hello Header</div>
This can be use in many ways like some of the following.
Use case 1:
import React from "react";
import ReactDOM from "react-dom";
// these props will be the default props used with ssr and the static markup
const headerProps = {
title: "my title"
}
ReactDOM.render(<Page />, document.getElementById("page"));
ReactDOM.render(<Header {...headerProps}/>, document.getElementById("header"));
index.html should have:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Example App</title>
</head>
<body>
<section id="header"></section>
<section id="page"></section>
</body>
</html>
Use case 2:
const renderTemplate = ({
title,
Partials
}) => `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>${title}</title>
</head>
<body>
${Partials.Header}
${Partials.Page}
</body>
</html>
)`
import renderTemplate from './renderTemplate'
app.use('*', (req,res)=>{
const myTemplate = renderTemplate({
title: "my title",
Partials
})
res.send(myTemplate)
})
FAQs
WAE Component Library
We found that lll-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.