Hippy icon indicating copy to clipboard operation
Hippy copied to clipboard

fix(ios): Remove HippyContext prefix. It has been set outside

Open liuxuan30 opened this issue 9 months ago • 5 comments

Remove HippyContext prefix in - (void)setContextName:(NSString *)contextName. It has been set by outside, so it's redundant to add again.

export function hippyRegister(appName, entryFunc) {
  // Call the iOS native for rename the context to appName.
  if (__HIPPYNATIVEGLOBAL__.OS === 'ios') {
    Hippy.bridge.callNative('JSCExecutor', 'setContextName', `HippyContext: ${appName}`);  // here
  }
  __GLOBAL__.appRegister[appName] = {
    run: entryFunc,
  };
}
image

I do see a few places trying to assemble contextName in HippyDevInfo and efault_runtime_notification, it seems scattered. Please review and suggest whether we should add the in setContext or outside and advice what's the correct thing regarding the prefix.

IMO it would be caller's choice to do so unless you have magic words to make something work.

liuxuan30 avatar Mar 12 '25 02:03 liuxuan30

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


davionxliu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar Mar 12 '25 02:03 tencent-adm

Hi, @liuxuan30. Thanks for your PR! :clap:

:label: You can leave a comment in this PR with #help tag when you need help (e.g. some status checks run failed due to internal issue), admin team members will help asap.

hippy-service[bot] avatar Mar 12 '25 02:03 hippy-service[bot]

After a quick scan, I have approved workflow to run.

  • SHA: 3979b94a9eccd08ce6ab72f44ec4fb8d1c10f2b3

:label: New commits in this PR would not be tested automatically until this pull request is reviewed by our collaborators. :label: No need to worry about the status of merge_guard and [gh] pull request merge guard / merge_guard (pull_request_target) checks, once this pull request is met merge requirements, it will be automatically converted to successful status.

hippy-service[bot] avatar Mar 12 '25 02:03 hippy-service[bot]

It seems to be just for hippy-web-renderer,and should be removed in 3.0, since there is no 'setContextName' method for JSCExecutor in 3.0.

see driver/js/packages/hippy-web-renderer/src/env/others.ts @zealotchen0

wwwcg avatar Mar 17 '25 07:03 wwwcg

Pay attention 🛎️ !! There has been no activity on this PR for 2 months, so I will label it stalled. It will be automatically closed in 30 days if no more activity. Feel free to leave a comment if you have any questions.

hippy-service[bot] avatar May 16 '25 19:05 hippy-service[bot]

Pay attention 🛎️ !! There has been no activity on this PR for 2 months, so I will label it stalled. It will be automatically closed in 30 days if no more activity. Feel free to leave a comment if you have any questions.

hippy-service[bot] avatar Jul 25 '25 19:07 hippy-service[bot]