-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interoperability for Stipple.JSONText and JSON.JSONText #227
Conversation
@hhaensel is DataFrames a dependency of Stipple now? Is it just for testing? If it's for testing, last time I checked the best practice was to set up a distinct project in the |
Same for |
AFAIK there are two ways of including packages for testing. One is defining a separate [extras]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[targets]
test = ["Test", "DataFrames", "JSON", "OffsetArrays"] I took this practice from the Extensions docs for the case that we want to support old julia versions which do not support extensions. isdefined(Base, :get_extension) ? (using Contour) : (using ..Contour) Let's see whether I can get that running. |
Here are the docs for test-specific dependencies. |
Thanks for the link. I thought the "old" way was deprecated and was concerned that the dependencies would leak into the package installation. Looks like it's still recommended - though I haven't tested exactly how and when are test deps installed with the current approach, hopefully only when running tests. |
I think I remember, why the target-approach is used for Requires-compatibility. If you want to set compat entries for your weak dependencies old versions of Julia will complain if the packages are not listed either under [deps] or [extras]. |
Hmmm... ok. I can't remember though, why do we have table rendering in Stipple? Shouldn't it be in StippleUI? |
The answer is, we don't. The file StippleTablesExt.jl is mainly empty and never used. It's probably a left over from early testing. |
@essenciary should we merge this? We could handle improved extension management in a separate PR. EDIT: I decided that it is better to separate things into two PRs. As soon as this one is merged we can make another PR to merge hh-extension2 |
Meanwhile, I released StipplePlotly 0.13.9 where rendering of Stipple.JSONText is at least fixed for the particular case of PlotlyBase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried a few apps and they all work as expected. I think we can merge.
Perfect! Don't trigger new release yet, there's another PR in the pipeline. |
Only after fixing handling of Stipple.JSONText in StipplePlotly I understood the root cause of the error.
It is that Stipple's definition of
JSONText
for JSON3 doesn't interoperate with JSON's definition, but PlotlyBase's JSON3-rendering is calling JSON behind the scenes. Therefore,Stipple.JSONText("test")
is rendered as"{\"s\": \"test\"}
This PR adds all necessary methods to JSON3 and JSON to grant interoperability of the JSONText definitions so that
Respective tests are added to
runtests.jl
So if in future some component adds JSON3 rendering via a JSON fallback, we are save to use our
Stipple.JSONText
.