From b7fdb7fc6882c0d1ac39331573c828697a6e2a74 Mon Sep 17 00:00:00 2001 From: Nathan LeRoy Date: Wed, 17 Jan 2024 12:20:50 -0500 Subject: [PATCH 1/3] browser compatibility --- web/index.html | 1 + web/package.json | 5 +++-- web/src/components/markdown/render.tsx | 2 +- web/src/main.tsx | 4 ---- web/src/pages/About.tsx | 3 --- web/src/pages/about.mdx | 7 +++++++ web/vite.config.ts | 9 ++++++++- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/web/index.html b/web/index.html index 471770f9..065c4230 100644 --- a/web/index.html +++ b/web/index.html @@ -3,6 +3,7 @@ + diff --git a/web/package.json b/web/package.json index 3722e7be..536366ae 100644 --- a/web/package.json +++ b/web/package.json @@ -12,6 +12,7 @@ "dependencies": { "@handsontable/react": "^12.3.3", "@hookform/error-message": "^2.0.1", + "@mapbox/rehype-prism": "^0.9.0", "@mdx-js/react": "^3.0.0", "@monaco-editor/react": "^4.4.6", "@popperjs/core": "^2.11.6", @@ -31,7 +32,6 @@ "handsontable": "^12.3.3", "jwt-decode": "^3.1.2", "prettier": "^2.8.8", - "prismjs": "^1.29.0", "react": "^18.2.0", "react-bootstrap": "^2.7.2", "react-cookie": "^4.1.1", @@ -44,6 +44,8 @@ "react-papaparse": "^4.1.0", "react-router-dom": "^6.9.0", "react-select": "^5.7.2", + "rehype-highlight": "^7.0.0", + "rehype-slug": "^6.0.0", "remark": "^14.0.3", "remark-breaks": "^3.0.3", "remark-gfm": "^3.0.1", @@ -56,7 +58,6 @@ "devDependencies": { "@mdx-js/rollup": "^3.0.0", "@trivago/prettier-plugin-sort-imports": "^4.1.1", - "@types/prismjs": "^1.26.3", "@types/react": "^18.0.28", "@types/react-dom": "^18.0.11", "@vitejs/plugin-react-swc": "^3.0.0", diff --git a/web/src/components/markdown/render.tsx b/web/src/components/markdown/render.tsx index 50c406ef..e342ba4e 100644 --- a/web/src/components/markdown/render.tsx +++ b/web/src/components/markdown/render.tsx @@ -1,4 +1,4 @@ -import { FC, useEffect, useState } from 'react'; +import { FC } from 'react'; import { ReactMarkdown } from 'react-markdown/lib/react-markdown'; import remarkBreaks from 'remark-breaks'; import remarkGfm from 'remark-gfm'; diff --git a/web/src/main.tsx b/web/src/main.tsx index 8b993d0a..f34fa5e4 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -8,8 +8,6 @@ import 'handsontable/dist/handsontable.full.min.css'; // Language // handsontable stuff import { registerAllModules } from 'handsontable/registry'; -import * as Prism from 'prismjs'; -import 'prismjs/components/prism-python'; import React from 'react'; import ReactDOM from 'react-dom/client'; import { HelmetProvider } from 'react-helmet-async'; @@ -29,8 +27,6 @@ import { EidoValidator } from './pages/Validator'; registerAllModules(); -Prism.highlightAll(); - const queryClient = new QueryClient({ defaultOptions: { queries: { diff --git a/web/src/pages/About.tsx b/web/src/pages/About.tsx index c3d4a1bb..74f7cdf2 100644 --- a/web/src/pages/About.tsx +++ b/web/src/pages/About.tsx @@ -1,10 +1,7 @@ import { MDXProvider } from '@mdx-js/react'; -import * as Prism from 'prismjs'; import AboutContent from './about.mdx'; -Prism.highlightAll(); - export const About = () => { return ( diff --git a/web/src/pages/about.mdx b/web/src/pages/about.mdx index d1b06da9..c489a481 100644 --- a/web/src/pages/about.mdx +++ b/web/src/pages/about.mdx @@ -119,4 +119,11 @@ import { PageLayout } from '../components/layout/page-layout'; You can find more information about pephubclient of github page. [https://github.com/pepkit/pephubclient](https://github.com/pepkit/pephubclient) + ### Browser compatibility + We use [browserslist](https://github.com/browserslist/browserslist) to maintain a list of browsers that we support. Currently, PEPhub supports the `defaults` configuration: + ``` + > 0.5%, last 2 versions, Firefox ESR, not dead + ``` + For a comprehensive list of browser compatibility, please visit the [browserslist site](https://browsersl.ist/#q=defaults). + diff --git a/web/vite.config.ts b/web/vite.config.ts index 46410442..c10064ec 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -1,11 +1,18 @@ import mdx from '@mdx-js/rollup'; import react from '@vitejs/plugin-react-swc'; import browserslistToEsbuild from 'browserslist-to-esbuild'; +import rehypeHighlight from 'rehype-highlight'; +import rehypeSlug from 'rehype-slug'; import { defineConfig } from 'vite'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [mdx(), react()], + plugins: [ + mdx({ + rehypePlugins: [rehypeSlug, rehypeHighlight], + }), + react(), + ], build: { target: browserslistToEsbuild(), }, From 54740a8448acb55884da331ee2f32b32b6a30a4d Mon Sep 17 00:00:00 2001 From: Nathan LeRoy Date: Wed, 17 Jan 2024 12:22:57 -0500 Subject: [PATCH 2/3] bump version --- docs/changelog.md | 6 ++++++ web/package.json | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 9e5db922..afba15b5 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,6 +2,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format. +## [0.11.2] - 01-17-2024 + +### Added + +- Add section to `/about` discussing browser support + ## [0.11.1] - 01-17-2024 ### Added diff --git a/web/package.json b/web/package.json index 536366ae..bde94480 100644 --- a/web/package.json +++ b/web/package.json @@ -12,7 +12,6 @@ "dependencies": { "@handsontable/react": "^12.3.3", "@hookform/error-message": "^2.0.1", - "@mapbox/rehype-prism": "^0.9.0", "@mdx-js/react": "^3.0.0", "@monaco-editor/react": "^4.4.6", "@popperjs/core": "^2.11.6", From 44decc0b3394e41ad2c69a93c00f9acd5f87cbda Mon Sep 17 00:00:00 2001 From: Nathan LeRoy Date: Wed, 17 Jan 2024 12:25:57 -0500 Subject: [PATCH 3/3] save _version.py this time --- pephub/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pephub/_version.py b/pephub/_version.py index fee46bd8..e2bd0728 100644 --- a/pephub/_version.py +++ b/pephub/_version.py @@ -1 +1 @@ -__version__ = "0.11.1" +__version__ = "0.11.2"