Skip to content
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 support for frontmatter #390

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"tsconfig.json"
],
"dependencies": {
"gray-matter": "^4.0.3",
Copy link
Member

Choose a reason for hiding this comment

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

Can we potentially use an optional dependency somehow here? Nearly every user that use my plugin don't use frontmatter. You are the first case in 2-3 years.
Adding a direct dependency would result in not used content for thousands of users.

Copy link
Author

Choose a reason for hiding this comment

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

I might experiment, but gray-matter is a relatively small lib, so I don't know if it's worth the trouble...
What do you think?

j.langeveld@nicagini ~/git/github/jlangeveld/plugin-pug
> du -sh node_modules/gray-matter/
96K     node_modules/gray-matter/

[task/Make_frontmatter-parsing_optional]
j.langeveld@nicagini ~/git/github/jlangeveld/plugin-pug
> du -sh node_modules/
190M    node_modules/

Copy link
Member

Choose a reason for hiding this comment

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

It brings sub-dependencies with it... https://github.com/jonschlinkert/gray-matter/blob/a5726b04f3167fadc764241deb545518c454eb82/package.json#L36-L41
And these have sub-sub-deps and so on.

Copy link
Author

Choose a reason for hiding this comment

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

Oooooohhhhhhhh.... yes.
I should have realised.

j.langeveld@nicagini ~/git/github/gray-matter
> du -sh node_modules/
32M     node_modules/

I'll see what I can do.

"pug-lexer": "^5.0.0"
},
"devDependencies": {
Expand Down
Loading