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
- Host: GitHub
- URL: https://github.com/imerkle/fbt_runtime
- Owner: imerkle
- Created: 2019-01-18T19:44:35.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-20T15:53:08.000Z (about 7 years ago)
- Last Synced: 2025-01-11T03:21:23.612Z (about 1 year ago)
- Topics: facebook, fbt, framework, i18n, internationalization, javascript
- Language: JavaScript
- Homepage: https://github.com/facebookincubator/fbt/
- Size: 130 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
}
}
```