diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..b1d5640d --- /dev/null +++ b/CHANGELOG.md @@ -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) diff --git a/packages/beemo-dev/configs/lerna.ts b/packages/beemo-dev/configs/lerna.ts index 5fd05fa5..09ccd2f2 100644 --- a/packages/beemo-dev/configs/lerna.ts +++ b/packages/beemo-dev/configs/lerna.ts @@ -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; diff --git a/packages/beemo-dev/package.json b/packages/beemo-dev/package.json index e2db08e7..4bec979e 100644 --- a/packages/beemo-dev/package.json +++ b/packages/beemo-dev/package.json @@ -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", diff --git a/packages/cli/package.json b/packages/cli/package.json index c9bbe82d..ad166e70 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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": { @@ -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", @@ -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": { diff --git a/packages/core/package.json b/packages/core/package.json index 72d5a3f1..df44a309 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -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", diff --git a/packages/create-goji-app/package.json b/packages/create-goji-app/package.json index b16ed83c..3bacdc71 100644 --- a/packages/create-goji-app/package.json +++ b/packages/create-goji-app/package.json @@ -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", diff --git a/packages/demo-todomvc-linaria/package.json b/packages/demo-todomvc-linaria/package.json index e3e22b90..144b3ccd 100644 --- a/packages/demo-todomvc-linaria/package.json +++ b/packages/demo-todomvc-linaria/package.json @@ -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", @@ -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", @@ -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", diff --git a/packages/demo-todomvc/package.json b/packages/demo-todomvc/package.json index 0470df53..0412d627 100644 --- a/packages/demo-todomvc/package.json +++ b/packages/demo-todomvc/package.json @@ -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", @@ -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", @@ -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", diff --git a/packages/goji.js.org/website/blog/2022-02-22-gojijs-v1.md b/packages/goji.js.org/website/blog/2022-02-22-gojijs-v1.md new file mode 100644 index 00000000..c42dcba8 --- /dev/null +++ b/packages/goji.js.org/website/blog/2022-02-22-gojijs-v1.md @@ -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` 命令。 diff --git a/packages/goji.js.org/website/package.json b/packages/goji.js.org/website/package.json index 5780a17c..2c1bd41b 100644 --- a/packages/goji.js.org/website/package.json +++ b/packages/goji.js.org/website/package.json @@ -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", diff --git a/packages/macro/package.json b/packages/macro/package.json index 939136c9..2e017bd1 100644 --- a/packages/macro/package.json +++ b/packages/macro/package.json @@ -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", @@ -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" }, diff --git a/packages/testing-library/package.json b/packages/testing-library/package.json index d948d8f3..3669f3cd 100644 --- a/packages/testing-library/package.json +++ b/packages/testing-library/package.json @@ -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": { @@ -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" diff --git a/packages/webpack-plugin/package.json b/packages/webpack-plugin/package.json index dc1aa1f0..83662723 100644 --- a/packages/webpack-plugin/package.json +++ b/packages/webpack-plugin/package.json @@ -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", @@ -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",