animating strokeDashoffset of a path does not work on IOS

Bug
Animating strokeDashoffset of a path does not work on IOS but works on Android. It works if the value of strokeDashoffset and strokeDasharray do not switch between undefined and the actual value I want. However in my case I want to know the length of the path and use that to animate the path, so when the path length is unknown I assign strokeDasharray and ..offset to undefined
Unexpected behavior
The unexpected behavior is that ios does not animate when it should.
Environment info
React native info output:
System:
  OS: macOS 14.1.2
  CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 1.59 GB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.1
    path: ~/.nvm/versions/node/v18.17.1/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v18.17.1/bin/yarn
  npm:
    version: 9.6.7
    path: ~/.nvm/versions/node/v18.17.1/bin/npm
  Watchman:
    version: 2<IP_ADDRESS>
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.2
    path: /Users/ramiel/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - watchOS 10.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11076708
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.15
    path: /usr/local/opt/openjdk@11/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/ramiel/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.1
    wanted: 0.73.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Library version: 14.1.0
Steps To Reproduce

git clone https://github.com/itsramiel/svg-path-animation-repro
cd svg-path-animation-repro
yarn
yarn ios
notice that path doesnt animate
yarn android
notice that path animate

Describe what you expected to happen:

I expect ios to work like android and the path animated

Short, Self Contained, Correct (Compilable), Example
import Animated, {
  useAnimatedProps,
  useSharedValue,
  withTiming,
} from 'react-native-reanimated';
import {useEffect, useRef, useState} from 'react';
import {View} from 'react-native';
import {Path, Svg} from 'react-native-svg';

const WIDTH = 200;
const HEIGHT = 100;

const d = 'M 0 50 L 10 50 L 15 70 L 40 130 L 150 20';

const AnimatedPath = Animated.createAnimatedComponent(Path);

function App() {
  const progress = useSharedValue(1);
  const ref = useRef<Path>(null);
  const [pathLength, setPathLength] = useState<null | number>(null);

  useEffect(() => {
    const res = ref.current?.getTotalLength();
    if (typeof res === 'number') {
      setPathLength(res);
    }
  }, []);

  useEffect(() => {
    if (typeof pathLength === 'number') {
      progress.value = withTiming(0, {duration: 3000});
    }
  }, [pathLength]);

  const animatedProps = useAnimatedProps(() => {
    return {
      strokeDashoffset: pathLength === null ? 0 : progress.value * pathLength,
    };
  }, [pathLength]);

  return (
    <View style={{flex: 1, justifyContent: 'center'}}>
      <Svg style={{width: '100%', aspectRatio: WIDTH / HEIGHT}}>
        <AnimatedPath
          ref={ref}
          d={d}
          stroke={pathLength === null ? 'none' : 'black'}
          fill={'none'}
          strokeWidth={2}
          strokeDasharray={pathLength ?? undefined}
          animatedProps={animatedProps}
        />
      </Svg>
    </View>
  );
}

export default App;

Hello @itsramiel,
I tried to reproduce the issue, but couldn't.
Let us know if you still have that issue, Thank you.

Hey @bohdanprog. I tested with latest versions as shown on the bottom of the left side and the issue is still there. I used the same code as in the reproducable
</video

Hi @itsramiel, I tried your code and can confirm that its not working on iOS.
That is related to the fact that while initializing the SVG, the stroke length is 0.
If you add a simple timeout around "getTotalLength()", you will get the actual length and the animation will work.
For example:
export const Test = () => {
    const progress = useSharedValue(1);
    const ref = useRef<Path>(null);
    const [pathLength, setPathLength] = useState<null | number>(null);

    useEffect(() => {
        const timeout = setTimeout(() => {
            const res = ref.current?.getTotalLength();
            if (typeof res === 'number') {
                setPathLength(res);
            }
        }, 0)

        return () => clearTimeout(timeout)
    }, []);

    useEffect(() => {
        if (typeof pathLength === 'number') {
            progress.value = withTiming(0, { duration: 3000 });
        }
    }, [pathLength]);

    const animatedProps = useAnimatedProps(() => ({ strokeDashoffset: pathLength === null ? 0 : progress.value * pathLength }), [pathLength]);

    return (
        <View style={{ flex: 1, position: 'absolute', top: -70, left: -70, justifyContent: 'center', zIndex: 99 }}>
            <Svg style={{ width: 268, height: 268, aspectRatio: WIDTH / HEIGHT }}>
                <AnimatedPath
                    ref={ref}
                    d={d}
                    stroke={pathLength === null ? 'none' : 'white'}
                    fill={'none'}
                    strokeWidth={2}
                    strokeDasharray={pathLength ?? undefined}
                    animatedProps={animatedProps}
                />
            </Svg>
        </View>
    );
}


Older version running on Codelab Computers

The version of Firebase CLI installed on the Codelab Computers (firebase 2.2.x) are older that the version used for the Codelab examples (firebase 3.x.x). It should be indicated in the Codelab documentation that users have to use the updated version of firebase CLI.

Just added that to the instructions. Thanks for the report!


refactor(NODE-5809): remove executeOperation callback overload and maybeCallback

Description
What is changing?

Move .then/.catch chain into callers
Remove maybeCallback
Improve docs over executeOperation

Is there new documentation needed for these changes?
No.
What is the motivation for this change?
This change is effectively a no-op, but it removes the overloads advertized by executeOperation that are no longer used making future changes to executeOperation easier to make.
Double check the following

[x] Ran npm run check:lint script
[x] Self-review completed using the steps outlined here
[x] PR title follows the correct format: type(NODE-xxxx)[!]: description

Example: feat(NODE-1234)!: rewriting everything in coffeescript

[x] Changes are covered by tests
[x] New TODOs have a related JIRA ticket

Failing tests are known to be flaky or unrelated


unsafe.enable_getters_and_setters with suppress_comment raises errors

We aren't able to set unsafe.enable_getters_and_setters option when dependent npm packages suppress the lines using suppress_comment.
We get
// $FlowIssue
^^^^^^^^^^^^^ Error suppressing comment. Unused suppression

Any oversights?

Closing since this issue hasn’t seen a lot of activity. Sorry about that 😣


Use version from most recent update

If the major version changes, the login would not work.
Instead of manually typing it, what about requesting most recent version no. on startup?

Not planned and will not. Current API will work without error after update unless you are using ChatFeed or accessing internal network part. Also the update is still on draft and incomplete

Do you have any problems when applying the content of this issue?


Git and firewall issues with consul_cluster module

I ran into two issues, one of which I was able to resolve.

The format for pulling the consul_cluster module is ssh://git.  I had to rewrite the source to use HTTP to pull the module.

With terraform plan I can't get past issues for the healthcheck.  What is needed here?

Init with unmodified main.tf
$ terraform init
Initializing modules...

module.vault_cluster
Getting source "../../modules/vault-cluster"
module.consul_cluster
Getting source "git::git@github.com:hashicorp/terraform-google-consul.git//modules/consul-cluster?ref=v0.0.1"
Error downloading modules: Error loading modules: error downloading 'ssh://git@github.com/hashicorp/terraform-google-consul.git?ref=v0.0.1': /usr/local/bin/git exited with 128: Cloning into '.terraform/modules/97d73d57bf296cc4c3f5ff801d526b81'...
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
init with modified main.tf
$ terraform init
Initializing modules...

module.vault_cluster
module.consul_cluster
Getting source "github.com/hashicorp/terraform-google-consul//modules/consul-cluster?ref=v0.0.1"

Initializing provider plugins...

Checking for available provider plugins on https://releases.hashicorp.com...
Downloading plugin for provider "google" (1.2.0)...
Downloading plugin for provider "template" (1.0.0)...

The following providers do not have any version constraints in configuration,
so the latest version was installed.
To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.

provider.google: version = "~> 1.2"
provider.template: version = "~> 1.0"

Terraform has been successfully initialized!
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
terraform plan ends with an output problem for the healthchecks.
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.template_file.startup_script_vault: Refreshing state...
data.template_file.startup_script_consul: Refreshing state...

Error: Error running plan: 2 error(s) occurred:

module.vault_cluster.output.firewall_rule_allow_inbound_health_check_url: Resource 'google_compute_firewall.allow_inboud_health_check' not found for variable 'google_compute_firewall.allow_inboud_health_check.self_link'
module.vault_cluster.output.firewall_rule_allow_inbound_health_check_id: Resource 'google_compute_firewall.allow_inboud_health_check' not found for variable 'google_compute_firewall.allow_inboud_health_check.id'

versions
$ terraform version
Terraform v0.11.0

provider.google v1.2.0
provider.template v1.0.0

@darrow The issue is that you're using Terraform v0.11.0, but there's an open discussion about how to handle outputs with resources that can potentially have a count = 0.
I've posted a fix at #7 if you'd like to see how to resolve this, but per that Pull Request, I'd prefer to wait for the discussion to resolve before making any changes. Aside from the labor required to update all outputs of all modules that involve resources that could have count = 0, the new syntax is also less readable, so I'd prefer to hold off on a change for now.
Regarding the git issue, this is a public repo (hence your ability to submit this issue!), but you're also the second person to report this. Nevertheless, I believe this is a local configuration problem. There are many online threads about this (example).
That being said I can't think of a downside to using HTTP URLs, so I'm open to switching. Of course, Terraform 0.11.x supports improved module registry integration, so using the new short URLs is the best approach, but that breaks compatibility with Terraform < 0.11.x, which seems too high a price to pay right now.

That being said I can't think of a downside to using HTTP URLs

There are no major downsides for public repos, but for private repos, HTTP URLs require you to include a username + password, whereas Git URLs will use SSH keys. Probably doesn't matter for this open source repo, but just thought I'd mention it.

Ah, that's a good point. In that case, I'd rather stick with Git URLs so that Users can learn to standardize on a single URL format.

@josh-padnick thanks, your fix in #7 worked for me.


Syntax highlighting informational

Added a guide to setup syntax highlighting for Notepad++ and VSCode.

Thanks <3
Adding an entry to SUMMARY.md so it shows up in the sidebar as well and then merging ^^


Knowing where an argument is from ?

Hello,
I have a question : is there a way, with JSS, to know where an argument is from ? For example :
...
public void method(...){
    ...
    connect(u);
}

Was u declared in the method body ? Does it come from its parameters ? Is it a static class attribute ? ...
Thank you !

When you use JavaParserFacade.solve you should get back an instance of SymbolReference<? extends ValueDeclaration>.
A ValueDeclaration has many methods that can be used to figure out what kind of value it is.  For example, you can call isParameter to check if it is a parameter and in that case you can call asParameter on that value converting it to a parameter declaration on which you can call more specific methods.
Does it help?

This is exactly what I wanted ! Thank you so much :)

Hum, I still struggle a bit : can I get the wrapped node with this method ? valueDeclaration.asParameter() gives me a ParameterDeclaration, and not a JavaParserMethodDeclaration and I can't do : JavaParserParameterDeclaration jppd = argDeclaration.asParameter();

Oh, I see, we do now have the asParameter method implemented correctly. I should fix that

This should be fixed by #254 and be included in next release


Normalization lost when executing method refresh

Hello,
Working with a SPA application, For some reason the normalization of fields is lost when executing the refresh method, so the result of the filter is not displayed.
I added a call to the normalization method whenever loadData is executed, and it worked.
My alternate implementation to work around this problem:
`
  let self = this
  let obj
  let normalizedFields = []
  this.fields.forEach(function(field, i) {
    if (typeof (field) === 'string') {
      obj = {
        name: field,
        title: self.setTitle(field),
        titleClass: '',
        dataClass: '',
        callback: null,
        visible: true,
      }
    } else {
      obj = {
        name: field.name,
        title: (field.title === undefined) ? self.setTitle(field.name) : field.title,
        sortField: field.sortField,
        titleClass: (field.titleClass === undefined) ? '' : field.titleClass,
        dataClass: (field.dataClass === undefined) ? '' : field.dataClass,
        callback: (field.callback === undefined) ? '' : field.callback,
        visible: (field.visible === undefined) ? true : field.visible,
      }
    }

    normalizedFields.push(obj)
  })

  this.tableFields = normalizedFields

}`

Is this really necessary, or am I wrong somewhere?
Translated by google ;)

@johnsoons This looks like the same issue here.
If you dynamically change fields definition, you will need to call normalizeFields, so that the fields definition is properly parsed. This can be done in Vuetable-2 by creating a ref in your <vuetable> tag like so,
  <vuetable ref="vuetable"
    //...
  ></vuetable>

Then, you can call normalizeFields like this
  this.$refs.vuetable.normalizeFields()

Thanks for the @ratiw return,
It really makes sense to place them dynamically in change fields, however, in the case in question the columns fields are not changed, only the data with the filter result is changed.

@johnsoons Sorry, I don't quite understand what you mean. Perhaps you could should me the output of the code or error messages.

Hi @ratiw,
When you first get the data, everything works correctly

id
Name
Age

1
Janice D. Buckner
20

2
John G. Aragon
31

3
Lynn C. Whitt
40

After filtering, the data is retrieved correctly, however as normalization is lost the columns are added and the data is not listed.

---
---
---

With the solution I mentioned, this problem in my case solved.
Thanks for listening!  :)


Implement zero-knowledge

We plan on porting ideas and code from here https://github.com/varunthakore/Nova to the Arecibo repo.
The implementation should work with both Nova and SuperNova base implementations and will be an optional feature.

https://github.com/lurk-lab/arecibo/pull/380


The Image preview stopped working

This is what i see when i try to select an image to use

I see the images request does come back successfully from unsplash API but the preview loading images stay as this forever
My environment:
PHP: 8.0
Laravel: 8.82.0
statamic : 3.2.32
statamic-splash: 1.0.6

Hi @bomshteyn, this should have been fixed in v1.0.6  due to a missing JS dependency (https://github.com/aryehraber/statamic-splash/issues/11).
Could you try force-refreshing your browser and/or opening in an incognito window?

Fixed this by running npm run prod


[NEW]: Waku 'light node' in rust

Introduction

Who you are: My name is Peg, i grew up in London and live in Germany. I am passionate about peer-to-peer networks and protocols. github.com/ameba23 gitlab.com/pegpeg.
What you do: I work for Entropy, a threshold signing MPC network. Previously worked on Dark Crystal social key recovery.
How you got first into Ethereum: I was working on a social recovery system for the peer-to-peer social network 'secure scuttlebutt'. Since key recovery systems are also relevant to blockchain we had a lot of interest from blockchain projects which took me in that direction.
What brings you to ETHBerlin: The opportunity to learn together with a bunch of motivated hackers.

Idea description
Waku 'light node' in rust
Waku is a suite of generalised messaging protocols aiming to be the communication standard for the decentralised web. It is used by Status instant messaging, Railgun and the Graph.
Waku has implementations in Nim, Go and JS.  For rust there are bindings to the Go implementation, but these require that the Go implementation is built and installed and make it difficult to understand logs and errors without understanding the Go implementation.
There is already an unofficial rust implementation, but its is not actively maintained and has several issues. But it can serve as the inspiration or base for this project.
Given how much time we have, the proposal is to only make a 'light node', that is implement the following protocols:

peer exchange
filter
light push

These are much simpler and easier to implement than the full-node protocol, but downside is that they rely more on existing infrastructure, meaning things are more centralised. However it does allow us to be able to send and receive Waku messages, so its a good start.
Skillset
What skills do you need, or think you might need to implement the idea?

[ ] Knowledge of the waku protocols
[ ] Knowledge of libp2p (as waku is largely based on libp2p)
[ ] JS/typescript - for understanding the waku JS implementation
[ ] Go - for understanding the waku Go implementation
[ ] Nim - for understanding the waku Nim implementation
[ ] Rust - for this project
[ ] General experience with protocols / networking
[ ] Enthusiasm!

Communication

[ ] Matrix handle: @peg_23:matrix.org

Here is the project, if anyone is interested: https://github.com/LesnyRumcajs/waku-oxidized


[web] config.show.*=false do not work in UI V3

What version of pinpoint are you using?
3.0.0
Describe the bug
config.show.systemMetric=false
config.show.urlStat=false
config.show.exceptionTrace=false
When these features are disabled (no pinot), the left submenus are  still shown. UI V2 works, but not UI V3.

Expected behavior
system metrics / url stat / exception trace menus should be hidden.

This has been fixed through https://github.com/pinpoint-apm/pinpoint/commit/88f348f18cb3965fcce57e9fda0b5aba0e0efca0

Any schedule time for the release v3.0.1 ?


Feature request: Handle 429 rate_limit_error

Error:
429 {"type":"error","error":{"type":"rate_limit_error","message":"Number of request tokens has exceeded your per-minute rate limit (https://docs.anthropic.com/en/api/rate-limits); see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase."}}
Suggestion: Add a timer and avoid such errors before sending any request.

According to claude docs the error should be providing how long you have to wait, so could use that to provide a loading bar.

According to claude docs the error should be providing how long you have to wait, so could use that to provide a loading bar.

Yes, thank you.
And automatically retry the request after {WAITING_DELAY}+1s.

I would like to request that this value be customizable. For weird limitations I can't get into, my access to Bedrock is capped at 1 request / minute. It would be nice to not only have the timer, but ETA of total time it would take to do the current job at this rate :)

Another option would be to cycle to a different API key from a different Claude.ai account.  Probably a violation of their TOS though.  Acct1Key returns a 429, retry with Acct2Key.  Once Acct2Key returns a 429, go to Acct3Key if available or back to Acct1Key.  Etc.
Of course, you have to pay for and manage usage across multiple accounts on Anthropic.  The TOS violation might be from one person having multiple accounts, I've not looked into that aspect.
I can do this manually, but it's a hassle.  I could also do it using a local proxy to Anthropic to handle the key switching, but I can't add a local proxy into Claude Dev.

There are a few 429 limits:

Tokens per minute
Requests per minute
Tokens per day

Would be nice to get the header response in this case, so you can see when it will reset (especially the daily limit T_T)
UX improvement would be to show timer once hit, retry if the per minute limit is reached.
Nice to have:
If say 90% of daily limit is used, show warning.

I might add rate limit info to the task header, but for now if you're running into rate limit issues I suggest using the OpenRouter API option as they now support prompt caching and have much better rate limits

face the same issues. and search lead to here.


Restarting VoiceOver with this spoon active causes hammerspoon to lock up

I'm wondering if you're not checking if VoiceOver is active or not somewhere?

Also, if your VO hard-crashes, it will stop grabbing phrases. Think that's an issue with the APpleScript code being used globally though, Transpoon has the same problem

Transpoon has the same problem as this. Just posted the following over there, and it applies here too:
Once HS starts eventually responding again, this is written:
2022-09-23 11:38:30: {
  NSLocalizedDescription = "VoiceOver got an error: AppleEvent timed out.",
  NSLocalizedFailureReason = "AppleEvent timed out.",
  OSAScriptErrorAppAddressKey = '<NSAppleEventDescriptor: [0x0,842842 \\"VoiceOver\\"]>',
  OSAScriptErrorAppNameKey = "VoiceOver",
  OSAScriptErrorBriefMessageKey = "AppleEvent timed out.",
  OSAScriptErrorMessageKey = "VoiceOver got an error: AppleEvent timed out.",
  OSAScriptErrorNumberKey = -1712,
  OSAScriptErrorRangeKey = "NSRange: {75, 7}"
}

Can't figure out a good way to fix this, tried:
    if hs.application.get("VoiceOver") == nil then
        return
    end

in the getLastPhrase function, but that didn't fix it.


Extension host terminated unexpectedly.

There are only really a couple steps:

Open VS Code
Open a file or workspace
Extension host terminates.

I've been dealing with this issue for over a month now with no idea how to address it.  Could it be my very old version of OS X (El Capitan)? Although it was working just fine for a while.
I would love any suggestions.

Any other information I can provide please let me know.

/duplicate https://github.com/microsoft/vscode/issues/125989


small wasm files example is actually huge!

While the documentation claims the add_bg.wasm would be 710 byte, it's more like 700KB
Either using the online demo or building my own with --release flag produces a huge binary
Current demo file: https://rustwasm.github.io/wasm-bindgen/exbuild/add/23a8ffdd74ff21744bf0.module.wasm
Putting it into wasm2wat show that a huge zero filled data string is embeded inside the wasm file

rustc 1.34.0-nightly (f47ec2ad5 2019-02-14)

Thanks for the report! The extra size here is dwarf debugging information which is typically stripped by default in release builds but we has a misconfiguration that was fixed recently in https://github.com/rustwasm/wasm-bindgen/pull/1255 and deployed pretty recently as well. The examples haven't fully rebuilt and redeployed yet but they'll be taken care of soon!

Updated to 0.2.37, everything looks good!
As always, thanks for your reactivity :)

Just ran into this ... @IcanDivideBy0 what  did you update to correct this? @alexcrichton looks like the fix her is merged right? I am using 0.2.38 version wasm-bindgen but the issue is still there:
Compiling proc-macro2 v0.4.27
Compiling unicode-xid v0.1.0
Compiling wasm-bindgen-shared v0.2.38
Compiling cfg-if v0.1.7
Compiling lazy_static v1.3.0
Compiling wasm-bindgen v0.2.38
Compiling log v0.4.6
Compiling quote v0.6.11
Compiling syn v0.15.27
Compiling wasm-bindgen-backend v0.2.38
Compiling wasm-bindgen-macro-support v0.2.38
Compiling wasm-bindgen-macro v0.2.38

@jlb6740 Simply updated wasm-bindgen to 0.2.37
did you compiled with the --release flag ?
also running the binaryen's utility wasm-opt can help a lot

@jlb6740 in addition to @IcanDivideBy0's suggestions, can you gist an example to reproduce what you're seeing? That might help us debug!

Hi .. Yes thanks @IcanDivideBy0 for the suggestion. I use the release flag and the file size is much smaller than the debug, but still larger than expected (180K instead of 989K). I have an example function where wasm-opt seemed to strip out code that I didn't consider dead .. I need to look at the options for this command more carefully but I agree this is a good suggestion. For now I have been doing wasm2wat and then wat2wasm instead of using bindgen or wasm-opt. @alexcrichton I put the code I am compiling here: https://gist.github.com/jlb6740/e31cf87f0906663995e654f3dea0caf5 . I have not been working with rust for long so I wouldn't be surprised if it is something trivial I am overlooking. Thanks.

@jlb6740 you may want to be sure to consult https://rustwasm.github.io/docs/book/reference/code-size.html when shrinking wasm, but if I check out that gist and run wasm-pack build it produces a 862 byte binary which I think is probably what you're looking for?
WebAssembly is a fundamentally low-level format that requires a lot of tools to work in concert right now so if you're just using rustc without wasm-bindgen and/or wasm-pack you'll need to reimplement the functionality that they bundle in with your workflow as well.

As @alexcrichton pointed it out, after running the wasm-bindgen cli, you .wasm file shrink down to 862 bytes!

Hi ... 862 Bytes is a lot smaller than what I see with bindgen (180K). I don't know then what is different with my environment ... seems pretty straight forward but I would like to know. I am compiling with cargo build --release.
What you get from bindgen though is still discouraging. Nnot to get side tracked, but I am getting much smaller sizes ... 170 bytes by using wasm2wat:
cd wasm_binaries; cp fib.wasm fib.wasm.orig; wasm2wat fib.wasm.orig > fib.wasm; wat2wasm fib.wasm; cd ../;
Even if ignore all the \00 , the code is not as barebones as when I exclude bindgen. Code without bindgen:
(module   (type (;0;) (func))   (type (;1;) (func (param i32) (result i32)))   (func (;0;) (type 0))   (func (;1;) (type 1) (param i32) (result i32)     (local i32)     i32.const 1     set_local 1     block  ;; label = @1       get_local 0       i32.const -1       i32.add       tee_local 0       i32.const 2       i32.lt_u       br_if 0 (;@1;)       i32.const 1       set_local 1       loop  ;; label = @2         get_local 0         call 1         get_local 1         i32.add         set_local 1         get_local 0         i32.const -2         i32.add         tee_local 0         i32.const 1         i32.gt_u         br_if 0 (;@2;)       end     end     get_local 1)   (table (;0;) 1 1 anyfunc)   (memory (;0;) 16)   (global (;0;) (mut i32) (i32.const 1048576))   (global (;1;) i32 (i32.const 1048576))   (global (;2;) i32 (i32.const 1048576))   (export "memory" (memory 0))   (export "__heap_base" (global 1))   (export "__data_end" (global 2))   (export "_call" (func 1)))
Code with bindgen includes a lot of references to bindgen.. including a lot of calls some placeholder import stuff which I am not sure the purpose.
@alexcrichton @IcanDivideBy0 Any comments on this later size discrepancy? What is Bindgen adding for you that is not included in my wat printout above?

cargo build --release
wasm-bindgen target/wasm32-unknown-unknown/release/fib.wasm --out-dir .
wasm-opt -Os  fib_bg.wasm -o fib_bg.wasm
stat -c %s fib_bg.wasm
228

and here is the text format i get
(module
  (type $t0 (func (param i32) (result i32)))
  (func $f0 (type $t0) (param $p0 i32) (result i32)
    (local $l1 i32)
    (local.set $l1
      (i32.const 1))
    (if $I0
      (i32.ge_u
        (local.tee $p0
          (i32.add
            (local.get $p0)
            (i32.const -1)))
        (i32.const 2))
      (then
        (loop $L1
          (local.set $l1
            (i32.add
              (call $f0
                (local.get $p0))
              (local.get $l1)))
          (br_if $L1
            (i32.gt_u
              (local.tee $p0
                (i32.add
                  (local.get $p0)
                  (i32.const -2)))
              (i32.const 1))))))
    (local.get $l1))
  (func $_call (export "_call") (type $t0) (param $p0 i32) (result i32)
    (call $f0
      (local.get $p0)))
  (memory $memory (export "memory") 17))

Using --remove-producers-section flag, i went down to 104 bytes.
So I guess that's where the difference with the WAT size comes from.
wasm-bindgen target/wasm32-unknown-unknown/release/fib.wasm --remove-producers-section --out-dir .

@IcanDivideBy0 Ok, cool. That actually looks like it should be fewer bytes smaller in binary than the file I am producing. I am not using wasm-opt though for the reason I mentioned. What is the size before wasm_opt .. just using bindgen? If I use wasm opt I can get the binary down further to 142 bytes instead of 170 bytes and my wat printout is also a little smaller. I definitely will try to use this after understanding the one example it appeared to break for me.
W.r.t your binary size, I suppose the WASM binary you have has some metadata that is not output here. My WASM binary size for what I posted is only 170 bytes. The size of the WASM file is critical for me because I am taking the files, dumping the file with hexdump and then embedding this as a data array in a tiny footprint interpreter I am running. I am curious now between bindgen vs wasm-opt w.r.t. the wat file you show and which is having the greater impact on wat size. I am also curious if I need to keep running wasm2wat and wat2wasm to get a small binary or if either bindgen or wasm-opt can get rid of whatever data is making your binary larger than it needs to be for my use case.

@IcanDivideBy0 lol .. cool. We had the same question. I will give this a try as soon as I can get past my first size problem and get down to 228bytes
.

I'm seeing something similar, with latest versions. On top of seeing zero-filled data, I also see some assertion failure data creeping in the binary:
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub fn run() -> Result<(), JsValue> {
    Ok(())
}

$ cargo build --release
$ wasm-bindgen --version
wasm-bindgen 0.2.47
$ wasm-bindgen --remove-producers-section --remove-name-section --out-dir . target/wasm32-unknown-unknown/release/test.wasm

(module
  (type (;0;) (func))
  (func (;0;) (type 0))
  (memory (;0;) 17)
  (export "memory" (memory 0))
  (export "run" (func 0))
  (export "__wbindgen_start" (func 0))
  (data (;0;) (i32.const 1048576) "\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00")
  (data (;1;) (i32.const 1049152) "\00\00\00\00assertion failed: `(left == right)`\0a  left: ``,\0a right: ``\00\00D\02\10\00-\00\00\00q\02\10\00\0c\00\00\00}\02\10\00\01\00\00\00/Users/jean/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-0.2.47/src/lib.rs\00\00\98\02\10\00Z\00\00\003\04\00\00\09\00\00\00\03\00\00\00\04\00\00\00\04\00\00\00\04\00\00\00\05\00\00\00\06\00\00\00\07\00\00\00\00\00\00\00\01\00\00\00\08\00\00\00called `Option::unwrap()` on a `None` valuesrc/libcore/option.rs,\03\10\00+\00\00\00W\03\10\00\15\00\00\00[\01\00\00\15\00\00\00\09\00\00\00\10\00\00\00\04\00\00\00\0a\00\00\00\0b\00\00\00\0c\00\00\00\0c\00\00\00\04\00\00\00\0d\00\00\00src/liballoc/raw_vec.rscapacity overflow\bf\03\10\00\11\00\00\00\a8\03\10\00\17\00\00\00\ec\02\00\00\05\00\00\00\10\00\00\00\00\00\00\00\01\00\00\00\11\00\00\00index out of bounds: the len is  but the index is \00\00\f8\03\10\00 \00\00\00\18\04\10\00\12\00\00\00called `Option::unwrap()` on a `None` valuesrc/libcore/option.rs<\04\10\00+\00\00\00g\04\10\00\15\00\00\00[\01\00\00\15\00\00\00src/libcore/slice/mod.rsslice index starts at  but ends at \00\ac\04\10\00\16\00\00\00\c2\04\10\00\0d\00\00\00\94\04\10\00\18\00\00\00\01\0a\00\00\05\00\00\000x00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\00\00\00\00\00\00src/libcore/fmt/mod.rs\00\00\c0\05\10\00\16\00\00\00H\04\00\00(\00\00\00\c0\05\10\00\16\00\00\00T\04\00\00\11\00\00\00"))

[package]
name = "test"
version = "0.1.0"
edition = "2018"

[lib]
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = "0.2"

$ cargo tree
test v0.1.0 (/Users/jean/code/test)
└── wasm-bindgen v0.2.47
    └── wasm-bindgen-macro v0.2.47
        ├── quote v0.6.12
        │   └── proc-macro2 v0.4.30
        │       └── unicode-xid v0.1.0
        └── wasm-bindgen-macro-support v0.2.47
            ├── proc-macro2 v0.4.30 (*)
            ├── quote v0.6.12 (*)
            ├── syn v0.15.38
            │   ├── proc-macro2 v0.4.30 (*)
            │   ├── quote v0.6.12 (*)
            │   └── unicode-xid v0.1.0 (*)
            ├── wasm-bindgen-backend v0.2.47
            │   ├── bumpalo v2.4.3
            │   ├── lazy_static v1.3.0
            │   ├── log v0.4.6
            │   │   └── cfg-if v0.1.9
            │   ├── proc-macro2 v0.4.30 (*)
            │   ├── quote v0.6.12 (*)
            │   ├── syn v0.15.38 (*)
            │   └── wasm-bindgen-shared v0.2.47
            └── wasm-bindgen-shared v0.2.47 (*)

running wasm-opt removes the zero-filled data object but the second one is still there.

@JeanMertz Do you get the same result when using the rust-webpack-template?
(Make sure to use npm run build for maximum optimizations)

@JeanMertz the issue about panic/assertion strings should be fixed by https://github.com/rustwasm/wasm-bindgen/commit/d9e53ac2f6fdc9b659e1b6a812f860c1cf408eab, it was a recent regression but hasn't been published to crates.io yet


Integrate range scan encoder changes with timer implementation

What changes were proposed in this pull request?

Previously timer state implementation was using No prefix rocksdb state encoder. When doing iterator() or prefix(), the returned iterator is not sorted on timestamp value. After Anish's PR for supporting range scan encoder, we could integrate it with TimerStateImpl such that we will use range scan encoder on timer to key.
Why are the changes needed?

The changes are part of the work around adding new stateful streaming operator for arbitrary state mgmt that provides a bunch of new features listed in the SPIP JIRA here - https://issues.apache.org/jira/browse/SPARK-45939
Does this PR introduce any user-facing change?

No
How was this patch tested?

Added unit tests in TimerSuite
Was this patch authored or co-authored using generative AI tooling?

No

@jingz-db mind liking the JIRA into the PR title? See also https://spark.apache.org/contributing.html

@jingz-db mind liking the JIRA into the PR title? See also https://spark.apache.org/contributing.html

Just did. Thanks!

Thanks! Merging to master.


Pin juju terraform provider to 0.8.0

sunbeam-terraform fails with new versions of
juju terraform provider, see [1]. Pin the
version to 0.8.0 until [1] is fixed and released.
[1] juju/terraform-provider-juju#310

Depends on:

https://github.com/canonical/sunbeam-terraform/pull/8


Hide Previous button on #actions overwrite

When overwriting the #actions template to get your own labels on button, the hiding of the "previous button" on first step is not activated anymore. To hide it the same way as in the VTour.vue file we would have to be able to access the currentStep prop value - can it therefor be made available?
<VTour :steps="steps" startDelay='1000' autoStart highlight>
    <template #actions="{ nextStep, prevStep }">
        <div class="vjt-actions">
            <button type="button" @click.prevent="prevStep">Go back</button>
            <button type="button" @click.prevent="nextStep">Go on</button>
        </div>
    </template>
</VTour>

The same is the case for my "Go on" button, when I want it to become a "Finish" button.

Good catch 👍
I'll add it as soon as i'm back from vacation