Skip to content

Remove code related to prepend and fix baselines#57472

Merged
sheetalkamat merged 9 commits into
mainfrom
prepend
Feb 28, 2024
Merged

Remove code related to prepend and fix baselines#57472
sheetalkamat merged 9 commits into
mainfrom
prepend

Conversation

@sheetalkamat

Copy link
Copy Markdown
Member
  • Removes all the APIs and call related prepend and corresponding tests
  • Fixed the tests that didnt depend on prepend
  • Also fixed issue with tsserver not baselining the version as FakeMajor.FakeMinor when the callbacks were baselined by passing around the logs

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 21, 2024
@typescript-bot

Copy link
Copy Markdown
Contributor

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up.

@sheetalkamat

Copy link
Copy Markdown
Member Author

Package size report

Overall package size

Before After Diff Diff (percent)
Packed 5.55 MiB 5.53 MiB -26.18 KiB -0.46%
Unpacked 30.86 MiB 30.72 MiB -143.91 KiB -0.46%

Files

Before After Diff Diff (percent)
lib/tsc.js 5.62 MiB 5.58 MiB -43.71 KiB -0.76%
lib/tsserver.js 8.24 MiB 8.19 MiB -45.31 KiB -0.54%
lib/typescript.d.ts 584.73 KiB 580.04 KiB -4.69 KiB -0.80%
lib/typescript.js 8.72 MiB 8.67 MiB -47.20 KiB -0.53%
lib/typingsInstaller.js 1.68 MiB 1.68 MiB -3.01 KiB -0.17%

Comment thread src/compiler/types.ts Outdated
@DanielRosenwasser

Copy link
Copy Markdown
Member

I feel a bit mixed - it's a little hard to read it casually (thanks GitHub), but what I want to know is:

  • will users still get an error message explaining why --prepend no longer works?
  • will the language service stop functioning correctly on projects using --prepend?

If the language service stops working, it means we'll be unable to browse the code of TypeScript 4.9 and earlier with TypeScript 5.5+.

@jakebailey

jakebailey commented Feb 21, 2024

Copy link
Copy Markdown
Member

If the language service stops working, it means we'll be unable to browse the code of TypeScript 4.9 and earlier with TypeScript 5.5+.

IIRC prepend only affected emit, so I would think that everything would still be browsable, but I have not checked myself.

@sheetalkamat

Copy link
Copy Markdown
Member Author

@jakebailey said it correctly.. this affects emit and it shouldnt impact the LS at all.
We do error that prepend is not supported but thats all. the actual functionality of prepending is removed now.

Comment thread src/compiler/types.ts
Comment thread src/compiler/types.ts
@jakebailey jakebailey mentioned this pull request Feb 26, 2024
{
name: "verbatimModuleSyntax",
type: "boolean",
affectsEmit: true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this belong in its own PR? Looks unrelated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was related to baseline i fixed so added it here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As part of 1012104 and c871a27

@sheetalkamat sheetalkamat merged commit f23927a into main Feb 28, 2024
@jdalton

jdalton commented Jul 11, 2024

Copy link
Copy Markdown

_FYI'ing: this broke wessberg/rollup-plugin-ts#227

@RyanCavanaugh

Copy link
Copy Markdown
Member

Noted. The removed API has been marked deprecated since 5.0 per #51909

@jdalton

jdalton commented Aug 21, 2024

Copy link
Copy Markdown

@RyanCavanaugh Thank you! Is there a suggested alternative API to createUnparsedSourceFile?

@RyanCavanaugh

Copy link
Copy Markdown
Member

The only (intended) legal thing to do with createUnparsedSourceFile was to put it into a Bundle, which no longer accepts that. I would just use a string instead if you were using it to ferry around unparsed sources.

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants