Skip to content

Conversation

mosuem
Copy link
Contributor

@mosuem mosuem commented Jul 9, 2025

Merge after dart-lang/native#2417

This is an idea of how a package:icu4x could look like. Feel free to refactor at will to better suit your workflows - I would like to get something like this landed sometime soon to be able to iterate on it.

Matches dart-lang/i18n#993.

The failure of the fetch and check_hashes workflows are expected as there are no published binaries yet - skip-fetch as a label in this repo would skip the fetching.

Copy link

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

@mosuem
Copy link
Contributor Author

mosuem commented Jul 10, 2025

Regarding the binaries for upload - for package:intl4x, the binaries hosted on Github should only contain the symbols accessible through the intl4x API. The treeshaking is nice to have, but there is no reason to have users with treeshaking disabled download large binaries containing symbols they will never use.

We could upload two sets of binaries - full and reduced?

@robertbastian
Copy link
Member

robertbastian commented Jul 10, 2025

How would the download hook know that only intl4x symbols are used? What if some project uses intl4x and other icu4x APIs directly? I think for now we should just host an everything binary and let treeshaking deal with the size.

@mosuem
Copy link
Contributor Author

mosuem commented Jul 10, 2025

How would the download hook know that only intl4x symbols are used? What if some project uses intl4x and other icu4x APIs directly? I think for now we should just host an everything binary and let treeshaking deal with the size.

We could add a build option, so that we use a reduced set by default and can switch to the full set if required. But we can keep the full set for now - I am a bit worried about size implications though.

@mosuem mosuem marked this pull request as ready for review July 11, 2025 12:21
@mosuem mosuem requested review from Manishearth and a team as code owners July 11, 2025 12:21
@mosuem mosuem requested a review from robertbastian July 11, 2025 12:27
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer if you put artifacts generation workflows in a separate PR. Artifacts might not actually be Dart-specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah feel free to refactor this however you like. This is just an example/template basically.

@@ -0,0 +1 @@
export 'src/hook_helpers/link_helpers.dart' show SymbolKeeper;
Copy link
Member

Choose a reason for hiding this comment

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

why is this a public API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Is this something that could be upstreamed into the native_toolchain_c or hooks package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this is core to how linking works - the package which does the treeshaking must define the API for getting the symbols to treeshake.

robertbastian
robertbastian previously approved these changes Aug 4, 2025
@mosuem
Copy link
Contributor Author

mosuem commented Aug 4, 2025

i don't have merge rights, so feel free to merge. Also if there is no icu4x_artifacts, the code for fetching the artifacts must be updated. Finally, a version 2.0.0-dev.0 is a bit unusual at least, normally experimental packages would have a 0.x version number. The 2 suggests a stable API.

@robertbastian
Copy link
Member

Finally, a version 2.0.0-dev.0 is a bit unusual at least, normally experimental packages would have a 0.x version number. The 2 suggests a stable API.

That's what the -dev.0 is for. I want to keep the association with ICU4X releases.

@robertbastian
Copy link
Member

if there is no icu4x_artifacts, the code for fetching the artifacts must be updated

I just don't want to add these in this PR because it needs more work.

@robertbastian robertbastian changed the title Prepare for publishing Prepare Dart package for publishing Aug 4, 2025
@robertbastian robertbastian merged commit 4f79975 into unicode-org:main Aug 4, 2025
30 checks passed
@robertbastian robertbastian mentioned this pull request Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants