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
chore: remove external from config #4355
Merged
lukastaegert
merged 15 commits into
rollup:master
from
dnalborczyk:rollup-config-external
Jan 21, 2022
Merged
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
73eddfd
chore: remove external from config
dnalborczyk 6fe43ae
simplify named imports
dnalborczyk fa4c5b7
nits
dnalborczyk 4a5fa73
fix: mark fsevents as external
dnalborczyk f413cb8
fix: set interop to default
dnalborczyk 2ef6c5b
Revert "fix: mark fsevents as external"
dnalborczyk 668ef16
chore: bump chokidar
dnalborczyk 36dc97b
simplify alias plugin params
dnalborczyk 64c0d06
Revert "Revert "fix: mark fsevents as external""
dnalborczyk 1a156d5
add bogus types for fsevents
dnalborczyk 46fc2e8
exclude fsevents from import linting
dnalborczyk b1e7f71
add back comment
dnalborczyk 7bf3aab
bump typescript
dnalborczyk f58a3f7
re-use env var
dnalborczyk 68f992d
Merge branch 'master' into rollup-config-external
lukastaegert File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering why
fsevents
wasn't a problem but it turns out since you extracted theconstant in
fsevents-importer.ts
, the dynamic import can no longer be resolved by Rollup, which is why it does not need to be marked as external. Which is fine. But this also means, we can simplify theinterop
option below tointerop: "default"
and get rid of the function.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"defaultOnly" is just a stricter version of "default", so if "defaultOnly" works, "default" works as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the dynamic import back to
fsevents
, but it's failing onwindows
andlinux
as it seemsrollup
is trying to loadfsevents
nonetheless, which fails [since it's also not installed]: https://github.com/rollup/rollup/runs/4876116960?check_suite_focus=true is this a possible bug?I'll revert for the time being.
Done.
speaking of
fsevents
, also bumpedchokidar
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And did you also add "fsevents" back to the
external
option? Because that is why it was here and why I originally though that externals should be an array containing just "fsevents".Which I think is ok, i.e. to have your dependencies as "external". We could also employ a technique here used by many other plugins that just import their "package.json" file in their "rollup.config.js" and directly use package.dependencies as input for their
external
option. That way it "auto-updates" should we ever have additional dependencies.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is the TypeScript plugin complaining, not Rollup. Of course you would need to teach TypeScript about the missing dependency. That was the reason why we had
in
declarations.dts
, but you did not like that in the past and removed it. You could just add it back, maybe this time with a comment why we have it here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOH! 🤦 it got late 😆 ... and confusing, having
fsevents
installed on my mac with build and tests passing and having the failure only on windows/linux, wherefsevents
including type information is missing.with this PR: #4219 it's possible that the previously used [older?] typescript plugin wasn't quite working, but by bumping it to the newer version the typescript error came up:
from the PR description:
Description bumps rollup-plugin-typescript to latest @rollup/plugin-typescript. there appears to be a problem with the fsevents module and types under linux/windows, as those are optional deps and only installed on macOS. I had to use an any type to get around the typing problem. I'm not sure why and how it worked previously. 🤔
48a11b4
but changed it afterwards by just making the import parameter a variable.
I checked the history, I [believe] I didn't remove those typings, but let me try if that would work as well on the mac when
fsevents
(plus typings) is actually installed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I just checked one level of history and you are right 😉