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

dart2js: stable naming for library prefixes #8044

Open
rakudrama opened this issue Jan 22, 2013 · 9 comments
Open

dart2js: stable naming for library prefixes #8044

rakudrama opened this issue Jan 22, 2013 · 9 comments
Labels
area-web Issues related to Dart Web. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@rakudrama
Copy link
Member

Library private names appear to be prefixed with _liblib$ or _liblibN$ where N is a small number. This naming scheme is sensitive to small perturbations in the source code.

That 'lib' occurs twice is a bit odd. I believe the LIBRARY_PREFIX is used twice, perhaps accidentally.

The name would be much more stable if it was derived from the library tag.
The tag can be compound, "library dart.collections;" has a name 'dart.collections'. This could be canonicalized to an identifier by replacing non-identifier characters with '_' and possibly truncating long names, preferably at a word boundary.

Libraries with the same tag could be made canonical by visiting libraries in source or uri order before other naming.

@rakudrama
Copy link
Member Author

Marked this as blocking #2388.

@kasperl
Copy link

kasperl commented Jan 28, 2013

Added this to the M3 milestone.

@rakudrama
Copy link
Member Author

What I think we should so here:

First time the namer is asked to name a library, gets all the libraries, sorts them in source order and walks through them making up names for library prefixes.

As described above, the library tags e.g "library html;" and "lib dart.collection.dev" could be converted into prefixes, e.g _lib_html$ and _lib_dart_collection_dev$
If there is no tag, take the tail of the URI.

Generate private names by prepending the prefix and hashing off of that. _lib_html$_foo -> Qx with some consistency and won't get beat out by another _foo when the import order changes.

@anders-sandholm
Copy link
Contributor

Removed this from the M3 milestone.
Added this to the M4 milestone.

@kasperl
Copy link

kasperl commented Apr 22, 2013

Removed this from the M4 milestone.
Added this to the M5 milestone.

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Nicolas, we chatted about the liblib prefix earlier. Here's a bug to go with that discussion.


Removed this from the M5 milestone.
Added this to the Later milestone.
Removed TriageForM5 label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed triaged labels Feb 29, 2016
@vsmenon vsmenon added the area-web Issues related to Dart Web. label Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Issues related to Dart Web. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

5 participants