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

fix: add PM properties to HTTP accessor #1228

Conversation

nytamin
Copy link
Contributor

@nytamin nytamin commented Jul 11, 2024

About the Contributor

This pull request is posted on behalf of the NRK

Type of Contribution

This is a:

Feature

New Behavior

Adds types for the new Package Manager HTML-Template rendering

Testing

  • I have added one or more unit tests for this PR
  • I have updated the relevant unit tests
  • No unit test changes are needed for this PR

Affected areas

This PR only adds types and minor additions in GUI settings, does not affect much else.

Status

  • PR is ready to be reviewed.
  • The functionality has been tested by the author.
  • Relevant unit tests has been added / updated.
  • Relevant documentation (code comments, system documentation) has been added / updated.

@nytamin nytamin requested a review from a team as a code owner July 11, 2024 12:45
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 57.98%. Comparing base (8712e51) to head (45c25b9).

Files Patch % Lines
meteor/lib/collections/ExpectedPackages.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@                           Coverage Diff                           @@
##           feat/R51-live-status-gateway-on-R50    #1228      +/-   ##
=======================================================================
+ Coverage                                57.95%   57.98%   +0.02%     
=======================================================================
  Files                                      485      485              
  Lines                                    79860    79864       +4     
  Branches                                  3547     3598      +51     
=======================================================================
+ Hits                                     46280    46306      +26     
+ Misses                                   33543    33536       -7     
+ Partials                                    37       22      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +516 to +518
{t(
'Set to true if the HTTP server supports HEAD requests. (otherwise GET requests will be used to check availability)'
)}
Copy link
Member

Choose a reason for hiding this comment

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

Any reasonable HTTP server should support HEAD in 2024 - can we switch the default around? To say, "Use GET requests instead of HEAD to check availability"?

express.js generates a HEAD handler automatically for GET routes: https://expressjs.com/en/api.html#app.METHOD - I think so does koa-router, so I think it's safe to assume that HEAD is supported, unless it isn't, not the other way round.

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, that's a good point, that would also be solve a backwards compatibility issue.

/** path to the HTML template */
path: string
/** Add prefix to output artifacts */
outputPrefix: string
Copy link
Member

Choose a reason for hiding this comment

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

What does this add a prefix to? the url filename of the artifact?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the output of this package are defined by the various defined steps. This adds a prefix to them. Hmm, perhaps we should remove this altogether..?

/** Zoom level, defaults to 1 */
zoom?: number
/** (defaults to black) */
backgroundColor?: string
Copy link
Member

@jstarpl jstarpl Jul 12, 2024

Choose a reason for hiding this comment

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

How is this color specified? CSS Colors? Can this be set to transparent? Can this be background and not backgroundColor so that this is set to a background-image of choice?

Comment on lines +233 to +238
// Store an object in memory
| { do: 'storeObject'; key: string; value: Record<string, any> }
// Modify an object in memory. Path is a dot-separated string
| { do: 'modifyObject'; key: string; path: string; value: any }
// Send an object to the renderer as a postMessage
| { do: 'injectObject'; key: string }
Copy link
Member

@jstarpl jstarpl Jul 12, 2024

Choose a reason for hiding this comment

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

I find the naming here a bit confusing - these actions are not related - storeObject and injectObject? Since there is no retrieveObject, maybe it would make more sense to call it setObject or even setValue if there's no reason to limit this to objects? and then change injectObject into postMessage, since that's what's going to happen?

Also I suggest not saying "memory" and instead say "page context".

Suggested change
// Store an object in memory
| { do: 'storeObject'; key: string; value: Record<string, any> }
// Modify an object in memory. Path is a dot-separated string
| { do: 'modifyObject'; key: string; path: string; value: any }
// Send an object to the renderer as a postMessage
| { do: 'injectObject'; key: string }
// Set a value in renderer's global context
| { do: 'setValue'; key: string; value: any }
// Modify an object in renderer's global context. Path is a dot-separated string
| { do: 'modifyObject'; key: string; path: string; value: any }
// Send an object to the renderer as a postMessage
| { do: 'postMessage'; value: string }

@nytamin
Copy link
Contributor Author

nytamin commented Aug 23, 2024

superseded by #1247

@nytamin nytamin closed this Aug 23, 2024
@nytamin nytamin deleted the fix/package-manager-html-rendering-types branch August 23, 2024 06:20
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