HISTORY.md 片段
- v1.8a1 - January 19 2013
- Pass options to
init()as json is now supported - Added unicode demo demo/unicode.html
- Introduced
getCurrentIndex(), so you can get previous state byHistory.getStateByIndex(getCurrentIndex()-1)
- Pass options to
该版本通过[demo/unicode.html](https://link.gitcode.com/i/0ee83f3883abf139785a799a032e003c)展示了中文路径的URL处理能力,解决了#64、#107等长期存在的编码问题。
## 版本控制工具链
### 版本变更追踪
History.js采用[HISTORY.md](https://link.gitcode.com/i/3b04dc938d86f9dd87eec864617a7fbf)作为权威变更日志,每条记录包含:
- 版本号与发布日期
- 新功能列表(如v1.7.0添加的Amplify.js数据持久化)
- 问题修复记录(如v1.8b2修复的#305哈希参数错误)
- 贡献者名单(使用@用户名标注)
### 构建版本管理
项目通过CoffeeScript源码生成不同环境的发布包:
- **开发版本**:[buildr-uncompressed.coffee](https://link.gitcode.com/i/32e3abcc253e2d4d290a4afe4f64dfde)生成未压缩脚本
- **生产版本**:[buildr.coffee](https://link.gitcode.com/i/80444b019134aaf9e18e9ee7bed723c5)生成压缩版本
- **适配器版本**:针对不同框架生成独立包,如[jquery.history.js](https://link.gitcode.com/i/a87ee432aca99f15e416b02f05434ff2)
## 破坏性更新处理策略
### 兼容性保障机制
当必须进行不兼容变更时,History.js采用渐进式策略:
1. **提前预告**:在次版本中标记废弃API,如v1.7.0中预告将在v2.0移除HTML4支持
2. **双重实现**:同时保留新旧API,如v1.8中同时支持`History.pushState`与传统hash操作
3. **详细文档**:在[README.md](https://link.gitcode.com/i/56a609e846cda1b0460cb83563883696)中明确标注兼容性变更,如:
```markdown
# README.md 兼容性说明
- **B/C BREAK:** The `statechange` event now only fires if the state has changed; it no longer fires on page initialisation.
版本迁移指南
从v1.7升级到v1.8的关键步骤:
- 检查HISTORY.md中v1.8a1至v1.8b2的所有变更记录
- 替换HTML4适配器引用路径:
<!-- 旧路径 --> <script src="scripts/html4/history.js"></script> <!-- 新路径 --> <script src="scripts/bundled/html4+html5/native.history.js"></script> - 测试tests/html4+html5.native.html确保兼容性
版本控制最佳实践
版本号决策流程图
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考



