Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vocab/cli

Package Overview
Dependencies
Maintainers
4
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vocab/cli - npm Package Compare versions

Comparing version 0.0.16 to 1.0.0

16

CHANGELOG.md
# @vocab/cli
## 1.0.0
### Major Changes
- [`3031054`](https://github.com/seek-oss/vocab/commit/303105440851db6126f0606e1607745b27dd981c) [#51](https://github.com/seek-oss/vocab/pull/51) Thanks [@jahredhope](https://github.com/jahredhope)! - Release v1.0.0
Release Vocab as v1.0.0 to signify a stable API and support future [semver versioning](https://semver.org/) releases.
Vocab has seen a lot of iteration and changes since it was first published on 20 November 2020. We are now confident with the API and believe Vocab is ready for common use.
### Patch Changes
- Updated dependencies [[`0074382`](https://github.com/seek-oss/vocab/commit/007438273ef70f5d5ded45777933651ad8df36f6), [`3031054`](https://github.com/seek-oss/vocab/commit/303105440851db6126f0606e1607745b27dd981c)]:
- @vocab/core@1.0.0
- @vocab/phrase@1.0.0
## 0.0.16

@@ -4,0 +20,0 @@

6

package.json
{
"name": "@vocab/cli",
"version": "0.0.16",
"version": "1.0.0",
"main": "dist/vocab-cli.cjs.js",

@@ -13,4 +13,4 @@ "module": "dist/vocab-cli.esm.js",

"@types/env-ci": "^3.1.0",
"@vocab/core": "^0.0.11",
"@vocab/phrase": "^0.0.11",
"@vocab/core": "^1.0.0",
"@vocab/phrase": "^1.0.0",
"env-ci": "^5.0.2",

@@ -17,0 +17,0 @@ "fast-glob": "^3.2.4",

@@ -5,30 +5,27 @@ # Vocab

## Getting started
Vocab helps you ship multiple languages without compromising the reliability of your site or slowing down delivery.
### Step 1: Install Dependencies
- Shareable translations
Vocab is a monorepo with different packages you can install depending on your usage, the below list will get you started using the cli, React and webpack integrations.
Translations are co-located with the components that use them. Vocab uses the module graph allowing shared components to be installed with package managers like npm, just like any other module.
```bash
$ npm i --save @vocab/cli @vocab/react @vocab/webpack
```
- Loading translations dynamically
### Step 2: Setup Webpack plugin
Vocab only loads the current user's language. If the language changes Vocab can load the new language behind the scenes without reloading the page.
Before starting to write code you'll need to setup webpack to understand how to use `translation.json` files.
- Strongly typed with TypeScript
This is done using the **VocabWebpackPlugin**.
When using translations TypeScript will ensure code only accesses valid translations and translations are passed all required dynamic values.
**webpack.config.js**
## Getting started
```js
const VocabWebpackPlugin = require('@vocab/webpack').default;
### Step 1: Install Dependencies
module.exports = {
...,
plugins: [new VocabWebpackPlugin({})]
}
Vocab is a monorepo with different packages you can install depending on your usage, the below list will get you started using the cli, React and webpack integrations.
```bash
$ npm i --save @vocab/cli @vocab/react @vocab/webpack
```
### Step 3: Configure Vocab
### Step 2: Configure Vocab

@@ -117,4 +114,21 @@ You can configure Vocab directly when calling the API or via a `vocab.config.js` file.

### Step 6: Optimize for fast page loading
### Step 6: [Optional] Setup Webpack plugin
Right now every language is loaded into your web application all the time, which could lead to a large bundle size. Ideally you will want to switch out the Node/default runtime for web runtime that will load only the active language.
This is done using the **VocabWebpackPlugin**. Applying this plugin to your client webpack configuration will replace all vocab files with a dynamic asynchronous chunks designed for the web.
**webpack.config.js**
```js
const { VocabWebpackPlugin } = require('@vocab/webpack');
module.exports = {
...,
plugins: [new VocabWebpackPlugin()]
}
```
### Step 7: [Optional] Optimize for fast page loading
Using the above method without optimizing what chunks webpack uses you may find the page needing to do an extra round trip to load languages on a page.

@@ -121,0 +135,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc