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

Define exports to support native ES Modules and tree shaking, and discourage unsupported entry points #277

Closed
wants to merge 596 commits into from

Conversation

FossPrime
Copy link
Contributor

@FossPrime FossPrime commented Jun 17, 2021

This is a major semver change.

Migration

  • require('csv/lib/sync') to require('csv/sync')
  • require('csv/lib') to require('csv')

No changes required in the following situations

  • require('csv')
  • import csv from 'csv'
  • import csv from 'csv'; const { parse } = csv

New options, with "type": "module" packages and from mjs scripts:

  • import { parse } from 'csv'
  • import parse from 'csv/sync'

Reproduction:
https://runkit.com/hesygolu/60cab0ebed19ef001a500480

Related issues:
#207
#264
#276
adaltas/node-csv-parse#320

@FossPrime FossPrime changed the title split the exports to support native ES Modules, tree shaking and named imports in ES Modules Define exports to support native ES Modules and tree shaking, and discourage unsupported entry points Jun 17, 2021
@wdavidw wdavidw closed this Jun 21, 2021
@vicary
Copy link

vicary commented Jun 22, 2021

That's one way to solve it 😄

@wdavidw
Copy link
Member

wdavidw commented Jun 22, 2021

Hum, I didn't notice our monorepo migration closed this issue, and I can't re-open it. I am however working on it since last week on my spare time and will get it done at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.