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

README.md expand import examples #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

mb21
Copy link

@mb21 mb21 commented May 7, 2024

Proposal to expanded the README to what I was looking for to get started. Feel free to change.

I was also not sure what this sentence means:

Because the Iterator.prototype methods depend on a receiver (the this value), the main export in each subdirectory takes the string to operate on as the first argument.

Does it relate to explicit imports instead of shimming or is it an implementation detail?

@ljharb
Copy link
Member

ljharb commented May 8, 2024

It means that instead of forcing you to do, eg, require('es-iterator-helpers'/Iterator.prototype.drop').call(iterator, count), you'd do require('es-iterator-helpers'/Iterator.prototype.drop')(iterator, count). "The string" there is a mistake; it should be "the iterator".

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

This is fine, but if you're using node you need to be able to look at either CJS or ESM examples and implicitly understand how to convert one to the other.

@mb21
Copy link
Author

mb21 commented May 8, 2024

Right, I mean I figured it out eventually what the require path was relative to, how to convert CJS to ESM and which module executed the shims automagically. But all three together were a bit many hurdles for my taste, hence this PR.

I pushed two commits (to make CI pass and to fix the typo you mentioned), so now it's ready to merge I think.

@ljharb
Copy link
Member

ljharb commented May 8, 2024

Removing evalmd is like deleting tests - the benefit of having an ESM example is much much smaller than the benefit of guaranteeing readme examples are correct.

That said, i think evalmd has an html comment way to ignore specific code blocks, so that might work here.

@mb21 mb21 force-pushed the patch-1 branch 2 times, most recently from c634ca0 to 231f4db Compare May 12, 2024 08:26
@mb21
Copy link
Author

mb21 commented May 12, 2024

Done...

Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.00%. Comparing base (698cef7) to head (231f4db).
Report is 6 commits behind head on main.

❗ Current head 231f4db differs from pull request most recent head ae0b60c. Consider uploading reports for the commit ae0b60c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #6      +/-   ##
==========================================
- Coverage   89.71%   89.00%   -0.71%     
==========================================
  Files          86       86              
  Lines        1011     1019       +8     
  Branches      135      127       -8     
==========================================
  Hits          907      907              
- Misses        104      112       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

README.md Outdated Show resolved Hide resolved
@ljharb ljharb added the documentation Improvements or additions to documentation label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants