Skip to content

Commit

Permalink
add docs for v1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
malash committed Feb 17, 2022
1 parent 0d6c47c commit 9ff8d21
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 25 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Change Log

# v1.0.0 (2022-02-22)

### Features

- **core:** Support React 17 [#90](https://github.com/airbnb/goji-js/pull/90)

- **cli:** Upgrade to Webpack 5 [#22](https://github.com/airbnb/goji-js/pull/22)

- **linaria:** Support Linaria 2 [#42](https://github.com/airbnb/goji-js/pull/42)

- **testing-library:** Support Testing Library

- **cli:** Support `nohoist` option to reduce main package bundle size
[#120](https://github.com/airbnb/goji-js/pull/120)
2 changes: 1 addition & 1 deletion packages/beemo-dev/configs/lerna.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config: LernaConfig = {
packages: ['packages/*', 'packages/goji.js.org/*'],
npmClient: 'yarn',
useWorkspaces: true,
version: '1.0.0-alpha.16',
version: '1.0.0',
};

export default config;
2 changes: 1 addition & 1 deletion packages/beemo-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@goji/beemo-dev",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "Beemo Config for GojiJS Development",
"main": "src/index.ts",
"repository": "https://github.com/airbnb/goji-js.git",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@goji/cli",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "GojiJS CLI",
"main": "dist/cjs/index.js",
"bin": {
Expand All @@ -23,7 +23,7 @@
"@babel/preset-env": "^7.16.5",
"@babel/preset-react": "^7.16.5",
"@babel/preset-typescript": "^7.16.5",
"@goji/webpack-plugin": "^1.0.0-alpha.16",
"@goji/webpack-plugin": "^1.0.0",
"babel-loader": "^8.2.1",
"babel-plugin-macros": "^3.1.0",
"css-loader": "^6.5.1",
Expand All @@ -49,7 +49,7 @@
"yargs": "^17.1.0"
},
"devDependencies": {
"@goji/core": "^1.0.0-alpha.16",
"@goji/core": "^1.0.0",
"@types/yargs": "^17.0.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@goji/core",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "GojiJS Core",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-goji-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-goji-app",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "Create GojiJS App",
"main": "index.js",
"repository": "https://github.com/airbnb/goji-js",
Expand Down
8 changes: 4 additions & 4 deletions packages/demo-todomvc-linaria/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "demo-todomvc-linaria",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "GojiJS Linaria Example",
"main": "index.js",
"repository": "git+https://github.com/airbnb/goji.git",
Expand All @@ -13,7 +13,7 @@
"build": "goji build"
},
"dependencies": {
"@goji/core": "^1.0.0-alpha.16",
"@goji/core": "^1.0.0",
"classnames": "^2.2.6",
"core-js": "^3.16.0",
"linaria": "^2.3.0",
Expand All @@ -23,8 +23,8 @@
"tslib": "^2.3.0"
},
"devDependencies": {
"@goji/cli": "^1.0.0-alpha.16",
"@goji/testing-library": "^1.0.0-alpha.16",
"@goji/cli": "^1.0.0",
"@goji/testing-library": "^1.0.0",
"@types/classnames": "^2.2.10",
"@types/css-modules": "^1.0.0",
"@types/react": "^17.0.31",
Expand Down
12 changes: 6 additions & 6 deletions packages/demo-todomvc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "demo-todomvc",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "GojiJS TodoMVC Example",
"main": "index.js",
"repository": "git+https://github.com/airbnb/goji.git",
Expand All @@ -13,8 +13,8 @@
"build": "goji build"
},
"dependencies": {
"@goji/core": "^1.0.0-alpha.16",
"@goji/macro": "^1.0.0-alpha.16",
"@goji/core": "^1.0.0",
"@goji/macro": "^1.0.0",
"classnames": "^2.2.6",
"core-js": "^3.16.0",
"linaria": "^2.3.0",
Expand All @@ -24,9 +24,9 @@
"tslib": "^2.3.0"
},
"devDependencies": {
"@goji/beemo-dev": "^1.0.0-alpha.16",
"@goji/cli": "^1.0.0-alpha.16",
"@goji/testing-library": "^1.0.0-alpha.16",
"@goji/beemo-dev": "^1.0.0",
"@goji/cli": "^1.0.0",
"@goji/testing-library": "^1.0.0",
"@types/classnames": "^2.2.10",
"@types/css-modules": "^1.0.0",
"@types/react": "^17.0.31",
Expand Down
52 changes: 52 additions & 0 deletions packages/goji.js.org/website/blog/2022-02-22-gojijs-v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: GojiJS v1.0 发布
author: Chong Ma
authorURL: http://github.com/malash
authorImageURL: https://avatars2.githubusercontent.com/u/1812118?s=460&v=4
---

GojiJS 是由 Airbnb(爱彼迎)开发的小程序前端框架,于 2020 年 06 月开源。经过了近一年半的迭代和测试各
项功能日趋稳定,因此决定发布 GojiJS v1.0 版本。

# 主要变化

GojiJS 提供了对最新前端生态的支持,包括:

## 支持 React 17 框架

GojiJS 支持使用最新的 React 17 进行开发,GojiJS 推荐使用
[Hooks](https://reactjs.org/docs/hooks-intro.html) 和函数式组件开发。

> 暂不支持实验中的[concurrent mode](https://zh-hans.reactjs.org/docs/concurrent-mode-intro.html)
## 使用基于 Webpack 5 的构建工具

GojiJS 的构建工具 `@goji/cli`
[从 Webpack 4 升级到了 Webpack 5](https://github.com/airbnb/goji-js/pull/22),后者提供更好的兼容性和
性能。在大型项目中,开发模式下每次代码后的构建构建时间缩短了约 85%(数据来自 Airbnb 内部项目)。

## 使用 CSS-in-JS 开发

GojiJS 默认支持 Linaria 2,推荐使用 [CSS-in-JS 开发](https://goji.js.org/docs/en/css-in-js) 。这样可
以更好的组织代码,并且提供了更多的样式灵活性。同时因为 Linaria 是“零运行时”的,因此非常适合小程序的
开发场景。

## 编写单元测试

GojiJS 支持使用流行的 [Testing Library 编写单元测试](https://goji.js.org/docs/en/testing)。在大型项
目中,通过编写规范的单元测试可以有效的提升代码质量,提高代码可维护性。

## 优化打包体积

小程序中的“分包加载”是一种常见的打包体积优化方式,GojiJS 在此基础上做了更加极致的优化。新加入的
[`nohoist` 参数优化](http://goji.js.org/docs/en/sub-packages) 可以有效减少主包体积,避免因体积限制原
因导致无法发版。

# 升级方法

> 由于 v0.x 版本为不稳定版本,建议进行全新安装。
1. 推荐方法:参考[安装](https://goji.js.org/docs/en/setup)文档进行全新安装。

2. 手动方法:升级 `package.json` 中所有 `@goji/` 开头的包到 `^1.0.0` 版本,并重新运行 `npm`
`yarn` 命令。
2 changes: 1 addition & 1 deletion packages/goji.js.org/website/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "goji.js.org",
"private": true,
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"scripts": {
"examples": "docusaurus-examples",
"start": "docusaurus-start",
Expand Down
6 changes: 3 additions & 3 deletions packages/macro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@goji/macro",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "GojiJS binding for babel-plugin-macros",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand All @@ -25,8 +25,8 @@
"tslib": "^2.3.0"
},
"devDependencies": {
"@goji/core": "^1.0.0-alpha.16",
"@goji/webpack-plugin": "^1.0.0-alpha.16",
"@goji/core": "^1.0.0",
"@goji/webpack-plugin": "^1.0.0",
"@types/babel-plugin-macros": "^2.8.5",
"react": "^17.0.2"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/testing-library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@goji/testing-library",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "GojiJS Testing Library",
"main": "dist/cjs/index.js",
"scripts": {
Expand All @@ -24,7 +24,7 @@
"react": "*"
},
"devDependencies": {
"@goji/core": "^1.0.0-alpha.16",
"@goji/core": "^1.0.0",
"@types/lodash": "^4.14.172",
"@types/react-test-renderer": "^17.0.1",
"react": "^17.0.2"
Expand Down
4 changes: 2 additions & 2 deletions packages/webpack-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@goji/webpack-plugin",
"version": "1.0.0-alpha.16",
"version": "1.0.0",
"description": "GojiJS Webpack Plugin",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand All @@ -14,7 +14,7 @@
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@goji/core": "^1.0.0-alpha.16",
"@goji/core": "^1.0.0",
"@types/common-tags": "^1.8.1",
"@types/enhanced-resolve": "^3.0.7",
"@types/find-cache-dir": "^3.2.1",
Expand Down

0 comments on commit 9ff8d21

Please sign in to comment.