Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Implement legacy collections using glob #11976
Implement legacy collections using glob #11976
Changes from 50 commits
6cfa42d
c2f48aa
dd20f95
0e9b54c
1ff97b4
305a756
9585b5a
181c950
f47c6ba
b4f14ea
3967012
072dd7e
75c7181
9d371a1
1a27f35
e14090a
77b7815
bb15ef5
e42c4b0
8b7dc59
ab7918a
57127ff
5d1684e
032ce4f
f48be22
f337838
ec2fcb0
0aebf32
b0cb038
8f2e3fe
a7cccef
a030814
67a4253
e1b9491
5200a5d
7add932
869dc3a
505b426
850c3e9
81be579
5339675
8280450
3da71b4
99c823a
5c6e428
ce2c486
9d0d306
c8e19ed
6f4bab0
a8bf7aa
0e310e9
5fb9247
266da4d
e0b211e
7ebcf58
7318f1c
bd9a5f5
4eae23f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 am honestly having a hard time making sense of this from a usage/what happens to my existing project standpoint:
src/content/
that do not match my collections insrc/content/config.ts
. Wouldn't that have already caused a problem for me?I think the "what would make this a problem for someone to warrant even saying anything here?" question is the biggest one I have.
I get that you can now autogenerate collection schemas in certain cases, but existing legacy projects probably already have schemas? (So focusing on ones that don't is distracting when that's not most people's experience.) Is not having a schema the only time this surfaces as a problem? And if so, what fixes that: not having a mix of both old and new collections?
It is also OK to instruct people that "If condition X applies to you, you must now do X" if that is the happy path. These collections will be phased out eventually anyway. They don't need to know workarounds, or things that might be OK for a while. Just decide what you want them to do and tell them they need to do it. If other stuff happens to be possible, that's fine. This is to help people deal with a breaking change in the most straightforward way possible.
For example, if you want to straight up say that you simply can't mix new and legacy collections in a project anymore: that's fine! Say that this is the point at which you either update all your collections accordingly, or you enable the legacy flag if you're unable to do so yet. That is what the flag is for! That is very easy advice to follow, and doesn't require parsing a lot of "if" cases.
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.
Thanks! I've rewritten this whole section. The reason I included this behaviour at all is because I do see a lot of people using these auto-generated collections without config. I didn't want everything to break as they upgraded, and I don;t want them to just immediately enabled the legacy flag! Adding this fallback behaviour helped get us to working with most sites, while also loudly warning that they should upgrade.
The only reason I've included the fact that it exists in the docs is because of the scenario where it works, but then stops working if they add new collections. I want the behaviour to be:
I'd love your thoughts on how best to communicate this (or if you think this is totally the wrong approach anyway)
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.
Is this not supported in content layer in general?
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.
No. It's one of the things I missed. It'll be tough to do, because of the fact we don't transform it into an object until runtime.
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.
Sounds like something we should talk about, I think this is pretty widely used.