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

es5 bundles export some strange mangled (internal?) symbols, that are picked up by IDE autocomplete #16583

Closed
Necroskillz opened this issue May 5, 2017 · 4 comments
Labels
area: packaging Issues related to Angular's creation of npm packages freq3: high P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent state: confirmed type: bug/fix
Milestone

Comments

@Necroskillz
Copy link

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
The es5 bundles export some strange mangled (internal?) symbols. VS Code picks up typings from *.es5.js I guess, and you get this in intellisense:

router_symbols_bug

If you import { ɵa } from '@angular/router' it compiles.

Expected behavior
Looks like these are internal symbols, so either the bundle shouldn't expose them, or the editor should be forced to use .d.ts files.

Minimal reproduction of the problem with instructions

  • ng new app
  • open in VS Code
  • import { ɵa } from '@angular/router'

Please tell us about your environment:
Windows 10

  • Angular version: 4.1.1
  • Browser: all

  • Language: [ES5 / TS 2.3]

@matsko matsko added the area: packaging Issues related to Angular's creation of npm packages label May 6, 2017
@IgorMinar
Copy link
Contributor

The prefixed symbols are indeed private (see documentation). The must be exported because they are being used by the code generated by the AOT compiler.

Typescript currently doesn't support another way of hiding these symbols, so we prefixed them with "barred latin O" to group them together and make them appear at the bottom of the sorted list displayed by IDE autocompletion. It's not ideal, but it doesn't seem that we have another way of doing this right now.

@IgorMinar
Copy link
Contributor

This is still an issue, and after seeing people struggle with it quite a bit, I think we need to find a way to tackle it. There are some new options we have since the last time I commented on this.

One way would be to mark those symbols as internal so that they don't appear in d.ts files at all, and are available only at runtime. Another way would be to use a side channel in a form of a private entry point to share those symbols across packages.

@jelbourn jelbourn added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed severity3: broken labels Oct 1, 2020
@alxhub
Copy link
Member

alxhub commented Mar 30, 2024

Closing as this isn't really reported much as an issue anymore - likely due to Ivy not generating random private symbols for user code.

@alxhub alxhub closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2024
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: packaging Issues related to Angular's creation of npm packages freq3: high P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent state: confirmed type: bug/fix
Projects
None yet
Development

No branches or pull requests

6 participants