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

refactor: esm first #365

Closed
wants to merge 9 commits into from
Closed

Conversation

bennypowers
Copy link

@bennypowers bennypowers commented Nov 27, 2023

makes legacy cjs the special case
add package exports
fix some .d.ts tsc errors
closes #371

makes legacy cjs the special case
makes legacy cjs the special case
@bennypowers bennypowers mentioned this pull request Nov 27, 2023
@bennypowers
Copy link
Author

Sweet, I got PR number 365 😄

Copy link
Member

@mjradwin mjradwin left a comment

Choose a reason for hiding this comment

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

Use of exports in package.json is problematic for React projects. See issue #343

Also, we'd prefer (for now) to keep the rollup.config.js as is. We made an earlier attempt to convert from cjs to mjs format and had difficulties with the GitHub CI actions.

@bennypowers
Copy link
Author

:/ classic react: "we won't let you do the standard thing because we're cleverer than tc39 and whatwg"

@bennypowers
Copy link
Author

fwiw, i've dug plenty of teams out from under their mess of react nonsense, and it's possible to get a react app running with javascript written to standards shipped >2 years ago (export maps), it's just not as straightforward and pleasant as never having fallen for the react malarkey in the first place

@bennypowers
Copy link
Author

i'd like to suggest that if users can't use the thing which was ubiquitously shipped over two years ago because their framework is too crufty, that they should just use the old thing

@mjradwin
Copy link
Member

I'm trying to get this PR merged but it's failing on the test phase.

Possibly related to adding "type": "module" to the package.json file?

  Uncaught exception in src/sedra.spec.js

  Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/runner/work/hebcal-es6/hebcal-es6/src/hdate' imported from /home/runner/work/hebcal-es6/hebcal-es6/src/sedra.spec.js

Do you know how to fix this?

Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@bennypowers
Copy link
Author

Thanks for the ping. I ported all the import specs over and added import attributes, the tests now run in node 20. it may be possible to allow earlier node versions by building with rollup plugins.

several tests appear to fail with off-by-one errors

@mjradwin
Copy link
Member

Thanks for taking a look! It looks like Node 16 is no longer in LTS, but we're committed to supporting Node 18 through its LTS maintenance phase through April 2025. We'll work in as many of these patches as we can without breaking Node 18 and see if we can get to the finish line!

@bennypowers
Copy link
Author

bennypowers commented Dec 18, 2023

Sounds good. In that case I suggest that we add a build step which converts the JSON output from the .po files into JavaScript modules. This can be as simple as prepending export default to the first line and changing the file extension to .js

@mjradwin
Copy link
Member

All changes should now be in v5.0.3. Can you confirm that it's working for you and we can close this pull request?

@mjradwin mjradwin closed this Dec 26, 2023
@bennypowers bennypowers deleted the fix/500/esm-first branch December 26, 2023 16:26
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.

Cannot use with Typescript
2 participants