-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: VS code will now properly import operators, et al #6276
Conversation
attn @filipesilva ... we're getting errors from |
It does have me a little concerned that |
Yeah, I don't think we can get this fix into version 7 unless we're totally sure it's in the clear with everyone's bundlers. This is only to fix auto imports in VS Code... as crazy as that is. So just waiting to have some experts weigh in. Hopefully we don't need to restructure our entire build to get things working in VS Code. :\ |
FWIW, I did a small test with Rollup and the inclusion of the imports seems to make no difference to its output and tree shaking seems to work just fine. |
Unfortunately I got different results. I added a import '../dist/esm5_for_rollup/index.js'; Running the following on npx rollup@latest -i tmp/index.js -o tmp/master.js -f esm ...yielded a 48kb (unminified) file. I switched to this branch and it failed at first, because import './ajax';
import './fetch';
import './operators';
import './testing';
import './webSocket'; ...which Rollup chafes at (since native loaders don't handle directory imports). Appending |
Thank you so much, @Rich-Harris, for taking the time to look at this. So given this feedback, I think this PR is a no-go, and I'm going to close it. We're going to have to come up with another solution. |
- Adds typesVersions, enforcing TypeScript >= 4.2. - Adds some superfluous references required for TS and VS Code to find proper import locations for our strange deep import sites. - Independantly tested by building the package and installing it locally in another project, then testing in VS code. Fixes ReactiveX#6067 Related microsoft/TypeScript#43034
057aaf5
to
a1a46fd
Compare
All right, I've reopened this because there was another approach proposed by the TypeScript team, and it seems to be working! cc @cartant |
I've tested this with the methodology recommended by @Rich-Harris, and the output is identical between this branch and the master branch. So I think this is good to go. |
Fixes #6067
Related microsoft/TypeScript#43034
NOTE: I'm worried about the
check-side-effects
run here, because it can't seem to figure out what to make of it. However, tested against an Angular build locally, this branch didn't have any problems tree-shaking or removing dead code. Given the importance of people getting their imports right, and the DX around this, we might want to disablecheck-side-effects
if it causes us issues.