Minify the getStyleElement() output

Hi guys,
I'm using Next.js with styled-components and it’s great that I can get a fully-rendered HTML with all the required CSS from the server!
After looking at the source code of the pages that arrive to the client, I noticed that there is probably some scope for improvement. Check out the output of styled-components’ sheet.getStyleElement() compared to the rest of the server-rendered content:

A closer look reveals something like:
/* sc-component-id: Locale__LinkToLocale-zq7758-1 */

.bepDJp{margin-left:8px;}
/* sc-component-id: LocaleToggler__Wrapper-s164faf9-0 */

.eyEkZV{position:absolute;top:12px;right:25px;}
/* sc-component-id: LinkToSource__Wrapper-s1y1z1az-0 */

.dqQlOP{position:absolute;bottom:12px;right:25px;}
/* sc-component-id: withLayout__Wrapper-s1mfcftp-0 */

As you can see, about a half of the content consists of comments, which are not very useful in production environemnt. Depending on the page structure, this may lead to several extra kilobytes transferred to each client with no purpose.
To make things a bit more efficient, I added a pretty dirty hack that removes comments and newlines from the output like this:
const styleTags = sheet.getStyleElement();
styleTags[0].props.dangerouslySetInnerHTML.__html =
    styleTags[0].props.dangerouslySetInnerHTML.__html
        .replace(/\/\*.*\*\//g, ' ')
        .replace(/\s+/g, ' ');

↓
.bepDJp{margin-left:8px;} .eyEkZV{position:absolute;top:12px;right:25px;} .dqQlOP{position:absolute;bottom:12px;right:25px;}

However, I’m wondering if the size of the output could be reduced in a less barbarous way, say, by configuring getStyleElement:
const styleTags = sheet.getStyleElement({
    compact: process.NODE_ENV === 'production',
});

WDYT?

We need those comments for rehydration, they're there because we need them to be there.
That being said, that output should be minified in production, PR welcome to add that!

If anyone would like to pick this up, there’s already some code for this in the Babel plugin :) this could just be copied over

Hey, I started checking this out tonight and have the minified output working using the the minify code from the babel plugin.
Tomorrow I'll update it to utilize options passed when invoking getStyleElement so the minification is optional, will open PR after that.

No need to add options, it should automatically minify when process.env.NODE_ENV === 'production'!

Unfortunately this feature has been reverted in https://github.com/styled-components/styled-components/pull/1208/commits/0aee1cfbf9e7c1c036eb0ded63a68bd5f6e077a2 (https://github.com/styled-components/styled-components/pull/1208) because of https://github.com/styled-components/styled-components/pull/1224#issuecomment-360464602. Going back to my good old removeCommentsAndSpacing() 😅
const removeCommentsAndSpacing = (str = '') => str.replace(/\/\*.*\*\//g, ' ').replace(/\s+/g, ' ');
// ...
if (nodeEnv === 'production') {
  styleTags[0].props.dangerouslySetInnerHTML['__html'] = removeCommentsAndSpacing(styleTags[0].props.dangerouslySetInnerHTML['__html']);
}

@kachkaev I’m afraid this will still break rehydration. I’d advise you not to change the output since the extraction function depends on a certain format.
@mxstbr I propose that we close this issue. While some good effort has been made I don’t think there’s anything to be gained from it. Barely any size gains and anything else :/

I think I'm having the same issue... Using Rollup + Uglify, I noticed newline characters and spaces in the tagged template literals.
babelHelpers.taggedTemplateLiteral(["\n  background: ",";\n  border: 1px solid ",";\n  color: ",";\n  padding: 8px;\n  ",";\n  ",";\n  ",";\n"])

Is there a danger in stripping these out?

IGNORE ME 😄. I forgot to use babel-plugin-styled-components. Leaving the comment in case anyone runs into the same thing.

I've been searching for the solutions and it found this thread.
There are many new line characters in production SSR result. If we can trim it it will be a minor improvement to fully minify the HTML

@Fonger I think when we tested it gzip pretty much optimized it away

Hi folks,
I'm trying to minify production build styled components CSS output to reach the single line.
Is replacing line break by a space breaking rehydration?
For instance, going from:
@media (min-width:768px){.kWNFhR{max-width:220px;}}/*!sc*/
data-styled.g37[id="sc-u5khna-3"]{content:"kWNFhR,"}/*!sc*/

To:
@media (min-width:768px){.kWNFhR{max-width:220px;}}/*!sc*/ data-styled.g37[id="sc-u5khna-3"]{content:"kWNFhR,"}/*!sc*/

🤔
CC @mxstbr

Probably yes. Gzip eliminates most of the benefit of whitespace
minification so I’d just skip it
On Fri, Jul 8, 2022 at 9:51 AM Cyril Bonnet @.***>
wrote:

Hi folks,
I'm trying to minify production build styled components CSS output to
reach the single line.
Is replacing line break by a space breaking rehydration?
For instance, going from:
@media (min-width:768px){.kWNFhR{max-width:220px;}}/!sc/
data-styled.g37[id="sc-u5khna-3"]{content:"kWNFhR,"}/!sc/
To:
@media (min-width:768px){.kWNFhR{max-width:220px;}}/!sc/ data-styled.g37[id="sc-u5khna-3"]{content:"kWNFhR,"}/!sc/
🤔
CC @mxstbr https://github.com/mxstbr
—
Reply to this email directly, view it on GitHub
https://github.com/styled-components/styled-components/issues/1217#issuecomment-1179013380,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAELFVXB5YCVNDMQHM6V473VTAW4TANCNFSM4D6GWKUA
.
You are receiving this because you modified the open/close state.Message
ID: @.***
com>

@probablyup Thanks for your answer.
Let's go for Gzip then.


HCIBox: Cloud Deployment ARM Validation Failing

Is your issue related to a Jumpstart scenario, ArcBox, HCIBox, or Agora?

https://github.com/Azure/arc_jumpstart_docs/tree/main/docs/azure_jumpstart_hcibox
Describe the issue or the bug
ARM validation using the custom deployment steps in Cloud Deployment section is failing.
To Reproduce

Have you looked at the Troubleshooting and Logs section?

Yes
Screenshots

Additional context
I followed the guide directly to create a deployment using the custom template and values in the hci.json and hci.parameters.json files. Both I triple checked but to no avail getting a successful deployment.

We've observed this happening frequently since 2402 release. Use the "Try Again" button from the validation page in portal to retry the validation and it should go through without issue.

Unfortunately the "Try Again" button is grayed out, since the validation itself is not successful. I have redeployed new HCI Boxes a few times and still am hitting errors in the validation phase. THe other error I am seeing multiple times is below:
(401) {"error":"invalid_client","error_description":"AADSTS7000229: The client application 8XXXXXXXXXXXXXXXXXXXX is missing service principal in the tenant 7XXXXXXXXXXXXXXXXXXXXXXXX. See instructions here: https://go.microsoft.com/fwlink/?linkid=2225119 Trace ID: 8fb4398a-b57b-459e-9dc9-31750c300300 Correlation ID: 4e5443f9-e414-4e22-bbc7-827335333a7d Timestamp: 2024-03-07 01:12:53Z","error_codes":[7000229],"timestamp":"2024-03-07 01:12:53Z","trace_id":"8fb4398a-b57b-459e-9dc9-31750c300300","correlation_id":"4e5443f9-e414-4e22-bbc7-827335333a7d","error_uri":"https://login.microsoftonline.com/error?code=7000229"} (Code: InternalHttpClientError)

Please check other permissions too against this list. https://learn.microsoft.com/en-us/azure-stack/hci/deploy/deployment-arc-register-server-permissions
In particular check that Microsoft.AzureStackHCI provider has been assigned properly per the doc.
Please also share your C:\HCIBox\Logs\ folder zipped up here.

@mmorrison57 I had this same issue, once I assigned myself Key Vault Administrator and Storage Account Contributor, then did another custom template deployment, and incremented the storage account and key vault values by 1 (or just delete the ones that were created in the past deployment) it still failed but it at least created the resources. After that, go to the re-validation page and hit "try again" and it will assign the key vault permissions and pass the Azure Resource validation, then you can hit try again (again) and it will pass the cluster validation. :)
cc: @dkirby-ms, the deploy doc for jumpstart only says key vault admin right now, it should also include storage account contributor like is listed in the hci docs.

Addressed and closed in #2456


[BUG] sometimes nothing loads up even though i have a connection

Describe the bug
even though I have internet sometimes it doesn't show anything
same with search
also, it is saying "user not found" whenever I click on my profile picture
Note: I started doing this after updating it to 2.1.0
Also note: Suprise me works as intended just search and home don't work
another Note: so sometimes it works as intended but it loads stuff relatively slow
Steps to Reproduce

update the launcher to 2.1.0
look for home or search something
nothing shows up

Expected behavior
everything should work normally as before updating
Screenshots

Operating System
Windows 11
Hydra Version
2.1.0
Additional Information
No response
Before opening this Issue

[X] I have searched the issues of this repository and believe that this is not a duplicate.
[X] I am aware that Hydra team does not offer any support or help regarding the downloaded games.

Same here, in my latest log file :
[2024-09-14 19:29:25.749] [error]                   Unhandled rejection SqliteError: table repack has no column named uris

o meu tmb esta assim

Our server basically died with too many requests. We fixed, should be 100% now

Same here, in my latest log file : [2024-09-14 19:29:25.749] [error] Unhandled rejection SqliteError: table repack has no column named uris

Does this happens even in 2.1.3?

Same here, in my latest log file : [2024-09-14 19:29:25.749] [error] Unhandled rejection SqliteError: table repack has no column named uris

Does this happens even in 2.1.3?

It has already been fixed, you can disregard it

I'm facing the same problem. Release 3.0.5


data-bs-dismiss="offcanvas" doesn't work with responsive offcanvas (eg. offcanvas-lg)

Prerequisites

[X] I have searched for duplicate or closed issues
[X] I have validated any HTML to avoid common problems
[X] I have read the contributing guidelines

Describe the issue
Adding data-bs-dismiss="offcanvas" to links/buttons that should close the offcanvas only works if the offcanvas is not responsive (has class "offcanvas").
If you use responsive offcanvas (eg class "offcanvas-xxl"), the button doesn't do anything and requires an additional argument - data-bs-target="#id"
This makes it impossible to use anchor links to close offcanvas menus, Please resize screen when viewing the codepen example, so the content actually goes to offcanvas.
Reduced test cases
https://codepen.io/dankosan/pen/oNqQgvp
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.2.0

Thank you for believing in me.
On Monday, August 15, 2022, dankopi @.***> wrote:

Prerequisites

I have searched
https://github.com/twbs/bootstrap/issues?utf8=✓&q=is%3Aissue
for duplicate or closed issues
I have validated https://html5.validator.nu/ any HTML to avoid
common problems
I have read the contributing guidelines
https://github.com/twbs/bootstrap/blob/main/.github/CONTRIBUTING.md

Describe the issue
Adding data-bs-dismiss="offcanvas" to links/buttons that should close the
offcanvas only works if the offcanvas is not responsive (has class
"offcanvas").
If you use responsive offcanvas (eg class "offcanvas-xxl"), the button
doesn't do anything and requires an additional argument -
data-bs-target="#id"
This makes it impossible to use anchor links to close offcanvas menus,
Reduced test cases
https://codepen.io/dankosan/pen/oNqQgvp
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
v5.2.0
—
Reply to this email directly, view it on GitHub
https://github.com/twbs/bootstrap/issues/36962, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHORFC5DWZOAYBG2K246ZN3VZKGITANCNFSM56TDVF3Q
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

Quick fix: you can use data-bs-target to point the specific element.
Explanation: The dismiss trigger searches for a target attribute or tries to find the closest .modal. As .modal-xl doesn't include modal class, it fails to recognize the instance
As a solution, we should update our docs to refer to this, and it would be nice to use responsive classes as modifiers in combination with original modal class
/cc @mdo we have discussed the modifier approach in the past (and probably is more suitable for v6)

Yeah we should mention this in our docs. This is kind of a complication from v5's implementation of offcanvas in the navbar if I recall—there wasn't an easy way to keep the base class, add the new dedicated responsive offcanvas component variations, and keep the base class alive. I'm still not 100% sure if/how we'll do it in v6.

Quick fix: you can use data-bs-target to point the specific element.

@GeoSot, thanks for acknowledging this issue. The quick fix didn't work for me but I'm not sure what modal has to do with offcanvas in your explanation. Is it possible this issue can be resolved in v5.3?

Thank you for pointing out my mistake. I 've replaced the names, with the correct ones.
The behavior, is not broken. Dismiss triggers, work upon component classes and in theory we apply one main selector, and add modifier classes. In the specific case, .offcanvas class is missing as .offcavas-xl acts like an autonomous class (and not modifier), so js is not able to aim the proper element

Just tripped over this while switching from an offcanvas to a responsive one and the close button didn't work. Didn't notice the "data-bs-target" is in the docs in the example code here: https://getbootstrap.com/docs/5.3/components/offcanvas/#responsive
Maybe make it clearer that you have to use data-bs-target="#myOffcanvas" for responsive ones?

Yeh, this seems like something that needs a special note in the docs under the Responsive section.


Replace the "condition" and "consequent"

Thanks for sharing this awesome tool.
When printing the final hunk diff info in make_master_diff function, the key values are placed in reverse.
(make_pull_diff function is correct.)

@RosePasta  Thank you for your interest in this tool!
I merge this PR.
Currently, I moved rule generating functions as the VS Code extension.
I hope you can use them.
VS Code extension: https://github.com/devreplay/vscode-devreplay#devreplay-for-visual-studio-code
Source file: https://github.com/devreplay/vscode-devreplay/blob/master/client/src/rule-maker/makeRules.ts


Fix NetSurf.NetSurf upgrade loop

Currently NetSurf.NetSurf is constantly requesting for upgrade, since the
version advertised in the yaml doesn't match the version is is being installed.
There are quotes around the installed version as below:
Name                                       Id                                     Version          Available    Source
------------------------------------------------------------------------------------------------------------------------
NetSurf - NetSurf - Web Browser            NetSurf.NetSurf                        "3.10.0"         3.10.0       winget

This attempts to fix it by making the yaml include the quotes around the
version number to match the installed version string scheme.

[x] Have you signed the Contributor License Agreement?
[x] Have you checked that there aren't other open pull requests for the same manifest update/change?

[x] Does your manifest conform to the 1.0 schema?

Note: <path> is the name of the directory containing the manifest you're submitting.

Microsoft Reviewers: Open in CodeFlow

Okay it does, you just need to update the version folder.

Sorry, I got it the other way around... the installer is actually the one who is providing the quotes around the string, not winget.
So, as long as the author of the software doesn't release a new release with a different version string that doesn't include quotes the problem will persist.

But as a way to at least prevent winget from having issues with the package, why not include the version string exactly to reflect the pattern the author used in this release?
I've updated the yaml to match that.

Oh, I see... if the folder needs to match the version string, then I expect it's not possible at all to fis this.

Okay it does, you just need to update the version folder to "3.10.0" from 3.10.0
EDIT: Nope:

I can add quotes on my computer, but when any contributors will clone the repository on their computer, wouldn't their directory structure get corrupt?


Support for 3D images

Is your feature request related to a problem? Please describe.
Medical image segmentation often relies on 3D scans (MRI, CT), but there are very few pretrained models to use for different medical image tasks (classification, segmentation)
Describe the solution you'd like
It would be great if there were some state of the art models available in super-gradients, and even better if they would be pre-trained. For example this model http://arxiv.org/abs/2208.09567, or use the synthesized 100k brains to train a 3d classification model like this one: http://arxiv.org/abs/2209.07162, https://arxiv.org/pdf/2303.08216.pdf

Hey @gladomat, we currently prioritize other tasks and models, that are more "production oriented".
We do plan on adding models from the medical area, but a bit further down the road.
When the time comes will consider your feature request (:


Sphere-packing analogy in HRasOS chapter

A common analogy in the Plurality community is that monist atomist systems think of freedom almost as a "sphere packing" problem of creating maximum for individuals while avoiding their colliding with others' freedoms.    Plurality notes that not everyone is a point; some are trees, others diamonds, and that the goal is thus not sphere-packing but arranging the space so as to allow maximum flexibility for regions of space to themselves pack more complex objects and and even more richly to allow space for sub-spaces, etc.  This analogy is missing from the "Rights, Operating Systems and Digital Freedom" chapter and should be added somewhere.

 Gov4Git notices
On Friday, 01-Mar-24 00:00:20 UTC by Gov4Git dev
Notice lja5e5
Started managing this issue as Gov4Git concern 104 with initial priority score of 0.000000.
This project is managed by Gov4Git, a decentralized governance system for collaborative git projects.
To participate in governance, install the Gov4Git desktop app.
Notice 5i6bqw
This issue's priority score is now 0.000000.
The cost of priority is 0.000000.
The projected bounty is now 0.000000.
Notice xnkz3v
The set of eligible proposals claiming this issue is empty.

 Gov4Git notices
On Friday, 01-Mar-24 21:15:41 UTC by Gov4Git dev
Notice yzbzzg
This issue's priority score is now 250.000000.
The cost of priority is 62500.000000.
The projected bounty is now 500.000000.
Notice 4edurk
The set of eligible proposals claiming this issue is empty.

 Gov4Git notices
On Tuesday, 09-Apr-24 05:55:37 UTC by Gov4Git dev
Notice zd6ovs
This issue's priority score is now 249.000000.
The cost of priority is 62501.000000.
The projected bounty is now 498.000000.
Notice 5ybjh3
The set of eligible proposals claiming this issue is empty.


Add “Ideas That Changed the World” Exploration Feature

I would like to see an “Ideas That Changed the World” exploration feature integrated into the prompt apps. This feature would:

Present users with a significant historical idea each day, like democracy, evolution, or zero.
Include an interactive timeline showing related discoveries and changes inspired by each idea.
Offer prompts to reflect on the relevance of these ideas in modern life.
Encourage users to consider how these groundbreaking concepts impact their own perspectives.

Please assign me under GSSoC'24 ext and hacktoberfest labels.

@amitb0ra
It will be way better if you send a single Level3 pr for the templates introducing them. As at this point you are just spamming them into my repository.
Either send them in sets of 6 or 7 with a level3 pr each.
Or I'll have to add it to wont fix

@amitb0ra
It will be way better if you send a single Level3 pr for the templates introducing them. As at this point you are just spamming them into my repository.
Either send them in sets of 6 or 7 with a level3 pr each. Or I'll have to add it to wont fix

ah, actually all of them are different so for your choice i send them separately.
do you want that i will propose list of ideas (around 10) and you will select out of them(3-5) at level 3?

@Rakshit-gen any update?


Add engines to package.json

https://docs.npmjs.com/cli/v6/configuring-npm/package-json#engines
https://github.com/raineorshine/npm-check-updates/blob/46efecb5f32aa291aaca1cb2f7288abd8a963094/package.json#L24-L26

closed by #584


Issues with buttons

I've tried using Steam and Non-Steam POE launchers, as well as using the JAR and EXE (as admin) versions of Mercury Trade, and I get the same issue with all configurations.  Basically, I have to press buttons multiple times (5+) before a message/invite/trade request gets sent.  I had no issues with buttons prior to the latest update to Mercury Trade, and have since re-downloaded both JAR/EXE versions from the Github and all the issues remain.  I also get an error about update server being offline whenever I check for updates.  Lastly, my app.log hasn't been updated since the 8th of April, even though I use the software daily and have restarted several times.  I'm running Win 10 Pro, if that makes any difference.

I hope in next update this problem will disappear.


Added Intel MKL graph optimization code and the ability to enable MKL when running configure.

Added Intel MKL graph optimization code.

Modified configure file to build with MKL support.

Included the MKL binary in Tensorflow wheel.

Can one of the admins verify this patch?

style changes lgtm (need to resolve a conflict it looks like)

Merging is done. Awaiting review completion.

@tensorflow-jenkins test this please.

@tensorflow-jenkins test this please.

@tensorflow-jenkins test this please

@mahmoud-abuzaina please reformat the build file by running buildifier or apply the suggested fixes here: https://ci.tensorflow.org/job/tensorflow-pull-requests-sanity/2931/console

@tensorflow-jenkins test this please

@tensorflow-jenkins test this please

@tensorflow-jenkins test this please

@tensorflow-jenkins test this please

@mahmoud-abuzaina thanks for the contribution. Merging now.


[4.x] Auto-Increment Debugger Port (And a bit of cleanup)

4.x version of https://github.com/godotengine/godot/pull/37067
Samples:

Can you further explain the changes? Why do we need a protocol member variable?
Also, port auto increment should be handled at the peer level, some peer might not even have the concept of port (e.g. non-IP protocols)

Also, port auto increment should be handled at the peer level, some peer might not even have the concept of port

Possible, but this would mean repeating code between EditorDebuggerServerTCP and EditorDebuggerServerWebSocket

I see why you added the protocol and endpoint variables, but those should be handled down in the chain

Can you elaborate on "down in the chain?"

Possible, but this would mean repeating code between EditorDebuggerServerTCP and EditorDebuggerServerWebSocket

And that's fine, because it would allow non-IP protocols, which is the point of the EditorDebuggerServer abstraction (allowing multiple implementations on different protocols).
In fact, I probably made a mistake suffixing it with "Server" at the time, since there could be implementations which requires the editor to be the TCP client, and run the server on the device instead; or a simple read-write stream with no real "server".

Can you elaborate on "down in the chain?"

In EditorDebuggerServerTCP and EditorDebuggerServerWebSocket.

TYVM for the reviews, Faless!

Thanks!


Improve dmverity-vhd -d performance

The current implementation of dmverity-vhd -d has to make one of the following tradeoffs:

Runtime: By default this option calls the docker daemon to fetch the entire image for each layer as it doesn't provide an endpoint to get a specific layer
Memory: The user can include a -b option that makes this call buffered, keeping the image in memory the whole time, this is much faster but at the cost of keeping the whole image in memory, which is a problem with runners with low memory

#2086 Proposed a new tradeoff of disk space, by saving the image to disk and accessing the layers locally, this is a problem for runners with smaller disks as the image is stored twice.
This solution makes a single request to the docker daemon, and processes both the layer hashes and the manifest to assign layer numbers in a single pass, making it performant in all three aspects.

I tested performance on a 2 core codespaces runner with a simple image based on Ubuntu with 10 layers:
main
@DomAyre ➜ /workspaces/hcsshim/cmd/dmverity-vhd (main) $ time go run . -d roothash -i caciexamples.azurecr.io/simple_server/primary:latest
Layer 0 root hash: 903950f5becc64e7801c5ac92a31f69057ac0554ec28de507b1d0c05d782fa2f
...
Layer 9 root hash: 6b34b9a3008cf1798bd48f1701025e3591fa41e429316a76bbc7b5e31658eaeb

real    2m13.073s
user    0m4.159s
sys     0m7.067s

dmverity-vhd-perf
@DomAyre ➜ /workspaces/hcsshim/cmd/dmverity-vhd (dmverity-vhd-perf) $ time go run . -d roothash -i caciexamples.azurecr.io/simple_server/primary:latest
Layer 0 root hash: 903950f5becc64e7801c5ac92a31f69057ac0554ec28de507b1d0c05d782fa2f
...
Layer 9 root hash: 6b34b9a3008cf1798bd48f1701025e3591fa41e429316a76bbc7b5e31658eaeb

real    0m16.398s
user    0m3.469s
sys     0m3.014s

I also tested the other options (-t and no flag) and the createVHD command with -d, -t and no flags, and performance is similar across all cases except for a similar improvement using -d with createVHD

I've also added a stricter check if a file is a tar which allows us to fail hard if onLayer fails.
https://github.com/microsoft/hcsshim/pull/2089/commits/b3af336ee1f3ff5da5cd8760bce0a5dc47520825
It costs 512 bytes of memory because we attempt to read the tar header, making a copy as we do to reconstruct the original reader


Replace DOMContentLoaded listener with onUiLoaded()

I noticed that auto1111 already has a function to do exactly what this event listener did.

LGTM


fix(apigw): optimize remove apigw trigger flow

:tada: This PR is included in version 2.12.3 :tada:
The release is available on:

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


[WIP] PANG IN ATARI FASHION!

This is the game that is called to succeed Angry Birds, Fortnite and the like: Pang in Atari fashion!

Yes, I'm not very good at it.

It needs polishing but please have a look, we can keep the PR open until it's good to go and work on the game2 branch for now. MainLoop.js is used to manage the game loop and Matter.js to calculate the physics. (Last year I used P2 for the physics but I found Matter.js easier to use this time.)
@theimowski I gave you write access, please give it a go and let me know what you think. The only file you need to care about is App.fs. Canvas.fs should be kind of a library that hopefully we will publish later. I will add tomorrow more comments to the code and we can discuss about the steps for the talk.
@whitetigle It'd be very nice if you could also have a look and tweak a bit the numbers in the Literals module (within App.fs) or the style to give the game more an Atari-like feeling. Any suggestion is welcome!
@MangelMaxime As you recommended, I'm using MainLoop.js to control the game loop with and Elmish-like architecture, though the update and view functions are quite imperative for performance (matter-js mutates the state). Now the next step is to add some time travel debugging, not sure if it's better to use the redux devtools (seems they're not maintained anymore) or just prototype our own. I guess the best place to store the state is in the setEnd function but maybe only every X frames. Any ideas?

BTW, this is accessing the DOM directly, but we can easily integrate it with React if we need some other controls (like a slider for the time travel).

Excellent! I'll have a look!

I think using redux devtools makes sense for now as it's the quicker way to have it working :)
I think storing the new state every frame is ok so each time the setEnd function is called should be ok. Otherwise, you will probably loose too much information.

Looks good! I'll fiddle with it and decide how much do we need for the boilerplate to fit in a 45min talk.
Brain dump ideas:

Ideally we want attendees to play themselves, which means deploying the app somewhere
Would be good to support gestures so people can play on mobiles - e.g. swipe for left / right and click for firing
Adding scoring system would be nice as well so that people can compete with each other

I was wondering, maybe it could also be a good fit for PWA for offline play + using pouchdb for offline and online leaderboards. What do you think?

@MangelMaxime Ok, I'll try to connect with redux dev tools
@theimowski Cool, I'll try to add mobile support. Funsnake already has that so it shouldn't be difficult.
@whitetigle That'd be nice. Right now you come before Tomas so we cannot present it in your talk, but we can add offline support plus score sharing during the deployment.

I have no experience with pouchdb so would prefer to stick with my standard setup.
Currently trying to add a server to persist scores (struggling a bit as the project structure differs a bit compared to what I'm used to when working with SAFE template)

I'll do something else 👍 😄

BTW, the matter-j bindings are not perfect (nor it was the .d.ts file I used for the automatic conversion). If you need more features, you may need to check the documentation and tweak the Matter.js file.

@theimowski Sorry! I just realized the webpack config in game2 didn't have any setting for deployment. Were you having troubles because of that? I can fix it if you need it.

No worries, I think I'll start from scratch with SAFE template in a new dir, say game2-safe and then add the game side of things.
Also, because of the mutable nature of matter-js lib I struggled with adding a feature of "play again". Do you think it's fine if we make players refresh the page to play again?

Yes, for the talk it should be ok to have some rough edges. Running the init function again doesn't work to reset the state?

I tried to run init again but collision detection stopped working

Ah, you're right! Then I need to add an easy way so you can reset both the model and the subscriptions at once.

@MangelMaxime how do I decode a list of tuples with Thoth.Json?
On server side I have:
let scores =
            [
                "alfonsogarciacaro", 100
                "whitetigle", 80
                "MangelMaxime", 79
                "theimowski", 28
            ]

let encoded = Thoth.Json.Net.Encode.Auto.toString(0, scores)

on client:
    let scores = Decode.Auto.generateDecoder<string * int>()
    match Decode.fromString (Decode.list scores) txt with
    | Ok scores ->
        for (name, score) in scores do
            Browser.console.log (sprintf "%s: %d" name score)
    | Error e ->
        Browser.console.error e

and I get JS error:
Expecting a list but instead got: "[[\"alfonsogarciacaro\",100],[\"whitetigle\",80],[\"MangelMaxime\",79],[\"theimowski\",28]]"

Same happens if I try to use array instead of list
What am I missing?

Actually I think the Thoth encoding worked properly, but I shouldn't have encoded the returned string again with Saturn, which is what I think happened in my case.
Anyway I decided to go with Fable.Remoting since it was a bit simpler for me to set up

Ah yes, indeed you were encoding twice the JSON.

I deployed an alfa version here
The goal is to play this on mobile, so please test from your android / iphone
To move left, click on the left side of board, to fire click in the center and move right - click on right side.
Things to improve (help welcome!):

[ ] Fix the layout
[ ] Gestures instead of dumb clicking
[ ] "Play again" instead of refresh page
[ ] Nicer prompt for high score name

I tested it and it's working on my Iphone SE. 👏 🎉
A nice addition could be to show the area where we can tap because I have a time determining these areas especially because I have a small screen ^^

Worked on my android, but it's really hard to guess where to tap. Also
there should be a restart button or something
Tomasz Heimowski<EMAIL_ADDRESS>schrieb am Fr., 19. Okt. 2018,
16:31:

@theimowski commented on this pull request.
In game2-safe/src/Server/Server.fs
https://github.com/fable-compiler/fableconf-workshops/pull/4#discussion_r226668468
:

+let jsonConverter = Fable.Remoting.Json.FableJsonConverter () :> JsonConverter
+
+let leaseTime = TimeSpan.FromSeconds 15.
+
+let getScores () =

task {

   let b = Array.zeroCreate 65536

   let! count = blob.DownloadToByteArrayAsync(b, 0)

   let json = Encoding.UTF8.GetString(b, 0, count)

   return JsonConvert.DeserializeObject<HighScores>(json, [|jsonConverter|])

}

+let addScore (score : string * int) =

task {

   let! lease = blob.AcquireLeaseAsync(Nullable.op_Implicit leaseTime, null)

yes it's to enable concurrent writes - I read the scores from file and
append a new one. I think we're ok with the lock here as long as it's
implemented correctly. Will this call block until another lease is released?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/fable-compiler/fableconf-workshops/pull/4#discussion_r226668468,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AADgNBN4ToBca4O0AN_zAqHL3ji1Mvpbks5umeJLgaJpZM4XN09_
.

Thanks for the tips - I've pushed a revised version to that same url:

Buttons for control
Game resets automatically after loosing

I'd be grateful if you have a quick glance once again, and comment if there's anything else that should be still changed.


feat: allow multiple steps on @call

feat: take a sequence of calls
test: change tests to use steps
refactor: change examples to use steps
test: add tests for multiple steps

Issue Reference(s):
Fixes #1482
/claim #1482
Build & Testing:

[x] I ran cargo test successfully.
[x] I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

[x] I have added relevant unit & integration tests.
[x] I have updated the documentation accordingly.
[x] I have performed a self-review of my code.
[x] PR follows the naming convention of <type>(<optional scope>): <title>

Summary by CodeRabbit

New Features

Enhanced the application's capability to handle complex operations by introducing a multi-step execution process in GraphQL queries and mutations.
Added a new method to retrieve arguments more efficiently in various contexts.
Updated GraphQL schema and directives to support the new multi-step functionality.

Bug Fixes

Fixed an issue where arguments were not correctly retrieved in certain scenarios.

Documentation

Added comprehensive tests and documentation to demonstrate the new multi-step calling functionality in GraphQL.

Refactor

Refined internal structures for better clarity and functionality, separating concerns into more specific components.
Improved code quality by renaming and restructuring for better readability and maintenance.

@ologbonowiwi Converting this to draft, until you figure out the fix for why we are getting an empty string.

/bounty 30$

Hey @tusharmath, I think you meant /tip instead of /bounty 🤔
50$ would be great, by the way.
Thanks in advance 😄

/tip 50


Debugger extensions can't distinguish user requests to pause a thread from requests to pause the whole app.

There's no way to distinguish a user request to pause a single thread from a request to pause the entire app. As such, my extension has to degrade to always pausing the whole app, even when the user requests to pause a single thread. If the user presses the global pause button, my debugger receives a threadId. I have no way to distinguish this from the user pausing that thread. PauseArguments shouldn't contain threadId when the user clicks the pause button, indicating to the extension their intent to pause the whole app.

VSCode Version: 1.15
OS Version: Any

Steps to Reproduce:

Start a debugger
Click the pause button

Expected: The PauseArguments parameter to pauseRequest has no threadId or it's set to null to indicate I should pause the whole app.
Actual: The PauseArguments contains a threadId.

I disagree. Currently the whole UX is designed in such a way that is the slave of a focuse process / thread / frame. As such the top actions are always scoped to the current thread (example: step over will always only step over the current thread, not over all of them).
My point is that you should handle every pause as the pause the current thread, we currently do not support a Pause All action, which we could introduce if users ask for it.
Closing as designed
fyi @weinand

I was expecting the behavior to be like Visual Studio, where after launching or attaching to a process, the pause button in the debug toolbar (break all) pauses all threads. To pause individual threads, the user right clicks in the threads window and selects freeze and thaw.
Not to say that VSCode should behave like VS, but this behavior is surprising. Can you update the tooltip to be more specific as to what the pause button will pause? Also for clarification then, when the user clicks the pause button and has no thread selected in the left window, which thread should the user expect to pause when they click pause?

@rickwebiii I agree, we shuold upadate the tooltip to make this clearer

After looking into this the problem with the tooltip is that we cannot guess how an adapter is going to behave - if the thread id will be respect or if it will be totaly ignored and all threads will pause (e.g C# adapter).
Due to that I have decided to leave the tooltip as it is for now. But am open for suggestions

I was always under the impression this button should behave like VS's break all because you don't have to have a thread selected in order to press it. As a user, if I don't have a thread selected, I would expect it to pause the whole app.
If there isn't a thread selected, then which thread the debugger chooses to pause is arbitrary, which is why I was confused.


Error:Execution failed for task ':app:transformClassesWithJarMergingForHuaweiDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/coremedia/iso/AbstractBoxParser$1.class

Error:Execution failed for task ':app:transformClassesWithJarMergingForHuaweiDebug'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/coremedia/iso/AbstractBoxParser$1.class

Hi @zhangji92
When did this happen, which scenario did you use for this error to show up?

@Tourenathan-G5organisation
just added to gradle and used compression before uploading
unable build code


Missing 'Contact Us' Form in Footer Section

The website has a dedicated "Contact Us" page, but there's no smaller version of the contact form in the footer section. Adding a simple contact form to the footer would enhance user experience by providing an easy way for visitors to reach out from any page.

Suggested Enhancement:
Add a small contact form in the footer with the following fields:
Name (text input)
Email (email input)
Message (textarea)
Submit button
Expected Behavior:
The contact form should allow users to send quick messages from any page without needing to navigate to the full "Contact Us" page.
@Vin205 Can you please assign me this issue under gssoc and hacktoberfest and level label...

I woyld like to work on it. Please assisgn it to me


add higher order components example

Related: #377

 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.

Looks great, thanks!


fix: commit message config

What
Adds dependabot config overriding commit message type

:tada: This PR is included in version 1.23.1 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:


Add Pre-Commit Hooks

The following hooks have been added:

check-yaml: Validates the syntax of YAML files.
black: Formats Python code to adhere to a uniform style.
flake8: Lints Python code to catch errors and enforce coding standards.

Closing this since your new PR contains these changes.


[openal-soft] enable coreaudio backend for ios

Describe the pull request

What does your PR fix?
Currently if openal-soft is built for an ios target, it will be built with no audio backend. Now apple's coreaudio backend will be enabled when building for both ios and mac os targets.

Hi @edo9300
Thanks for your PR!
versions/o-/openal-soft.json(2,): error : While reading versions for port openal-soft from file: version/o-/openal-soft.json
Version `1.21.1#2` was not found in versions file.
Run:

    vcpkg x-add-version openal-soft

to add the new port version.

You also need to run ./vcpkg x-add-version openal-soft to update the version files.

You also need to run ./vcpkg x-add-version openal-soft to update the version files.

I forgot to run the command, my bad

LGTM, thanks for your PR @edo9300.


[JENKINS-51302] - Properly cleanup Metadata so that PCT does not miss metadata for running integration tests

After the change we will have 2 POMs in resources: one for "jenkins-war" and another one for the artifact ID defined in Custom WAR Packager settings. If CWP defines "org.jenkins-ci.main:jenkins-war", the pom.xml will be just overridden hence there is no compatibility issues with existing demos.
https://issues.jenkins-ci.org/browse/JENKINS-51302
@reviewbybees @raul-arabaolaza @jglick

It should help https://github.com/jenkinsci/remoting/pull/265, but not 100% sure. Works locally at least

Let's see how it flies in prod


Invert the calling order of group and subgroup in load_hk.

The first input parameter of the load_hk method is group which is either BIAS or DAQ, while the second is subgroup, that can be either a polarimeter or a board name:
https://github.com/lspestrip/striptease/blob/921826363e797db4166a2c7de670c15a4e3eb292/striptease/hdf5files.py#L293
Instead, the first argument of load_sci is the polarimeter name:
https://github.com/lspestrip/striptease/blob/921826363e797db4166a2c7de670c15a4e3eb292/striptease/hdf5files.py#L332
It might be useful to invert the calling order of group and subgroup in load_hk to keep it coherent in the two methods.

This choice has a meaning, strictly connected to the hardware architecture. In the electronics we have BIAS boards and Acquisition boards (DAQ). Each is connected to Polarimeters (either for bias or data acquisition).
For this reason Francesco asked to swap groups and subgroups, to reflect the actual hardware logic.