Closed Robot-Inventor closed 7 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
d993c7f
) to head (ee954cb
). Report is 3 commits behind head on main.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Welcome @Robot-Inventor! 👋 Thanks for sharing.
A few thoughts:
rehype
plugin on the hast
tree. More on the different ASTs https://unifiedjs.com/learn/defer
attribute https://github.com/Robot-Inventor/remark-auto-ads/blob/5e8ea804f42e39a8e238d7a39cd6a757c348f4fa/src/index.test.ts#L12-L14 (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script)module
is set to node16
or nodenext
the esModuleInterop
module should be removed, it will add unneeded cruft https://github.com/Robot-Inventor/remark-auto-ads/blob/5e8ea804f42e39a8e238d7a39cd6a757c348f4fa/tsconfig.json#L74Node
it will impact usage of other ASTs like HAST/MDX, this could be avoided entirely by working on a HAST tree (see first point). https://github.com/Robot-Inventor/remark-auto-ads/blob/5e8ea804f42e39a8e238d7a39cd6a757c348f4fa/src/index.ts#L40-L48Plugin<[RemarkAutoAdsOptions], Root>
https://github.com/Robot-Inventor/remark-auto-ads/blob/5e8ea804f42e39a8e238d7a39cd6a757c348f4fa/src/index.ts#L55^6.0.0
range. https://github.com/Robot-Inventor/remark-auto-ads/blob/5e8ea804f42e39a8e238d7a39cd6a757c348f4fa/package.json#L40@ChristianMurphy Thank you for your detailed review and suggestions!
esModuleInterop
optionI will try to see if I can rewrite it to the rehype plugin, so you may close this PR. Alternatively, I will report back to you if the rewrite is successful.
Also, since it is relatively common (at least in my country) to insert ads in the middle of an article, I don't think it is much of a problem.
Being a good idea and being common are two unrelated things. 🙂 Yes it is common in many countries. That doesn't change that it is disruptive to the reading flow and a bad user experience. 🤷
My repository uses the renovate bot so it may be "updated" if I change the version range. I'll look into the renovate configuration
renovate has a preset for this you can add to the extends
section ":preserveSemverRanges"
https://docs.renovatebot.com/presets-default/#preservesemverranges
Another note, plug-and-play package managers, notably pnpm
and yarn
will error if type dependencies which are part of the public interface, are not included in the dependencies
section of the package.
unified
and mdast
could trigger this condition https://github.com/Robot-Inventor/remark-auto-ads/blob/1846a79e662d7a5a85c208535f3a5e4a0d9898f6/src/index.ts#L2-L4
Being a good idea and being common are two unrelated things. 🙂 Yes it is common in many countries. That doesn't change that it is disruptive to the reading flow and a bad user experience. 🤷
On a personal level I fully agree. However, this choice is probably often some management decision. I think this plugin can be useful to developers who need to implement it.
That doesn't change that it is disruptive to the reading flow and a bad user experience. 🤷
Yes, as a reader, I don't really like advertisements in articles.🙁 But you have to balance user experience and revenue.
This plugin allows you to set the number of paragraphs to insert ads, so if you increase this value, you can balance user experience and revenue.
Being a good idea and being common are two unrelated things. 🙂 Yes it is common in many countries. That doesn't change that it is disruptive to the reading flow and a bad user experience. 🤷
On a personal level I fully agree. However, this choice is probably often some management decision. I think this plugin can be useful to developers who need to implement it.
Yes, it's mostly a management decision. This plugin maintains the user experience compared to Google's auto ads, which are difficult to control.
I successfully rewrote it to rehype plugin! (Also, I changed the renovate config and fixed dependencies section)
https://github.com/Robot-Inventor/rehype-auto-ads
The next step is to close this pull request and resubmit it to the rehype repository, right?
The next step is to close this pull request and resubmit it to the rehype repository, right?
Yes please
Understood. thank you!
Hi! This was closed. Team: If this was merged, please describe when this is likely to be released. Otherwise, please add one of the no/*
labels.
Initial checklist
Description of changes
Added remark-auto-ads to the documentation