Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: export commonjs and esm from package #59

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

Merged
lukasholzer merged 3 commits into main from feat/provide-cjs-package
Oct 11, 2023

Conversation

Copy link
Contributor

@lukasholzer lukasholzer commented Oct 11, 2023

🎉 Thanks for sending this pull request! 🎉

To support our old CommonJS packages like the next-runtime export both commonjs and ESM.
Full discussion is here: https://netlify.slack.com/archives/C05DNT7CLFK/p1696930990204579

cc @ascorbic @orinokai @pieh

Copy link

netlify bot commented Oct 11, 2023
edited
Loading

Deploy Preview for blobs-js ready!

Name Link
🔨 Latest commit 4dc45d4
🔍 Latest deploy log https://app.netlify.com/sites/blobs-js/deploys/6526ac903f786900084a9ccc
😎 Deploy Preview https://deploy-preview-59--blobs-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Oct 11, 2023
Copy link
Contributor

@Skn0tt Skn0tt left a comment
edited
Loading

Choose a reason for hiding this comment

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

The approach looks good. These ESM migrations typically break something, so i'd encourage you to publish this as a prerelease first (or yolo it, as you prefer).

Just calling out that this change starts bundling in all dependencies. Shouldn't be a problem as long as the dependencies aren't big, but this will probably break for more involved dependencies, like when there's native code. (but I think esbuild was already doing that before? plus this needs to work in edge functions as well.)

lukasholzer reacted with thumbs up emoji
Copy link
Contributor Author

lukasholzer commented Oct 11, 2023
edited
Loading

On the bundling part you are completely right. Next goal is to get rid of p-map as it's an esm only dependency then we would have 0 deps which is good IMHO
I did already two pre releases: and on publint all looks good

https://publint.dev/@netlify/blobs@2.1.0-rc.2

CleanShot 2023年10月11日 at 16 17 59

and types as well: https://arethetypeswrong.github.io/?p=%40netlify%2Fblobs%402.1.0-rc.2

CleanShot 2023年10月11日 at 16 18 11

import { rm } from 'node:fs/promises'
import { argv } from 'process'

// eslint-disable-next-line import/no-extraneous-dependencies
Copy link
Member

@eduardoboucas eduardoboucas Oct 11, 2023

Choose a reason for hiding this comment

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

Why is this an extraneous dependency?

Copy link
Contributor Author

@lukasholzer lukasholzer Oct 11, 2023

Choose a reason for hiding this comment

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

because it's a dev dependency 🤷 the lint rule is crazy.

Eslint does not know that we don't need it as dependency:

'tsup' should be listed in the project's dependencies. Run 'npm i -S tsup' to add iteslintimport/no-extraneous-dependencies

@eduardoboucas eduardoboucas deleted the feat/provide-cjs-package branch October 24, 2023 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@eduardoboucas eduardoboucas eduardoboucas left review comments

+1 more reviewer

@Skn0tt Skn0tt Skn0tt approved these changes

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /