Skip to content

Conversation

jonsequitur
Copy link
Contributor

@jonsequitur jonsequitur commented Jul 1, 2022

This PR updates the Microsoft.DotNet.Interactive.Documents API to more closely follow the .ipynb spec and observed behavior in Jupyter Lab. It also makes more concepts explicit in the API and makes it mutable so that creating documents incrementally is easier.

This addresses #2148.

@jonsequitur jonsequitur requested review from brettfo and colombod July 1, 2022 18:24
@jonsequitur jonsequitur force-pushed the documents-package-improvements branch from ed7150e to 408acca Compare July 1, 2022 23:38
@@ -23,10 +21,8 @@ static Serializer()
NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.AllowNamedFloatingPointLiterals,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
JsonSerializerOptions.Converters.Add(new ByteArrayConverter());
Copy link
Member

Choose a reason for hiding this comment

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

We need to keep this. When a notebook is saved it's sent back as a byte array, but serialized as a base64 string.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is in Microsoft.DotNet.Interactive, not Microsoft.DotNet.Interactive.Documents. I removed the reference from the former to the latter. I assume the only case where we need this is here?

JsonSerializerOptions.Converters.Add(new ByteArrayConverter());

@jonsequitur jonsequitur force-pushed the documents-package-improvements branch 4 times, most recently from 9444a83 to 8159c62 Compare July 14, 2022 16:23
@jonsequitur jonsequitur changed the title document model API tweaks, nullability document model API improvements Jul 14, 2022
@jonsequitur jonsequitur reopened this Jul 14, 2022
@jonsequitur jonsequitur force-pushed the documents-package-improvements branch from e20460a to 263d4f0 Compare July 15, 2022 18:36
@jonsequitur jonsequitur added the breaking change A pr that introduces a breaking change for users label Jul 16, 2022
@jonsequitur jonsequitur merged commit d61452d into dotnet:main Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change A pr that introduces a breaking change for users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants