-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add metadata version #11479
Comments
External metadataThere are a few reasons to have the metadata inside the file as we do now:
I think that each of these reasons could be (or already has been) addressed without needing the metadata to be part of the file. Moving the metadata out of the file would enable large efficiency improvements--for example, it removes the need for the format to be text-safe. AtomicityAtomicity is less of a concern now that the metadata format is resilient--if the metadata and the source file end up slightly out of sync (e.g. due to a sudden process exit), this should cause little or no disruption to metadata usability. TransparencyThe metadata format has never been very human-readable; we can probably address this use case better with improved tooling. PortabilityPortability can be achieved without keeping all the data in the file; we just need unique file IDs:
In the metadata database, we would look up metadata primarily by file-id. Each file-id would have one "origin" FS path; if we find a file-id at a different path, we read the data according to the claimed file-id, then we assign a new ID for the new path--this way copies would share data when initially read, but evolve independently. This approach would allow metadata to "follow" moved or copied files as well as it does now, within a local filesystem. It wouldn't work when sending a file between computers, but the IDE cannot operate on one file in isolation anyway; users already need to import/export project, in which case we could include metadata in the project file. Side-note: Comment typeIf we want metadata to be ignored by the parser without the parser needing to recognize it specifically, a doc comment (starting with |
I'd rather move forward by smaller steps. E.g. versioning and (being a) comment to begin with any other changes later.
OK, so what do you suggest? Is: #*** META-DATA 2.0 ***#
[json1...]
[json2...] better? |
My twopenny:
Of course, we can solve those problems, but I personally I don't see any efficiency improvements so large it would justify the effort. |
@jdunkerley told me that there is a problem:
My 2 Kč fix:
|
A particular case of this problem is tracked by #11742 |
Is there anything to be done during the metadata change to allow future changes to not break ability of old IDE to read the metadata partially? Would removing of the metadata handling from the Rust parser side and letting the Ydoc server to do all such work help? What if Ydoc server uses proper |
It's exactly as it's done now AFAIK.
It actually does. The problem with #11742 was not that new fields were added, but rather some old field was removed. And older version of ydoc server. So I was able to make a fix to develop: PR's incoming.
Yes, I think it is a good idea. I think we need to finally discuss all the versioning and compatibility topics after this release. |
Extracted from the #11390 (comment)
Issue
Add version to the metadata section of the file. Implementation could be
Separate section
Relates to the whole metadata section. Can change the way the rest of the metadata is parsed.
Encoded in METADATA string
Same as the previous but different encoding.
Extend the metadata
Semantically relates to the last metadata line but does not require changing the parser.
Make the METADATA section a comment
Make the metadata section an Enso comment since we're changing the parser anyway.
The text was updated successfully, but these errors were encountered: