Skip to content

Conversation

@CFrez
Copy link
Contributor

@CFrez CFrez commented Jan 20, 2021

This resolves some issues with the rendering of latex. #2086 and #2556 are both resolved with this fix.

The existing react-katex package seems to have been abandoned 3 years ago. This switches to a newer react-katex package that was inspired by the first. The new package is what is currently recommended on the react-markdown page. This shows the difference between the two packages.

I manually tested the functionality of each issue:

#2086
2086

#2556
2556

Both pytest and jstest ran without problems.

While running the e2e test I did receive this failure:
disable widgets -- disconnects the client and disables widgets (failed)

I ran the e2e on the develop branch to compare and it seems to fail at different places. I am not sure if this is something with my setup or an ongoing issue. I am fairly confident that the issue is not within the changes proposed by this pull request.

Please let me know if there is a better way to test these changes and I can provide the update.

@CFrez CFrez requested a review from a team January 20, 2021 17:03
Copy link
Contributor

@akrolsmir akrolsmir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @RedFrez , thanks for your contribution! Really appreciated your explanations of why we're switching to this package and what we're gaining.

It does look like the st_markdown.spec.js needs a minor tweak (I'm amazed at that old misspelling, actually).

@CFrez
Copy link
Contributor Author

CFrez commented Jan 20, 2021

I was just tracking this down. it seems like whatever generated the MathML version spelled it wrong, and the test just matched it.

Screen Shot 2021-01-20 at 4 30 50 PM

LaTeX and TeX also had the same misspellings.

Screen Shot 2021-01-20 at 5 00 29 PM

All tests should pass now. The Block math didn't have this issues since it just had math.

@CFrez
Copy link
Contributor Author

CFrez commented Jan 21, 2021

@akrolsmir the current test that is failing is with st.file_uploader timed out. Is this a known flaky test? I am unable to rerun the test as the option is disabled for me.

@karriebear
Copy link
Contributor

karriebear commented Jan 21, 2021

I've triggered a rerun of the test but it should be fixed in the latest develop. If it fails again, could you try pulling latest in to see if it helps?

karriebear and others added 7 commits January 21, 2021 11:30
* Fix slider UX

* Add snapshot
* Revert "Deploy button front (streamlit#2552)"

This reverts commit 0f66b6e.

* Fix merge (erm... revert) conflict.

* Revert "Deploy button py (streamlit#2535)"

This reverts commit 0bbc7aa.

Co-authored-by: karrie <[email protected]>
…treamlit#2604)

* Add %u to list of valid number_input formatters

* Have number_input warn user of mismatched type and format string

* Use more modern f-string syntax instead of .format()
* Add and use sudoless machine id getter for metrics

Step 2 of the metrics user ID improvement plan.

* Add machine-id v3 tests

Duplicates of the v1 tests, since those covered the cases that remain in v3,
and we will remove v1 and its tests later.

Also fix formatting of some python files.

* DRY out machine ID paths into global constants
* Increase side padding to 5rem when app is in wide mode

* Upload Cypress snapshot
\streamlit#2395 ended up being caused by this since we don't rerender placeholder
components created by `st.empty()` when react props/state change as a
performance optimization, but we need to do so when replacing an
existing component with an empty one to get rid of what's currently
drawn on screen.

Closes streamlit#2395
Copy link
Contributor

@akrolsmir akrolsmir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, it looks like the latest merge has pulled in some unwanted files and the diff has ballooned as a result. Maybe you want to reset the git branch to before the merge, then pull in the latest develop? Something like:

git checkout latex
git reset --hard d3513118887a28a6765fe3998814a35bd08d009d
git merge upstream/develop
git push

@CFrez
Copy link
Contributor Author

CFrez commented Jan 22, 2021

@akrolsmir I flipped a coin between merge and rebase and I guess the wind blew it the wrong way.

Is there somewhere other than the main contributing page that has instructions about creating a pull request?

@akrolsmir
Copy link
Contributor

@akrolsmir I flipped a coin between merge and rebase and I guess the wind blew it the wrong way.

Is there somewhere other than the main contributing page that has instructions about creating a pull request?

Hm, I don't believe so, but we definitely should have one -- thanks for the suggestion!

Anyways, this PR looks great; that one test failure is another flake (it's been fixed in the latest develop, I think) so I'm just rerunning for now :P

Copy link
Collaborator

@kmcgrady kmcgrady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Great! Going to merge this in!

@kmcgrady kmcgrady merged commit 2152e2a into streamlit:develop Jan 25, 2021
tconkling added a commit to tconkling/streamlit that referenced this pull request Jan 25, 2021
* develop:
  Display a warning when not run via `streamlit run` (streamlit#2643)
  Extract a shared radio component for use within our UI (streamlit#2657)
  🔧 "Run on save" now defaults to true (streamlit#2641)
  Bump year to 2021 in license headers (streamlit#2654)
  Switched react-katex package (streamlit#2619)
  Don't add license headers for files in node_modules and cypress folders (streamlit#2655)
@CFrez CFrez deleted the latex branch January 27, 2021 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants