PATCh future development options

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
javascript, python
領域
frontend, web-dev

調査の方向性

まず、現在のフロントエンド構成、docs/_data/apps.yml、および VS Code 拡張機能の統合を読みます。提案されている 3 つのアプローチを比較し、複数ファイルのアプリ、URL の共有、将来の stlite の保守に対する影響を含めて検討します。合意されたスコープで実装方針を選択し、文書化できれば完了です。

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

説明

enhancement

Here are some thoughts on what can be done to improve patch down the line and the relevant implications of each possibility.

We currently render a web app by pointing the original stlite platform (https://share.stlite.net/) to one python file alongside with the requirements, something like this:

https://share.stlite.net/#url=<script_url>?req=<package_1>&req=<package_2>

That makes it impossible to split a big app into multiple files or to import functions from other files. There are many ways we can allow for such a thing, and I’m going to list some of the possibilities that I thought off here, in order of "how much work/time it might take". All of this implementations will require an adapation of the vscode extension as well.

1 – Mount the apps directly in our repo - not very time consuming.

He can render the apps directly in our frontend and point to multiple files. For that, we would need to add some javascript to our current setup and modify the apps.yml file structure a little bit. We would dynamically generate something like this:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, shrink-to-fit=no"
    />
    <title>stlite app</title>
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/@stlite/[email protected]/build/stlite.css"
    />
  </head>
  <body>
    <div id="root"></div>
    <script src="https://cdn.jsdelivr.net/npm/@stlite/[email protected]/build/stlite.js"></script>
    <script>
      stlite.mount(
        {
          entrypoint: "streamlit_app.py",
          files: {
            "streamlit_app.py": {
              url: "https://raw.githubusercontent.com/data-to-insight/patch/main/apps/000_intro.py",
            },
            "util.py": {
              url: "https://raw.githubusercontent.com/data-to-insight/patch/main/util.py",
            },
          },
        },
        document.getElementById("root")
      );
    </script>
  </body>
</html>
2 - hash the code directly into the url - some time required.

The original stlite sharing platform also accepts an hashed version of the entire code in the url. This makes it possible to render whatever files we want and also to share an app directly with that url. The problem is that we end up with a very long url for each app - which can be too long to share among some platforms. It would also require us to add the functionality to transform the entire apps code into the hash - which might be time consuming.

3 – Have our own version of stlite running - large amount of time required.

We are using a package maintained by mainly one person (stlite). We are uncertain on how it will progress in the future. It might be a good idea to have an independent version of stilte adapted to our needs. That would also bring flexibility on making the proper adjustments to our requirements.

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

環境構築

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

はじめの一歩

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

data-to-insight/patch のほかの issue

data-to-insight/patch の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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