nostalgie
Advanced tools
Changelog
[0.67.2] - 2021-01-28
./src/themes/OneDark.json
theme file into the ./dist/themes/
folder at build time so that it is readable by the mdx compilation worker at build-time.Changelog
[0.67.1] - 2021-01-28
@mdx-js/react
and workerpool
modules as install-time dependencies because we rely on being able to require.resolve()
their files at build-time.Changelog
[0.68.0] - 2021-02-01
Introduce nostalgie/styling
as a module through-which to deliver a styled-components-like experience. Right now, this is built on twind
and twind/css
. (#12)
This PR introduces support for (typed) styling of intrinsic HTML elements a la styled-components
with both the factory and explicit apis, respectively:
import { styled } from 'nostalgie/styling';
const Button = styled.button`
border: 1px solid rebeccapurple;
`;
import { styled } from 'nostalgie/styling';
const Button = styled('button')`
border: 1px solid rebeccapurple;
`;
Additionally, object syntaxes are supported, like:
import { styled } from 'nostalgie/styling';
const Button = styled({
border: '1px solid rebeccapurple',
});
React JSX files no longer need to import * as React from 'react'
as this will be injected automatically. Importing react in this way will have no harmful side-effects and may be considered optional. (#12)
tailwind.config.js
file is found in the root of the project. (#12)Changelog
[0.66.0] - 2021-01-27
Added authentication support to nostalgie via the nostalgie/auth
sub-package. (#7)
Nostalgie authentication currently provides for:
/.nostalgie/login?return_to
and /.nostalgie/logout?return_to
endpoints for logging in and logging out, respectively.ctx
argument via the .auth
property. High-level authentication status can be checked via ctx.auth.isAuthenticated
and when the user is authenticated, their authentication details can be found on ctx.auth.credentials.user
, ctx.auth.credentials.scope
and ctx.auth.credentials.claims
.useAuth()
hook exported from nostalgie/auth
. This hook returns the same form of authentication state as ctx.auth
in server functions. It can be used, for example, to render a user avatar or make decisions about which routes are available to users.To configure authentication, the following environment variables must either all be set or none must be set (in which case the auth module is disabled):
AUTH_ISSUER
- The OpenID issuer url, such as https://nostalgie.us.auth0.com. This URL will be used for automatic OpenID Connect discovery for further authentication configuration.
AUTH_CLIENT_ID
- The OpenID client identifier for the application ('client') configured for your Nostalgie app.
AUTH_CLIENT_SECRET
- The OpenID client secret for the application ('client') configured for your Nostalgie app. This is important to keep well protected. It will never be exposed to the front-end.
AUTH_COOKIE_SECRET
- The secret used to encrypt session state in an Iron-encoded token.
Added support for importing .css
files from JavaScript files. (#8)
Previously the return value of such imports was the url at which the generated CSS file could be found. The ergonomics of this were sub par; it wasn't possible to get Nostalgie to include these files in the initial page render so either there was a FOUC or a slower experience.
The community appears to have settled on the convention that importing a .css
file should have the side-effect of causing that css to be injected into the DOM. Nostalgie picks up on this convention and will inject the CSS at runtime for lazy-loaded chunks and will inject the CSS during SSR for chunks referenced in routes activated by the current path.
Usage:
// Cause the styles in 'style.css' to be loaded into the DOM at the earlier of:
// 1. SSR page generation when the importing file is referenced in the initial route.
// 2. Immediately once a lazy chunk is loaded via `.lazy()`.
import from './style.css';