![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
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.
@lonelyplanet/dotcom-core
Advanced tools
This package is meant to house some of our more common UI and shared libs across dotcom applications.
This package is meant to house some of our more common UI and shared libs across dotcom applications.
npm i
npm run build
Building this application generates 3 things, a dist
folder with commonjs modules, a dist-es
folder with ES Next modules, and lib
which contains webpack bundles for including core JS and CSS assets in other applications.
You can use dotcom-core in multiple ways.
import { Toast } from "@lonelyplanet/dotcom-core";
export () => <Toast />;
There are 2 parts to using global components.
Rendering components on the server side in an external application is simple.
// app/layout.tsx
import { ssr } from "@lonelyplanet/dotcom-core/dist/classes/runtime";
{ssr({ component: "globalautocomplete", props: { foo: "bar" } })}
There is a registry of components to choose from in src/registry
.
What the ssr
method does is render your component with renderToString
, and then calls renderToStaticMarkup
to generate something like...
<div
data-lpui-component="globalautocomplete"
data-lpui-component-props="{"foo":"bar"}"
>
<div data-reactroot=""><!-- your component --></div>
</div>
In order to mount the components on the client side, you can simply include the latest version of dotcom-core from s3.
<script async src="https://assets.staticlp.com/dotcom-core/1.0.0/core.min.js" />
<link rel="stylesheet" href="https://assets.staticlp.com/dotcom-core/1.0.0/core.css" />
We will also be regularly updating a https://assets.staticlp.com/dotcom-core/version.json
file on s3 so that a middleware can determine the latest version of the header and footer, and automatically inject the latest scripts.
npm run dev
This will run webpack
with hot mode enabled on localhost:8080
by default. You can then add the assets to dotcom-web
or any other application you're wanting to test simply with...
<script async src="http://localhost:8080/assets/core.js" />
<link rel="stylesheet" href="http://localhost:8080/assets/core.css" />
FAQs
This package is meant to house some of our more common UI and shared libs across dotcom applications.
We found that @lonelyplanet/dotcom-core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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.