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

salesforce: move toUTF8 out to utils #877

Closed
josephjclark opened this issue Jan 7, 2025 · 6 comments
Closed

salesforce: move toUTF8 out to utils #877

josephjclark opened this issue Jan 7, 2025 · 6 comments
Assignees

Comments

@josephjclark
Copy link
Collaborator

It's not an operation. We should lean into the idea that all top-level functions are Operations, and everything else goes on a namespaced object (like utils.toTUF8)

@github-project-automation github-project-automation bot moved this to New Issues in v2 Jan 7, 2025
@josephjclark
Copy link
Collaborator Author

@mtuchi Tempted to do this for the next major release - what do you think?

@josephjclark josephjclark mentioned this issue Jan 7, 2025
4 tasks
@mtuchi
Copy link
Collaborator

mtuchi commented Jan 7, 2025

@josephjclark I think there is a dependence here, for this to work we will need to solve first
#877

@josephjclark
Copy link
Collaborator Author

I wasn't proposing to do this in common but actually that's a much better idea!

@josephjclark
Copy link
Collaborator Author

@mtuchi I've hit a problem on moving toUTF8 to common

toUTF8 depends on any-ascii, which for annoying reasons users a deferred async module load to intialise the package. What this basically means is that salesforce overrides execute to inject a loader function.

This is fine for salesforce but not possible for common.

So here are our options:

  1. Only support toUTF8 in salesforce (and move it into a util)
  2. Bundle a build of any-ascii into common so that we can load it properly
  3. Find an alternative library to handle the transliteration

I guess my question is - have you ever needed this function outside of salesforce?

I would go with option 2 so long as you can guarantee me that this is actually useful

@mtuchi
Copy link
Collaborator

mtuchi commented Jan 9, 2025

@josephjclark i haven't come across a use-case for toUTF8 outside salesforce adaptor, I think option 2 sounds fine but it might be a bigger task. I would suggest we go with option 1 for now since it's much cleaner and makes lot of sense to use the function like this util.toUTF8() in job code

@josephjclark
Copy link
Collaborator Author

OK cool - for the moment I'll leave this as a salesforce util function.

I am happy enough with 2 but it takes a bit more work and I'm reluctant to do it unless there's a good reason :)

Thanks for the input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants