@lonelyplanet/dotcom-core
This package is meant to house some of our more common UI and shared libs across dotcom applications.
Last updated a year ago by lplabs .
Original npm · Tarball · package.json
$ cnpm install @lonelyplanet/dotcom-core 
SYNC missed versions from official npm registry.

Dotcom Core

This package is meant to house some of our more common UI and shared libs across dotcom applications.

Install

npm i

Build

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.

Regular imports

import { Toast } from "@lonelyplanet/dotcom-core";

export () => <Toast />;

Global Components

There are 2 parts to using global components.

Server Side Rendering

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="{&quot;foo&quot;:&quot;bar&quot;}"
>
  <div data-reactroot=""><!-- your component --></div>
</div>

Client Side

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.

Local Development

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" />

Current Tags

  • 2.14.0                                ...           latest (a year ago)

125 Versions

  • 2.14.0                                ...           a year ago
  • 2.12.1                                ...           a year ago
  • 2.12.0                                ...           a year ago
  • 2.11.0                                ...           2 years ago
  • 2.10.0                                ...           2 years ago
  • 2.9.2                                ...           2 years ago
  • 2.9.1                                ...           2 years ago
  • 2.9.0                                ...           2 years ago
  • 2.8.11                                ...           2 years ago
  • 2.8.10                                ...           2 years ago
  • 2.8.9                                ...           2 years ago
  • 2.8.8                                ...           2 years ago
  • 2.8.7                                ...           2 years ago
  • 2.8.6                                ...           2 years ago
  • 2.8.5                                ...           2 years ago
  • 2.8.4                                ...           2 years ago
  • 2.8.3                                ...           2 years ago
  • 2.8.2                                ...           2 years ago
  • 2.8.1                                ...           2 years ago
  • 2.8.0                                ...           2 years ago
  • 2.7.11                                ...           2 years ago
  • 2.7.10                                ...           2 years ago
  • 2.7.9                                ...           2 years ago
  • 2.7.8                                ...           2 years ago
  • 2.7.7                                ...           2 years ago
  • 2.7.6                                ...           2 years ago
  • 2.7.5                                ...           2 years ago
  • 2.7.4                                ...           2 years ago
  • 2.7.3                                ...           2 years ago
  • 2.7.2                                ...           2 years ago
  • 2.7.1                                ...           2 years ago
  • 2.7.0                                ...           2 years ago
  • 2.6.25                                ...           2 years ago
  • 2.6.24                                ...           2 years ago
  • 2.6.23                                ...           2 years ago
  • 2.6.22                                ...           2 years ago
  • 2.6.21                                ...           2 years ago
  • 2.6.20                                ...           2 years ago
  • 2.6.19                                ...           2 years ago
  • 2.6.18                                ...           2 years ago
  • 2.6.17                                ...           2 years ago
  • 2.6.16                                ...           2 years ago
  • 2.6.15                                ...           2 years ago
  • 2.6.13                                ...           2 years ago
  • 2.6.12                                ...           2 years ago
  • 2.6.11                                ...           2 years ago
  • 2.6.10                                ...           2 years ago
  • 2.6.8                                ...           2 years ago
  • 2.6.7                                ...           2 years ago
  • 2.6.6                                ...           2 years ago
  • 2.6.5                                ...           2 years ago
  • 2.6.4                                ...           3 years ago
  • 2.6.3                                ...           3 years ago
  • 2.6.2                                ...           3 years ago
  • 2.6.1                                ...           3 years ago
  • 2.6.0                                ...           3 years ago
  • 2.5.5                                ...           3 years ago
  • 2.5.4                                ...           3 years ago
  • 2.5.3                                ...           3 years ago
  • 2.5.2                                ...           3 years ago
  • 2.5.1                                ...           3 years ago
  • 2.5.0                                ...           3 years ago
  • 2.4.2                                ...           3 years ago
  • 2.4.1                                ...           3 years ago
  • 2.4.0                                ...           3 years ago
  • 2.3.7                                ...           3 years ago
  • 2.3.6                                ...           3 years ago
  • 2.3.5                                ...           3 years ago
  • 2.3.4                                ...           3 years ago
  • 2.3.3                                ...           3 years ago
  • 2.3.2                                ...           3 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.0                                ...           3 years ago
  • 2.1.3                                ...           3 years ago
  • 2.1.2                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.20                                ...           3 years ago
  • 2.0.19                                ...           3 years ago
  • 2.0.18                                ...           3 years ago
  • 2.0.17                                ...           3 years ago
  • 2.0.16                                ...           3 years ago
  • 2.0.15                                ...           3 years ago
  • 2.0.14                                ...           3 years ago
  • 2.0.13                                ...           3 years ago
  • 2.0.12                                ...           3 years ago
  • 2.0.11                                ...           3 years ago
  • 2.0.10                                ...           3 years ago
  • 2.0.9                                ...           3 years ago
  • 2.0.8                                ...           3 years ago
  • 2.0.7                                ...           3 years ago
  • 2.0.6                                ...           3 years ago
  • 2.0.5                                ...           3 years ago
  • 2.0.4                                ...           3 years ago
  • 2.0.3                                ...           3 years ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.4.5                                ...           3 years ago
  • 1.4.4                                ...           3 years ago
  • 1.4.3                                ...           3 years ago
  • 1.4.2                                ...           3 years ago
  • 1.4.1                                ...           3 years ago
  • 1.4.0                                ...           3 years ago
  • 1.3.11                                ...           3 years ago
  • 1.3.10                                ...           3 years ago
  • 1.3.8                                ...           3 years ago
  • 1.3.7                                ...           3 years ago
  • 1.3.6                                ...           3 years ago
  • 1.3.5                                ...           3 years ago
  • 1.3.4                                ...           3 years ago
  • 1.3.3                                ...           3 years ago
  • 1.3.2                                ...           3 years ago
  • 1.3.1                                ...           3 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.2                                ...           3 years ago
  • 1.2.1                                ...           3 years ago
  • 1.2.0                                ...           3 years ago
  • 1.1.9                                ...           3 years ago
  • 1.1.8                                ...           3 years ago
  • 1.1.7                                ...           3 years ago
  • 1.1.6                                ...           3 years ago
  • 1.1.5                                ...           3 years ago
  • 1.1.4                                ...           3 years ago
  • 1.1.2                                ...           3 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 0
Last Month 4
Dependencies (26)
Dev Dependencies (4)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |