Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@core-design/components
Advanced tools
This repo leverages Lerna, a tool for managing multiple packages within the same repo.
Lerna takes the place of typical npm
and yarn
commands. For a full breakdown of lerna
commands, see the lerna readme
To start developing your Stencil project, run:
From root
:
lerna run start
To start developing your Stencil project in Storybook, run:
From root
:
lerna run storybook
Stencil components are plain ES6/TypeScript classes with some decorator metadata.
Create new components by creating files with a .tsx
extension, such as core-component.tsx
, and place them in src/components
.
import { Component, Prop, h } from "@stencil/core";
@Component({
tag: "core-component",
styleUrl: "core-component.css",
})
export class Component {
@Prop() first: string;
@Prop() last: string;
render() {
return (
<div>
Hello, my name is {this.first} {this.last}
</div>
);
}
}
To use this component, just use it like any other HTML element:
<core-component first="Stencil" last="JS"></core-component>
When creating new component tags, use the core-
prefix and kebab-case.
For example: core-button
, core-icon
, etc. Custom Elements must contain a dashed name so they do not collide with existing html element names.
The API for Stencil closely mirrors the API for Custom Elements v1.
Decorator | Description |
---|---|
@Component() | Indicate a class is a Stencil component. |
@Prop() | Creates a property that will exist on the element and be data-bound to this component. |
@State() | Creates a local state variable that will not be placed on the element. |
@Method() | Expose specific methods to be publicly accessible. |
View high level component example here
Web Components, specifically Custom Elements, are natively supported in Chrome and Safari and are coming to both Edge and Firefox. A dynamic polyfill loader is already included in order to only load the polyfills for the browsers that are missing specific features.
Stencil includes a subset of the core-js
polyfills for old browsers like IE11, fetch
and conditionally downloads the Custom Elements v1 only when it's needed for modern browsers (EDGE and old versions of Firefox.)
View IE11 polyfill details here
In addition, the following set of polyfills are also included:
Some modern browsers like Edge do not include native support for Web Components. In that case, we conditionally load the Custom Elements v1 polyfill.
FAQs
Core Design System Components
The npm package @core-design/components receives a total of 1 weekly downloads. As such, @core-design/components popularity was classified as not popular.
We found that @core-design/components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.