Gathering detailed insights and metrics for @postinumero/remix-react-intl
Gathering detailed insights and metrics for @postinumero/remix-react-intl
Gathering detailed insights and metrics for @postinumero/remix-react-intl
Gathering detailed insights and metrics for @postinumero/remix-react-intl
npm install @postinumero/remix-react-intl
Typescript
Module System
Node Version
NPM Version
@postinumero/react-router-oidc-client@0.3.1
Updated on Jul 06, 2025
@postinumero/react-router-formatjs@0.3.2
Updated on Jul 06, 2025
@postinumero/react-router-formatjs@0.3.1
Updated on Jul 06, 2025
@postinumero/react-router-formatjs@0.3.0
Updated on Jul 06, 2025
@postinumero/react-router-oidc-client@0.3.0
Updated on Jul 06, 2025
@postinumero/react-router-formatjs@0.2.5
Updated on Jun 16, 2025
TypeScript (83.85%)
JavaScript (15.01%)
Shell (0.55%)
HTML (0.33%)
CSS (0.26%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
4 Stars
390 Commits
1 Watchers
2 Branches
1 Contributors
Updated on Jul 10, 2025
Latest Version
0.2.11
Package Id
@postinumero/remix-react-intl@0.2.11
Unpacked Size
150.43 kB
Size
36.54 kB
File Count
151
NPM Version
11.3.0
Node Version
24.1.0
Published on
Jun 02, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
20
3
integrate FormatJS (react-intl) with Remix for internationalization in your project
To get started, configure your vite.config.ts
:
1// For Node.js versions below 22, install and import the polyfill: 2//import "core-js/proposals/promise-with-resolvers"; 3 4import remixReactIntl from "@postinumero/remix-react-intl/remixReactIntl"; 5import { vitePlugin as remix } from "@remix-run/dev"; 6import { defineConfig } from "vite"; 7import tsconfigPaths from "vite-tsconfig-paths"; 8 9const intl = await remixReactIntl(); 10 11export default defineConfig({ 12 plugins: [ 13 remix({ 14 presets: [intl.remixPreset], 15 // Enable SPA mode by setting ssr to false 16 // ssr: false, 17 }), 18 tsconfigPaths(), 19 intl.vitePlugin, 20 ], 21});
Next, update your .gitignore
file to exclude generated language files:
1# Server-side rendering (ssr) enabled 2/.compiled-lang 3# SPA mode (ssr: false) 4public/.compiled-lang 5 6/lang/en-default.json
Optional:
.eslintrc
:
1{ 2 "rules": { 3 "import/no-unresolved": [ 4 "error", 5 { "ignore": ["@postinumero/remix-react-intl/options"] } 6 ] 7 } 8}
tsconfig.json
:
1{ 2 "compilerOptions": { 3 "types": ["@postinumero/remix-react-intl"] 4 } 5}
You can use react-intl components and hooks as you normally would:
<FormattedMessage>
1import { FormattedMessage } from "react-intl"; 2 3// ... 4 5<FormattedMessage defaultMessage="Welcome to FormatJS (react-intl) + Remix" />;
useIntl
1import { useIntl } from "react-intl"; 2 3// ... 4 5const intl = useIntl(); 6 7intl.formatMessage({ defaultMessage: "Hello" });
intl
in Actions & LoadersIn Remix action
, loader
, clientAction
, and clientLoader
, you can access the intl
object (IntlShape
) via loadIntl
:
1import { loadIntl } from "@postinumero/remix-react-intl"; 2import { ClientActionFunctionArgs } from "@remix-run/react"; 3 4const clientAction = async (args: ClientActionFunctionArgs) => { 5 const intl = await loadIntl(args); 6 7 const successMessage = intl.formatMessage({ 8 defaultMessage: "Operation was successful!", 9 }); 10 11 // ... 12};
intl
in meta
FunctionsIn Remix meta
functions, you can access the intl
object (IntlShape
) via metaIntl
:
1import { metaIntl } from "@postinumero/remix-react-intl"; 2import { MetaFunction } from "@remix-run/react"; 3 4export const meta: MetaFunction = (args) => { 5 const intl = metaIntl(args); 6 7 // In SPA mode `intl` is `undefined` on first render 8 if (intl) { 9 return [ 10 { 11 title: intl.formatMessage({ 12 defaultMessage: "FormatJS (react-intl) example app | Remix", 13 }), 14 }, 15 ]; 16 } 17};
Default messages are automatically extracted to /lang/en-default.json
.
To add translations for other languages, manually create files in the /lang
directory (e.g., /lang/en.json
, /lang/en-GB.json
, /lang/fi-FI.json
). During the build process, messages are compiled. If a translation is missing, it falls back to the base language value or the default message if necessary.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
dependency not pinned by hash detected -- score normalized to 6
Details
Reason
9 existing vulnerabilities detected
Details
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More