An open API service indexing awesome lists of open source software.

https://github.com/imerkle/fbt_runtime

Runtime for Facebook fbt
https://github.com/imerkle/fbt_runtime

facebook fbt framework i18n internationalization javascript

Last synced: about 1 year ago
JSON representation

Runtime for Facebook fbt

Awesome Lists containing this project

README

          

# Installation

Install `yarn add git+https://github.com/imerkle/fbt_runtime.git`

# Setup

Put your `translatedFbts.json` in `src/` folder.

Resolve the module in webpack. The files are in `/dist/`

```
modules: [
path.resolve(__dirname, './node_modules/fbt_runtime/dist/'),
path.resolve(__dirname, './node_modules/fbt_runtime/dist/shared'),
path.resolve(__dirname, './node_modules/fbt_runtime/dist/shared/FbtNumber'),
path.resolve(__dirname, './node_modules/fbt_runtime/dist/nonfb'),
path.resolve(__dirname, './node_modules/fbt_runtime/dist/nonfb/mocks'),
'./node_modules',
],
```

# Usage

```
const fbt = require("fbt")

hello

```

I have modified original script to work for typescript since it only took *.js files. But you need to add this to `types/global.d.ts` to remove warnings form ts compiler.

```
declare module JSX {
interface IntrinsicElements {
"fbt": any
}
}
```