visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Feat: Allow use of hash instead of hashbang #428

Closed w33ble closed 6 years ago

w33ble commented 6 years ago

This PR allows users to set the hashbang option to '#' in addition to true. This allows users to use a simple hash for routing, instead of just the hashbang.

Adds tests for using # (new functionality) and ## (invalid value, hashbang disabled).

I considered adding this functionality as a new option, and possibly renaming hashbang to hash or useHash, but going that far would be a breaking API change. This seemed simpler, but I'm open to changing how this functionality is exposed.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.2%) to 89.437% when pulling 82bc3f975a90d8dce8280a43dc3293fdf9ee8646 on w33ble:feat/custom-hash into 1034c8cbed600ea7da378a73716c885227c03270 on visionmedia:master.

w33ble commented 6 years ago

Someone else can pick this up if they'd like...

sonaye commented 6 years ago

Current workaround https://github.com/visionmedia/page.js/issues/332#issuecomment-166701658.