Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

remove client side URL rewrites

オープン
#53 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
frontend, web-dev

調査の方向性

app.js の ?qs= URL を構築するリダイレクトから開始し、次に issue で説明されているクライアント側の URL 書き換えと version-dropdown の動作を調べます。1.6/dijit/Calendar パスを含む dojo-api-data の生成ページを比較し、permalink URL が選択したバージョンを保持し、dapi パスを使用し、dropdown が同期された状態になることを確認します。

索引モデルが issue の本文から書いたものです。

説明

If I select 1.4 in the dropdown and bring up dijit/Calendar, then click the Permalink, the URL bar goes to https://dojotoolkit.org/api/?qs=1.4/dijit/Calendar. Happens for 1.3 〜 1.7.

Two issues:

  • Ideally it would be https://dojotoolkit.org/dapi/1.10/dijit/Calendar.html rather than using the URL query string (question mark syntax).
  • The URL switched from referencing dapi to api. I guess that won't be an issue when this is deployed for real, but probably indicates some underlying problem.

This problem is leftover effect from when we were serving pages statically and the rewrite was happening in client-side javascript. By turning off javascript and clicking the Permalink URL (and then view source) I can see:

<script type="text/javascript">
  // If user loads this page directly, redirect to index page, with parameter to initially show tab for this module.
  // If google loads this page directly it will hopefully ignore this script and just index the documentation below.
  // Also, when this page is loaded via XHR this script block should be ignored.
  location = "/api/?qs=1.10/dijit/_OnDijitClickMixin" + location.hash;

</script>

I remember having a perl script that added those <script> blocks but now I can't find the check-in. I don't see those script blocks [anymore] either in https://github.com/wkeese/dojo-api-data/tree/master/1.6/dijit/Calendar, so I'm confused.

There's also this code in app.js:

// rewite the url to the ?qs= parm, meaning all legacy permalinked docs are still loaded via XHR.
// the only other option is dynamically including the html in the template which wouldn't be good for performance
// TODO: the .html extension is an issue, here im stripping it (compared to legacyfilelocation), this is also mirrored in the client JS (and FWIW apache)
res.redirect(301, config.contextPath + '?qs=' + requestedVersion + '/' + modulefile.replace(/\./g, "/"));

A related issue is that after doing the above, the dropdown says 1.10 instead of 1.4, even though the tree is showing 1.4. Selecting 1.10 in the dropdown list manually now has no effect. (But I can get back to the 1.10 tree by selecting 1.9 first, then selecting 1.10).

主要言語
CSS
スター
11
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

dojo/dapi のほかの issue

dojo/dapi の issue をすべて見る

似ている issue

Web Dev の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。