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
Comments
Marked this as blocking #2388. |
Added this to the M3 milestone. |
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$ 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. |
Added TriageForM5 label. |
Nicolas, we chatted about the liblib prefix earlier. Here's a bug to go with that discussion. Removed this from the M5 milestone. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
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.
The text was updated successfully, but these errors were encountered: