medialize / medialize/URI.js

Fragments: allow fragmentPrefix to define the entire delimiter

Open
#166 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Fragment
Dominant language
JavaScript
Stars
6.2k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Bear with my pseudo-code for the sake of example. fragmentPrefix currently behaves something like this

var _rootPrefix = '#';
var _actualPrefix = _rootPrefix;

function fragmentPrefix( value ){
  _actualPrefix = _rootPrefix + value;

  var parts = this.toString().split( _actualPrefix );
  var uriProper = parts[ 0 ];
  var fragment = parts[ 1 ];
}

The way I'd like to see this work is to eliminate what I've called _rootPrefix above and just delimit with the supplied value. This would allow my current use case of working with Mithril, whose default SPA routing mode is to split on the search ?.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the fragmentPrefix implementation and compare its current delimiter handling with the pseudo-code in the issue. Verify that a supplied value such as ? can act as the complete delimiter, including the Mithril routing use case, and confirm the existing fragment behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.