
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
MDN's next fr(ont)e(n)d.
.env-dist
to .env
and updatenpm install
npm run start
npm run start
NODE_ENV=production
to run rari with the preview server, you'll need to have run npm run build
firstnode --env-file=.env --run rari -- serve
npm run dev
and npm run preview
npm run dev
npm run build
npm run preview
to worknpm run preview
We need to run some JS as soon as possible at page load, to avoid layout shifts and flashes.
We place this JS in entry.inline.js
, and it's inlined on page load.
Rspack also generates the necessary CSP hash when doing a prod build with npm run build
.
See the layout README.
We have a basic sandbox for testing and styling components in isolation at http://localhost:3000/sandbox
To add a component to the sandbox, add a sandbox.js
file to the component, which exports a class named like MyComponentSandbox
which extends the SandboxComponent
exported from components/sandbox/class.js
.
components/
folder, with reserved names which cause certain behavior, explained further below:
component-name/
global.css
- (reserved): automatically added to global styleselement.js
- (reserved): custom element, automatically imported client side, always imported server sideelement.css
- (recommended): styles for custom element's shadow domserver.js
- (reserved): server component, will automatically load the adjacent server.css
file when usedserver.css
- (reserved): automatically added to page styles when its server component is used in that pageglobal.css
: components which have CSS which should be loaded on all pages should expose that through a global.css
file:
mdn-component-name { display: block; }
or similarelement.js
: custom elements should be defined in components/component-name/element.js
MDNComponentName
HTMLElement
class names, and added to ACRONYMS
in build/plugins/generate-element-map.js
to allow the correct types to be generatedmdn-component-name
import()
types/element-map.d.ts
to provide proper types in e.g. querySelector("mdn-component-name")
server.js
: server components should be defined in components/component-name/server.js
ServerComponent
from components/server/index.js
, and be named ComponentName
server.css
: server component styles should be placed in components/component-name/server.css
ServerComponent
is used
// @ts-expect-error
so we get an error when we fix the error and don't leave unnecessary // @ts-ignore
comments lying around. While we're in active development these can lack a comment, but eventually we'll require an explanatory comment on each.If our server side rendered custom elements are different to the initial state of our custom elements when rendered client side, Lit will error out during hydration, stopping the execution of our client side JS.
To avoid this, don't compute things that are server/client dependent in connectedCallback
(or run functions which do this). Instead you must run these in firstUpdated
(despite the warning lit will raise in development about the element scheduling an update after an update completed).
This issue is tracked upstream: https://github.com/lit/lit/issues/1434
FAQs
MDN's next fr(ont)e(n)d.
We found that @mdn/fred demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.