Simplify x-element.

Concept branch — the goal here is to reimagine x-element based on our learnings from using it in hundreds of components in a complex SPA over the last year.
Significant changes:

Static analysis is done up-front, once.
Anything that can be validated statically throws errors.
Entire XElement interface is static (though we may provide convenience wrappers).
Static interface is ready for private (#) static fields when they're ready.
observer is now a function (proper context is maintained if it's a constructor method).
computed is now resolver and it's a function (proper context is maintained if it's a constructor method).
dependencies is new and it's an array of strings to be resolved to property values and passed into the resolver callback.
Type coercion is no longer done on set.
Errors are thrown when you set a weird type in the runtime.
Concept of "readOnly" is first-class.
Concept of "internal" is first-class.
Internal setting/getting and read-only setting can be done via the .internalProperties proxy.
Computed properties are now lazily evaluated.
Concept of a "render root" is now supported.
Initial template is now cached on each host.
We always perform an initial resolution for resolved properties. Previously, we had thought we might want to defer initial resolution until at least one dependency was defined.
Swapped the order of values in observer callbacks to be value, oldValue — it was previously oldValue, value.
Order of operations are now compute, reflect, render, then observe.
Listener logic has been improved and interface is now a function, not a string (proper context is maintained if it's a constructor method or instance method).
Coercion of null and undefined to '' is removed, the underlying templating engine takes care of this for us.
observation, reflection, and resolution are no longer synchronous. Importantly, this allows us to set properties one-by-one and then get a single resolution at the end.
Deserialization of anything other than [Boolean, String, Number, BigInt] now throws a halting error. Previously, we basically did nothing, especially for custom classes.

@klebba — mind taking a look when you have the chance? Also happy to walk you through the changes. I think you'll like the general direction here.

The most recent change is because I was using some functionality not supported in eslint yet because it's stage 3 functionality. I didn't think the code suffered much to walk it back, so I just made sure it adhered to stage 4 functionality.

@klebba — I left a couple things in limbo here. Please hold off on looking at the code until I get the chance to fix.

I tried swapping this in for a feature I'm working and might have caught an issue; my observer functions are not being. Here's my property block:
  static get properties() {
    return {
      targetRect: {
        type: DOMRect,
      },
      open: {
        type: Boolean,
        reflect: true,
        observer: this.observeOpen,
      },
      _parentElement: {
        type: HTMLElement,
      },
      _cssProperties: {
        type: Object,
        dependencies: ['_parentElement', 'targetRect', 'open'],
        resolver: this.computeCSSProperties,
        observer: this.observeCSSProperties,
      },
    };
  }

My demo page has markup like:
<x-inspector debug open .targetRect="${rect1}">[...]</x-inspector>

So some of the values need to be read immediately following element upgrade. Also I just grabbed whatever I saw in the PR for x-element.js a few minutes ago so maybe it's not ready for this yet, but I thought I'd give it a try because I think the change in order for render/reflect etc might be helpful for this feature

So some of the values need to be read immediately following element upgrade.

The initial update is done synchronously upon the first connectedCallback. This will cause, synchronously, your properties to be initialized, computed, reflected, rendered, and then observed.
I think that your component will be supported, the PR has just been thrashing a bit. Importantly, I think that properties block is looking good! As a reminder, the new way you'd want to write this would be like:
class CustomElement extends XElement {
  static get properties() {
    return {
      targetRect: {
        type: DOMRect,
      },
      open: {
        type: Boolean,
        reflect: true,
        observer: this.observeOpen,
      },
      parentElement: {
        type: HTMLElement,
        internal: true,
      },
      cssProperties: {
        type: Object,
        internal: true,
        dependencies: ['parentElement', 'targetRect', 'open'],
        resolver: this.computeCSSProperties,
        observer: this.observeCSSProperties,
      },
    };
  }
}

@klebba I circled back on the issue you were having and perhaps there is a different bug that I'm misunderstanding. I've had a test in place the entire time to ensure that resolved, observed properties are synchronously called upon initial connection.
Would you mind trying to create a minimal example element that demonstrates your issue? It'd be super helpful!

OK, I'm willing to say that it makes sense to start trying to use this in your work as an experiment. I'm quite sure there will be some issues that need ironing out, but things should be stabilizing at this point.

Let's start curating a migration guide:
was:
static get properties {
  return {
    myProperty: {
       type: String,
       computed: 'computeMyProperty(foo, bar)',
    }
  }
}

now:
static get properties {
  return {
    myProperty: {
       type: String,
       resolver: this.computeMyProperty,
       dependencies: ['foo', 'bar'],
    }
  }
}

was:
this.listen(target, 'eventName',  callbackPointer);
this.unlisten(target, 'eventName',  callbackPointer);

now:
this.addListener(target, 'eventName',  callbackPointer, options);
this.removeListener(target, 'eventName',  callbackPointer);

static async observePage(host, current, last) {

This throw an error:
Uncaught Error: Unexpected value for "XPages.properties.page.observer" (expected Function).

If I remove the async it appears to work

Uncaught Error: Unexpected value for "XPages.properties.currentElement" (expected HTMLElement).
Would be nice to say got ${value} here as well

Error: Property "XPages.properties.currentElement" has resolver (cannot be set).

Might read better as:
Error: Property "XPages.properties.currentElement" is read only. (defined by resolver ${resolverName}).

Or similar

observer: this.observeModel,

Does not throw even though this function does not exist

Here's an issue that seems like a bug:
    model: {
        type: Object,
        observer: this.observeModel,
      },
      currentElement: {
        observer: this.observerCurrentElement,
      },
      binding: {
        type: Boolean,
        internal: true,
        dependencies: ['currentElement', 'model'],
        resolver: this.computeBinding,
      },

The resolver function for binding is never called even though I'm able to confirm that both observers (this.observerModel and this.observerCurrentElement) are being called with the values I would expect. Note: I'm trying to port x-pages

Also a question; if I throw in a resolver function what happens?

It will be a runtime error that will just keep reoccurring every time something asks for that value.

If I remove the async it appears to work

Thanks, need to check for either AsyncFunction or Function.

observer: this.observeModel,
Does not throw even though this function does not exist

Yah, I've been loose about undefined. I'll change it to a Reflect.has check instead of !== undefined.

The resolver function for binding is never called even though I'm able to confirm that both observers (this.observerModel and this.observerCurrentElement) are being called with the values I would expect. Note: I'm trying to port x-pages

Are you sure it's this.computeBinding, and not this.resolveBinding? I'm wondering if the loose undefined check was just problematic.

@klebba — not sure if I'd consider it a bug, but we specifically decided to move observation after rendering. So I think that might be where the trouble is coming from. What if we just untangled the observer callbacks so you don't have observers setting values which cause observers?
class XPages extends XElement {
  static get properties() {
    return {
      current: {
        type: String,
        reflect: true,
      },
      items: {
        type: Object,
      },
      model: {
        type: Object,
      },
      update: {
        type: Object,
        internal: true,
        dependencies: ['current', 'items', 'model'],
        resolver: (current, items, model) => ({ current, items, model }),
        observer: this.observeUpdate,
      },
    };
  }

  static observeUpdate(host, { current, items, model }, oldValue) {
    const container = host.shadowRoot.getElementById('container');
    if (current && current === oldValue.current) {
      // same page, re-bind the model
      container.firstChild.model = model;
    } else if (current && current !== oldValue.current) {
      // new page, clean up old page and create next page
      container.firstChild && container.firstChild.remove();
      const element = document.createElement(items[current]);
      container.appendChild(Object.assign(element, { model }));
    } else if (!current) {
      // no page, insert a slot so default content can be displayed
      container.firstChild && container.firstChild.remove();
      container.appendChild(document.createElement('slot'));
    }
  }

  static template(html) {
    return () => html`

    `;
  }
}

Would be nice to say got ${value} here as well

Yah, I haven't spent much time thinking about the messaging. I figured I'd start by at least making sure the things throw when we want them to throw.

Thanks for all the fixes! Your x-pages refactor makes sense to me, but I still wonder why my callback never got called — maybe I'm missing something. Let's review together and I'll explain why I expected it to work

but I still wonder why my callback never got called

Was it because you were using a resolver for a side effect and never looking at the actual value? Resolvers are lazily invoked, if you never ask for the return value, it never gets called. Moreover, they're memoized, we shouldn't depend on side effects in them.

@klebba — that code coverage though.
# Coverage goal of 100% for<EMAIL_ADDRESS>met (got 100.00%).
I actually caught a couple REAL BUGS attaining that 100% code coverage mark! Totally worth the effort 👍

Wow, awesome!

What do you think about adding a lazy: false flag to force evaluation of a computed property?

The message Property "DemoView.properties.guardRemove" is internal (element authors may use "internal") might be more clear as Property "DemoView.properties.guardRemove" is internal (internal.${prop})

I hit an issue where my dependency set for a computed property includes an internal property; Property "XInspector.properties.myProp" is internal (element authors may use "internal"). — seems like this should work right?

I hit an issue where my dependency set for a computed property includes an internal property; Property "XInspector.properties.myProp" is internal (element authors may use "internal"). — seems like this should work right?

It's hard for me to debug if I don't have an example. It shouldn't be an issue to include internal properties as dependencies for resolved properties. If you are seeing this error, then I've made a mistake for sure and I'll fix it.
I tried to repro, but I wasn't able to hit the error you're seeing.

The message Property "DemoView.properties.guardRemove" is internal (element authors may use "internal") might be more clear as Property "DemoView.properties.guardRemove" is internal (internal.${prop})

Yah, I can reword. I'm just nervous about obscuring the fact that this is for authors only.

What do you think about adding a lazy: false flag to force evaluation of a computed property?

Can you provide an example of when you'd want this?

I figured out the issue with my internal pipeline; turns out it had nothing to do with the internal setting. The error message was a bit of a red herring. I had a name collision with a true DOM property — parentElement — and XElement freaked as a result. Not certain what we can do here; would be a little annoying to keep a list of know properties that could collide with user defined properties. Any thoughts?

Yep, we already keep a list of library-reserved properties. Try setting a property to internal. You should get a nice error.
As for shadowing in general, can we just lookup the property name after we've deleted it off the host during upgrade? I.e., if your prototype chain has that property already, throw an error.

Minor comment:
throw new Error(`Property "${path}" is resolved (resolved properties are read-only).`);

Would be more clear as:
throw new Error(`Property "${path}" is computed (computed properties are read-only).`);

throw new Error(Property "${path}" is computed (computed properties are read-only).);

Hmm, didn't we want walk away from the language of "computed"? This would be the only place that we'd use that word.

My thinking here is that we still have computed properties, but the way we define them is to specify their dependencies and resolver function — a property definition which has these fields is considered computed — we could also call it derived if you want to disambiguate from old and new implementations

Got it. Yah, instead of me updating this right now, maybe we can bike shed as a group. Ideally, the language used in the property definitions matches the language we see in the error messages and matches naming conventions in the code.

Sounds like a plan. I have an element that hooks into afterInitialRender -- do we still intend to include hooks like this?

Total nit: I recommend we rename propertiesProxy to propertyProxy

I have an observer that I expect to be called once; when the newValue is defined and the oldvalue is undefined I kick off a subroutine. However the observer function is called many times in succession with the same values for newValue and oldValue, making it difficult to detect the edge where newValue is first populated

Total nit: I recommend we rename propertiesProxy to propertyProxy

🤔 but it's a proxy for the properties object. that doesn't make sense to me, but I'll change it if you want 👍

Related: it seems like the render() method is no longer a public method available for override, breaking some of my integrations where I insert my code into this part of the element lifecycle

We can add it back. I'm just trying to make sure we need all of these things. Can you paste an example of this to help me understand? I've never seen this method used outside of a render guard, which is an anti-pattern.

I have an element that hooks into afterInitialRender -- do we still intend to include hooks like this?

In previous conversations, we decided that many of these hooks bloated our codebase. Let's discuss your use-case and decide if it's strictly necessary. I would really like to error on the side of having a smaller interface wherever possible.

I have an observer that I use when a value is first defined; e.g. when newValue is defined and oldvalue is undefined I kick off a subroutine. However the observer function is called many times in succession with the same values for newValue and oldValue, making it difficult to detect the edge where newValue is first populated. This seems to differ from the last implementation, is this expected?

I must have introduced a bug. I thought I had a test for exactly this case, but I'll dig in tonight. You should never get called with the same arguments in an observer. Sorry about this!

@klebba , how would you feel about having the following:
renderCallback(initial) {
  console.log('this is the first time we rendered', initial);
}

A couple notes:

Note that there's no skipping a render anymore. Previously, you could just not call super.render and that could potentially cause all sorts of confusion since the DOM won't have been created which can be super confusing. Instead, you are forced to render something, even if it is nothing.
Instead of two callback functions, we just give you a boolean flag initial which indicates whether or not you've rendered for the first time ever.
You cannot render. The rationale for this is that it can again be a serious source of confusion.  The host won't have been initialized and it would be super confusing.
If we must have a way to cause a render, I'd rather expose invalidate again, which would simply enqueue a render in the future under-the-hood.

At any rate, I think the renderCallback (so named to match the conventions and flavors of other, native callbacks) may be enough for your needs.

I must have introduced a bug. I thought I had a test for exactly this case, but I'll dig in tonight. You should never get called with the same arguments in an observer. Sorry about this!

I have a test case that specifically touches this functionality. Can you paste an example @klebba?

Total nit: I recommend we rename propertiesProxy to propertyProxy

So, I did a bit of renaming such that internally, we have propertyMap and attributeMap and listenerMap. This allows us to deconflict referring to these objects as just properties and internal in our instance-side code. It's a bit of overloading, but I think that it ends up reading well.
In other words, propertiesProxy >> properties and internalPropertiesProxy >> internal.

Related: it seems like the render() method is no longer a public

I did some refactoring here to to allow this again. As we discussed, you can break things if you misuse render right now (e.g., infinite loop because you set a property inside render). (I may still add a guard to prevent render from being called before the host is initialized).

Working through more integration; I wonder if it would be a good idea to make it possible to return the last references from a computed function. The use case is that I want to scan the incoming dependencies and detect if I should mint a new reference (e.g. another array) or just return the last one. Since the reference won't have changed, downstream dependency resolvers would not be called

I wonder if it would be a good idea to make it possible to return the last references from a computed function

That's an interesting idea and could be pretty neat:
static get properties() {
  return {
    a: {},
    b: {},
    c: { dependencies: ['a', 'b'], resolver: this.resolveC },
  }
}

// Just pass the last value.
static resolveC(a, b, oldValue) {/* .. */}

// Pass everything as an object.
static resolveC(a, b, { args: [lastA, lastB], value }) {/* .. */}

@charricknflx @codeStryke @erahhal — Here's that PR I was talking about. I think a good starting point might be to read through the top-level comment (description) in this PR. Another good kickoff point would be to peruse the SPEC.md file in this change set. Obviously, feel free to dig into whatever you want though! Perhaps we can kick off a discussion more fomally on the topic next week.

Caught an issue tonight; we can't use BigInt yet unless we want to drop support for Safari. I recommend we hold off on including it in the serializable types for now

@klebba

BigInt was removed to support Safari
XElement.createStyleSheet was removed since it's not supported in all modern browsers
I swept all the tests so that they all pass in all modern browsers
I went through the tests and tried to add some commentary and clean things up in hopes that we'll be able to actually review them as a spec.
I added an example of creating interstitial property bags to the spec.md file (i'll update the link in the comment)
I found an esoteric bug in FF where somehow an element can be un-upgraded after being adopted into another document. I'm not going to bother to dig in right now and am conditionally skipping that test (required for 100% coverage) if the UA indicates that we're being run by Firefox.

@theengineear great, thanks! I just pulled down the latest and my integrations are now working in Safari & Firefox — nice!

Just noticed the type check in __typeIsWrong via __setPropertyValue and wondered if we should be concerned about the potential performance implications of checking types for all assignment operations. I came across this article which outlines our exact case: https://ponyfoo.com/articles/investigating-performance-object-prototype-to-string-es2015
Can you remind me why we do this type checking now?

Can you remind me why we do this type checking now?

We used to do type coercion (which included type checking) on set, so we already had precedence for doing non-trivial work on set related to "type".
I didn't have this at first, but the team convinced me that we should have it in a meeting on the topic.
It provides useful feedback to the integrator to improve development experience.
Without it, type would only be used as it relates to serialization and deserialization, so it falls back to being just an annotation of the property, not necessarily doing anything. Also, it would be confusing to introspect a property value and get back an object when the property declares itself as a string.

My view on this is to do the thing that's helpful to development and to not prematurely optimize. If I'm understanding that article correctly it states that:

This exact type checking is done in libraries as major as Angular and lodash
The was able to get 6.5x improvement by avoiding general lookups on the toStringTag symbol by making changes to V8

Also, I would be shocked if this was the thing that ultimately was the bottleneck in the update lifecycle of an x-element instance. I think maybe the actual ask here (if I can read between the lines) is that there is some fear, uncertainty, and doubt surrounding this change set that should be assuaged via perf testing before we can move forward.
It should be simple enough to do that. I can imagine that we would want to perf-test the following:

Element definition (i.e., what happens after we call customElements.define)
Element instantiation
a. With computed properties
b. With reflected properties
c. With observed properties
Element update
a. With computed properties
b. With reflected properties
c. With observed properties

I'll try to find some time to setup some sort of benchmarking. I don't have too much experience maintaining something like this though. For example, do you set a threshold or something and fail a test based on a delta from some baseline? I'm sure this is documented somewhere and I can look into it.

CAVEAT these tests are super nascent and we should not draw any final conclusions just yet!
A really quick, cursory study of performance yields the following:
[THIS BRANCH]
average definition time (count = 100000): 0.028538199957692995 ms
average instantiation time (count = 100000): 0.006306099989451468 ms
average assignment time (count = 100000): 0.000526649983949028 ms
average update time (count = 100000): 0.0028123500145738945 ms

[MASTER]
average definition time (count = 100000): 0.013228350005229005 ms
average instantiation time (count = 100000): 0.01043335000926163 ms
average assignment time (count = 100000): 0.0005833499878644943 ms
average update time (count = 100000): 0.0028958999877795578 ms

I decided not to share the code since this is just an initial glance — we'd need more nuanced tests to really dig in. However, here's a quick analysis of the findings:

As expected, definition time analysis takes longer now, ~2x slower to define an element. As a gut check, if we were to import and define one thousand elements, it would still be just a fraction of our overall application boot time.
Pertaining to the original thread — assignment and update remain nearly unchanged. I.e., there seems to be no bottleneck around type checking.
As hoped for, there seems to be a discernible improvement in instantiation time — ~1.5 faster to instantiate an element.

@klebba — re-type-checking. I updated the comment where we were talking about it to mention that it doesn't seem to make things faster. THAT SAID, we haven't actually scrutinized the type checking I'm doing. It's fairly hard to do perfect type checking in JS, so we should make sure that what I've implemented is even up to our standards before we talk about how performant it is.

Can you remind me: in a computed property pipeline, do computed scalars which have not changed in value still trigger downstream resolvers?

In a computed property pipeline, do computed scalars which have not changed in value still trigger downstream resolvers?

Nope. Due to how we memorize, that should not happen anymore. Are you seeing that behavior?

Oh great — I did not actually try to check this myself :)

Found some time last night to iterate on comments I got this week:

Return value of createRenderRoot is now validated and throws helpful errors.
Improvements to error messaging — instead of printing the value, we now print the type of the value, which is often more useful. At a minimum, it's much more consistent now.
Autocomplete behavior in Chrome devtools' console now works when introspecting the .internal proxy during debugging (same goes for properties, though you probably won't be debugging properties via the proxy since you would just use the host).

And — after killing some braincells, I realized that we've historically been checking for method existence using Function.name (e.g., object[function.name] === function). However, (1) Function.name is mutable, (2) the name of the function need not match the name from the object, and (3) I believe code minification tools may cause issues as well. The only reason I found this is that through some perf testing, I realized that Function.name is surprisingly slow! My solution is to walk the constructor tree or the prototype tree and loop over ownKeys. Amazingly, that seems to be just as performant as the slow name lookup and it's more correct </rant>.

Note to self — make sure that we throw hard if an initial property or attribute value exists for a resolved property. Right now, I think it's just ignored, but we actually throw an error in the case.

make sure that we throw hard if an initial property or attribute value exists for a resolved property

We sort of do this. If you set the initial value of a resolved property to the value undefined it will not throw. I'm going to change this since I think it's actually incorrect. Our rule should be "you cannot initialize a resolved property" NOT "you cannot initialize a resolved property to anything but undefined".
TL;DR — we were validating initialization, but there's a subtle edge case I'm also going to guard against.

@erahhal and @klebba — I think I've talked to both of you about this one. How do you feel about the name value representing the initial, default value of a property? Can we force this to be a function and call it initializer?
{
  myProp: {
    type: String,
    readOnly: true,
    initializer: () => 'foo',
    observer: () => {},
  },
}

Some rationale:

initializer conveys the usage much better than value.
Matches verbage / language we use elsewhere.
There'd be one-and-only-one way to initialize — a function.
Static validation of initializer is much simpler than static validation of value (in its current form).

If we were being pedantic we'd call it defaultInitializer. However, I think the ergonomics of that are bad enough to rule it out.

Re: functional interface — here's a radical idea. What if we removed all the magical binding completely by forcing you to write anonymous functions. Additionally (back to a DSL) via string introspection, we can switch on the underlying behavior in a more declarative fashion.
static get properties() {
  return {
    a: {
      type: Number,
      initializer: () => 5,
    },
    b: {
      type: Number,
      initializer: () => 10,
    },
    c: {
      type: Number,
      resolver: this.resolveC,
      observer: this.observeC,
    },
  };
}

static get listeners() {
  return {
    click: this.onStaticClick,
  };
}

static resolveC = (a, b) => a + b;
// static resolveC = (accumulator, a, b) => a + b;

static observeC = (host, current, previous) => { /* .. */ };
// static observeC = (current, previous) => { /* .. */ };
// static observeC = (current) => { /* .. */ };
// static observeC = current => { /* .. */ };

static onStaticClick = (host, evt) => { /* .. */ };
// static onStaticClick = (evt) => { /* .. */ };
// static onStaticClick = evt => { /* .. */ };

onInstanceClick = evt => { /* .. */ };

connectedCallback() {
  this.shadowRoot.addEventListener('click', this.onInstanceClick);
}

disconnectedCallback() {
  this.shadowRoot.removeEventListener('click', this.onInstanceClick);
}

Note how the idiomatic binding removes our need for the listen and unlisten helpers.
Also note that we remove dependencies because we can do strict pattern matching on the Function.toString() — I think it'd be cool to try and favor dependencies if they're explicitly declared and fallback to Function.toString() by default.
** FYI the instance declarations are forthcoming in future versions of JS. That said, you can wrap in an anonymous function or bind in the constructor for static and instance methods today.

☝ @klebba @erahhal @charricknflx @codeStryke — 🚨 some wild ideas above. Just wanted to float some musings I've had while working on this PR. I can't help but wonder whether anonymous functions declared as idiomatic fields via the stage 3 proposal could obviate the need for all the binding backflips we do in our code.
I opened up a specific ticket (https://github.com/tc39/proposal-class-fields/issues/312) related to this need on the proposal for class fields.
One cool thing about going this direction is that we have workarounds today for this behavior:

Wrap your static method in an anonymous function in the properties block — done.
Call .bind(this) on your instance method in the constructor block — done.

I think we could delete a lot of code if we required that users follow certain patterns.

Will review these comments, but wanted to leave a note before I forget that your mouse-ghost appears to no longer work :(

Ha, I deleted it. In retrospect I felt that it was a little lame 😅

The error message was confusing because I first thought it was referring to the URL type I had declared as the property type.

Yah the suffixing .value can be hard to miss. I'll be more informative in the error message. The nice thing is that error message updates are exceedingly simple to change now 👍

TODO:

test initial

ensure it be a constructor method

test default

ensure it be a constructor method
if initial is nullish, ensure we get back the default
test that computed values are type-checked.

I hit an issue with a compute function that stopped working. This element presents the problem: https://gist.github.com/klebba/cd795a01223beaa219c8560db1ec512c — the computeBinding function is never actually called. I tried renaming and adding other functions with different inputs, but none were called. Any ideas?

Is it possible to throw an error when a listen or unlisten callback is not found? Would be nice feedback

I hit an issue with a compute function...

Yep, we stopped forcing the compute callbacks inside render completely now. I don't understand why setting a dummy observe wouldn't work though 🤔
static get properties() {
  return {
    a: {},
    b: {},
    c: {
      input: ['a', 'b'],
      compute: (a, b) => a.sideEffect(b),
      observe: () => {}, // dummy observer to force a sideEffect in compute.
    },
  };
}

☝ I'd expect that to work. Note that observe is called after render — could that be the issue? You're getting the side effect, but it's happening only render has occurred? If that's the case, you could also pluck it from the properties proxy inside your render routine.
static get properties() {
  return {
    a: {},
    b: {},
    c: {
      input: ['a', 'b'],
      compute: (a, b) => a.sideEffect(b),
    },
  };
}

static template(html) {
  return properties => {
    properties.c; // forces a side effect inside compute
    const { a, b } = properties;
    return html`<div>${a}</div><div>${b}</div>`;
  }
}

Is it possible to throw an error when...

For sure, we do that for the static listeners block — seems consistent to do it when using listen / unlisten as well.

@klebba — listen and unlisten through insightful errors when passed something other than a Function now.

Based on our conversation I reworked my x-pages variant here: https://gist.github.com/klebba/cd795a01223beaa219c8560db1ec512c#file-x-pages-js-L41 — (note line 41) — this cut down quite a bit on lines of code and should actually "do about the same thing"

@klebba — the host is now passed as the second argument to the template callback again.

@codeStryke — as requested, I updated the documentation in the source code.

@theengineear can you remind me what all remains here? If my memory serves, we're really close! 🥇

We need to complete the refactor in our application to prove that we like
this change set. Then, we can merge / publish. There's no real reason to
merge this PR in before we've finished testing it on the ~500 components we
have IMO. At a minimum, I'd like to get 50% of these components refactored
before merging this in. We can always merge it and then wait to publish.
It's just that once we merge it in, we break our ability to introduce any
sort of hot-fix.
On Sat, Sep 26, 2020 at 4:42 PM Casey<EMAIL_ADDRESS>wrote:

@theengineear https://github.com/theengineear can you remind me what
all remains here? If my memory serves, we're really close! 🥇
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Netflix/x-element/pull/58#issuecomment-699561531, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/ABSOEWU6JNW2A7NIFM2QN33SHZ35DANCNFSM4NJ4XLWA
.

OK — new branch, new PR. I'm going to close down this exploratory PR in favor of a fresh start (just a copy of what's here).
Let's continue the discussion (if there's more to discuss) on #69.


output of test.py is different with and without --show argument

mmdetection/tools/test.py
config.py latest.pth --out out1.pkl --show
mmdetection/tools/test.py
config.py latest.pth --out out2.pkl
results in  out1.pkl and out2.pkl are different. If precisely they have different scale. out2.pkl is wrong but you can't visualize it, when you try to visualize you will get out1.pkl that's correct one,
If scale==1 issue doesn't affect results

Hi @korabelnikov ,
Please check the discussion in PR https://github.com/open-mmlab/mmdetection/pull/1645


Can I activate a Stream Deck key from within Java - Does this integration exist ?

I am writing a Java based Twitch Bot. I would like the Bot based on some viewer interaction - integrate with OBS and roll20...
I have a stream deck which seems like the perfect middleware for such interaction.
So my question that i cant seem to establish, is that from java code, can i have java actuate integration that causes a stream deck key depression?

Its a bit late, but if you haven't found it by yourself: You can use StreamDeckController.pushButton:
	/**
	 * Manually Pushing a button at the given id.
	 *
	 * @param no Number of the button to be pushed, 0 - 14, right top to left
	 *           bottom.
	 */
	controller.pushButton(0);
       // Or with StreamDeck its the same procedure:
	streamDeck.pushButton(0);


DATAGO-44969: README and swagger docs for scan and list scan

What is the purpose of this change?
Adding/updating documentation for scanning and listing scans.
This also lists the scan types and destinations options.

We need Andrea's review still but the content is on point so let's merge and address Andrea's comments after the fact.


KAFKA-15109 Don't skip leader epoch bump for older MetadataVersions

This patch fixes a bug introduced in the earlier KAFKA-15109 commit (#13890) where the leader epoch bump would be skipped for older MetadataVersion-s.

It's confusing to have a function named enableBumpLeaderEpochOnIsrShrink that sometimes doesn't actually enable (or disable) the thing, based on some other variables. If we're going to go this route, then I'd say just add back zkMigrationInProgress as a flag.
The other approach would be to have a function like forceBumpLeaderEpochOnIsrShrink() with no arguments that just does what it says. After all, bumping the epoch is always safe so we'd expect code like:
if (zkMigration) {
  builder.forceBumpLeaderEpochOnIsrShrink();
}

by NOT providing a function to disable leader epoch bumping, we can avoid the bug we encountered here.
I think either of these approaches could work. Let me know what you think.


build-and-test dependencies install issues

Trying to build the CDK from source today I encountered a couple of (small) issues:
(1) - In the source/infrastructure/README we seem to be inconsistent about what folder the commands are run from? first cding to source/infrastructure but then running pip install -r source/requirements-build-and-test.txt.
I found that in order for pip to resolve the editable dependencies like -e cdk_solution_helper_py/helpers_cdk, I had to be inside the source folder and run pip install -r requirements-build-and-test.txt.
(2) - For some reason I don't quite understand, pip errored out due to conflict between<EMAIL_ADDRESS>requiring click>=8.0.0... Even though in the requirements-build-and-test.txt, the version for black is left unspecified. Not sure what's going on here with the dependency resolution as I'd have expected it to just pick a version of black that satisfies the other constraints... But for now I worked around it by explicitly requesting black==21.12b0.

Hello @athewsey -
Thanks for your feedback. I've confirmed the issues and will ensure that these are fixed for the next maintenance release of the solution. For now, your workaround in (2) is appropriate, and you are correct about (1) - the documentation will be fixed.


Wave File Reader error handling, header reading

Pull Request Template
Description
-Update file reader to catch missing data, throw error in JPD generation process
-Update file reader to be more flexible with header data in first two rows
Fixes #1673
Type of change
Please delete options that are not relevant.

[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
[ ] This change modifies variables in existing compute modules. Please see Checking for PySAM Incompatible API Changes.

Checklist:
If you have added a new compute module in a SSC pull request related to this one, be sure to check the Process Requirements.

[ ] My code follows the style guidelines of this project
[ ] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
[ ] I have checked my code and corrected any misspellings

@mjprilliman Is there supposed to be an option to choose time series or JPD for the ME Wave model? Help describes the option, but I don't see it on the Wave Resource page:

Also, when I click Create JPD from time series weather file(s) for a folder with 1979-2010 time series data that I just downloaded, I get a UI callback error:
Could not evaluate callback function:jpd_multiyear->on_change
[60]: error in call to 'value()': variable 'wave_resource_filename' does not exist in this context[51]: eval error in statement list
[49]: eval error in statement list
[46]: eval error in statement list
[46]: error inside function call

@mjprilliman Is there supposed to be an option to choose time series or JPD for the ME Wave model? Help describes the option, but I don't see it on the Wave Resource page:

Also, when I click Create JPD from time series weather file(s) for a folder with 1979-2010 time series data that I just downloaded, I get a UI callback error:
Could not evaluate callback function:jpd_multiyear->on_change
[60]: error in call to 'value()': variable 'wave_resource_filename' does not exist in this context[51]: eval error in statement list
[49]: eval error in statement list
[46]: eval error in statement list
[46]: error inside function call

Paul, no for the Single Owner model there is only the time series option due to the requirement for a time series in the cash flow. This PR is to fix some issues with JPD file generation and to make the header data for wave and tidal resource data more dynamic. I will look into the bug you've posted and schedule a meeting to discuss the weather file handling.

@mjprilliman I'm testing this with the hourly file you fixed from this discussion on the SAM Forum. I put the file in my SAM Downloaded Weather files folder, but am not seeing it in the library, even after clicking Refresh library and reloading the input page . The file does appear in the library in SAM 2023.12.17, but not in my build from this me-wave-file-reader branch.

@mjprilliman I'm testing this with the hourly file you fixed from this discussion on the SAM Forum. I put the file in my SAM Downloaded Weather files folder, but am not seeing it in the library, even after clicking Refresh library and reloading the input page. The file does appear in the library in SAM 2023.12.17, but not in my build from this me-wave-file-reader branch.

Did you have the ssc branch checked out as well?

Did you have the ssc branch checked out as well?

Yes, this is for a clean build from SAM/me-wave-file-reader and ssc/me-wave-file-reader.

Did you have the ssc branch checked out as well?

Yes, this is for a clean build from SAM/me-wave-file-reader and ssc/me-wave-file-reader.

Can you pull ssc for the most recent commit and try again? I downloaded the file directly from email and was able to get it into the library locally just now.

In the UI callback for the Marine Wave Resource Time Series form, I'm seeing rescanlibrary('wave_ts') and rescanlibrary( 'wave' ). I think the name of the wave library is location_ts, not wave_ts or wave. I tried changing those, but that didn't fix it, so I'm not sure what the problem is.
Also, in this snippet for the Refresh library button there is refresh('wave_resource_matrix'), but wave_resource_matrix is not an input on that form:

@mjprilliman Here's some additional information: I have several valid wave resource files in my <user>/SAM Downloaded Weather Files folder. If my list of wave data folders is empty, then the files do not appear in the library:

However, if I add <user>/SAM Downloaded Weather Files to my list of wave data folders, then the files appear in the library:


[Bug] EMI fails to load if Destroy is present

Reported to Destroy here. If that mod is loaded, EMI will experience a critical error. Here is my logfile where this happened: log.txt

Destroy and EMI now load together.


Configure caches to limit tiles by zoom level or image type

At the moment, only layers can be configured to be limited to a certain zoomlevel range - i.e. via "bounds": { "low": 0, "high": 20 }
The same goes for the image type, which we can - at least - configure by redirection via "redirects": { "jpg": "png" }
But IMHO it should be possible to configure this for the cache, or specific caches in a multi cache setup: This would ensure that a tile of e.g. zoom level 100 will never be cached, but could still be rendered on-the-fly.

+1


Merge PackageServerClient into OpCapClient

fixes #83

replaced versioned client set by adding the package server client scheme to opcap client
added GetSubscriptionData and ListPackageManifests to opcap client
removed GetSubscription since it was not used

/lgtm


Add start attribute to ordered list items, on the first one

I ran into an issue today where I was trying to apply custom styling to an ordered list that was split over multiple separately rendered markdown nodes. I decided to use a pseudo element with content: attr(start), but this attribute didn't exist on ols where the value would be 1 (because it's the default).
If we remove the guard against adding start=1, we make it easier to implement custom list styles and there should be no functional change (so far as I am aware). Any reason why we should not explicitly set the start to 1?

Any reason why we should not explicitly set the start to 1?

Compatibility with commonmark reference renderer output ?

You could add "plugin" to scan all ordered_list_open tokens, and add start to next if not exists. I'd like to avoid data modification for specific user requests, if possible.

Yeah that's totally reasonable, thanks!


X.CheckDocumentExists improvment

Is your feature request related to a problem? Please describe.
When checking if a document exists, it often happens that we need it in the service, leading to a second findOne query on it, resulting in useless network and CPU usage.
Describe the solution you'd like
X.CheckDocumentExists(Collection, (args) => args._id || null, { storeResult: { key: "myDocument", body: { ... } } }  )
storeResult is an object or a boolean, defaulting to false.
When storeResult === true, key = "chekedDocument" and body = { $all: true }
When storeResult is an object, then both key and body are read or defaulted to the values as above.
Describe alternatives you've considered
Refecthing the document in my service

I understand your concept, theoretically we can create a findOrThrow() kind of solution at collection level, this api feels a bit heavy

I think this is custom behavior that will not be part of CheckDocumentExists, I think the solution is to create yourself a findOrThrow() at collection level.


[WIP] add ability to embed social

depends on https://github.com/rajatjindal/handlebars-sprig/pull/2
preview example

build is failing as its referring to local path for handlebars_sprig (new version publishing is pending review)

this is ready for  review. it adds embedding for tweet and gist. working on adding others.


Gap in between home button and first server

Has been a problem for over 2 weeks, is still around. Am not able to move a server there as it is just a blank space.

Are you using BetterDiscord?

I'm using BandagedBetterDiscord, and can confirm I've had the same issue for some weeks.

This is caused by the hidden "Public Server".
Tempfix for it:
.listItem-2P_4kh:nth-child(3) {
    display: none;
}

That fix is broken, fixed it by replacing the 3 with a 2
.listItem-2P_4kh:nth-child(3) {     display: none; }

This should now be fixed.


chore(tests): fix unneeded async

Removes an unneeded check eventually inside a helper proc, removing the need for the proc to be async.

I can run it 1000x, sure. But the main idea is that there is already a check eventually at the callsite so when there are not enough agents, isInState simply returns false.

@benbierens, I have successfully run this 1000x locally, recompiling every 100x.

Thanks for checking :D

Thanks for asking 😄


Sharing videos with a start timestamp

Similar to youtube, we should be able to share a URL to a video at a certain timestamp within the video.

We've got the reading of the ?t= tag, now just need it added to the share modal!

I'm going to work on this now

For the UI, how about something like this:

Also, should both the "LBRY Link" and "Embedded" tag have the t parameter, but not the "LBRY URL" or "Download Link"?

@jeffslofish , that's looking great so far, thank you! Alignment could use some work, but I'll let @seanyesmunt comment further.
And yes, this would only make sense in the LBRY link. We could make them work in the LBRY URL, but that requires: https://github.com/lbryio/lbry-desktop/issues/3972

Nice! I’m not sure exactly how it should look but that is a good start. That can work for now if the inputs are vertically aligned with each other.

I'm here with the bikeshed of also shrink the input width if it's limited to a time value


On add event fire two times

Good morning,
I would like to know if there is a way to fire eventi ony one times, I have a script that import file into a directory, I watch that directory when a file is added, if so I call a script.
Sometimes seems that when is added a file the event add fire two times, I would like that on add file the script is called only one time. It's a bug or not? Is there a way to fix it?
My script:
var chokidar = require('chokidar');
var sys = require('sys')
var exec = require('child_process').exec;

var folder = process.argv[2];
var watcher = chokidar.watch('tmp/xml/' + folder + '/', {ignored: /^\./, persistent: true});
watcher
  .on('add', function(path) {
    var filenameArr = path.split('/');
    filename = folder + '/' + filenameArr[filenameArr.length - 1];

    function puts(error, stdout, stderr) { sys.puts(stdout) }
    exec('bin/cake manager readXmlAndSave ' + filename, puts);
})

It happens sometimes for various reasons including editors using atomic save methods and other stuff happening at the lower-level file watching methods. Chokidar tries to suppress duplicate events, but there are some circumstances where it can't, and some where the two events you're observing are legit.
If you suspect chokidar is doing something wrong, please add a listener to the raw event to log what gets sent there at the time you observe the issue and report back your findings along with details like chokidar version, node version, and OS.
In the meantime, you could implement some form of debounce or throttling to prevent your exec from firing off too often.
Closing this issue for now, but will reopen if you provide more evidence that merits further investigation.


tokenizers/sentences/naive failing

I'm so mad right now. I thought the error was from me.
I checked the changelog and I don't see how the 0.19.1 version  Improved tokenizers/sentences/naive.
The module just returns an array of lowercased words, no more changes, just 1 array of same inputed sentence.
I seriously don't see how the module should be working on-site. I read the documentation, and the

tokenizers/sentences/naive works on-site in the documentation, but fails after install.

@victoryosiobe you realize that your issue does not really describe any way to reproduce nor understand the problem? What's more 0.19.1 is far from being the latest version of the library (being 1.1.4). So let's say 0.19.0 was working for you you can also pin the dependency for instance.


Jc/updatesfeb21 1

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.0 out of 2 committers have signed the CLA.:x: macgngsta:x: wholienYou have signed the CLA already but the status is still pending? Let us recheck it.


PostgreSQLTSVectorType persisted not as expected

According to postgres documentation
select to_tsvector('english', 'a fat  cat sat on a mat - it ate a fat rats');
should return
 'ate':9 'cat':3 'fat':2,11 'mat':7 'rat':12 'sat':4
As far as I understand during persist data with type PostgreSQLTSVectorType have to be equal to the result of to_tsvector() call.
But in my case string "test string for db" saved to DB as the "'test' 'string' 'for' 'db'" not like "'test':1 'string':2 'for':3 'db':4"
And that causes that next sql query doesn't return any result
select * from table where tsvector @@ to_tsquery('for')
only this query works for mentioned tsvector
select * from table where tsvector @@ to_tsquery('test')
But all search queries are work with the next value of tsvector column: "'test':1 'string':2 'for':3 'db':4"

The PostgreSQLTSVectorType saves the associated String to the tsvector column as-is. The Hibernate Type just binds the associated entity attributes to the underlying column value via the PreparedStatement.
Luckily, the project is open-source, so you can try to see how you can accommodate the to_tsvector function call. Looking forward to reviewing your Pull Request with the fix proposal.

I see, thank you very much for explanation. Looks like this can be done by dialect extension or by function implementation on application level. Let's see how I can do this

First, you could provide a test case in this repository where you demonstrate how it should work in JDBC. Afterward, I'll take a look at it and see what Hibernate feature could be used to integrate it.

I'm not sure whether you will achieve the desired result by using to_tsquery.
For Hibernate types, I think you want that converting the column value back and forth the Java type yields the same result. Otherwise you'll overwrite the tsvector with a corrupted state with each flush, as it will try call to_tsvector on its own output. Thus you'll endup with the result of to_tsvector(to_tsvector("the string")::varchar).  For any type it should be so that column value -> java value -> column value.
The TsvectorType is not intended for conversion of strings to tsvectors, its a type to map tsvectors as-is.
If you want to call to_tsvector on your input string, its probably better to use a @ColumnTransformer for that purpose.

Thanks, @jwgmeligmeyling for providing more context. I'm going to close this issue as there's nothing to change at the moment.


Tutorial

Hi @jni
I recently used affinder to register some MALDI datasets.
I think napari will be a useful manual fallback for other users in our lab in the rare cases where automated registration fails.
I was planning to write up a short tutorial for our lab members over the coming week  but realise this could actually serve as a general tutorial for the project.
Just flagging this early with this WIP PR to make sure we don't duplicate efforts. (currently this is only a placeholder)

Codecov Report

Merging #26 (80fc273) into master (b538689) will decrease coverage by 1.84%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master     #26      +/-   ##
=========================================
- Coverage    3.84%   2.00%   -1.85%
=========================================
  Files           5       4       -1
  Lines         104     100       -4
=========================================
- Hits            4       2       -2
+ Misses        100      98       -2

Impacted Files
Coverage Δ

affinder/__init__.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b538689...80fc273. Read the comment docs.

Hi @jni. While I haven't proof-read and checked for typos I think this is ready for review. Feel free to push to my branch.

Hi @VolkerH! This is great! I'd like to avoid including screenshots and gifs in the repo, as they can bloat the repo size very quickly and are fast to get out of date. Ideally, we would use the napari nbscreenshot functionality, and scikit-image for sample data. As a first step I'd be ok with just including the text and no screenshots.

Ok, I will keep this version then for use in our group but for affinder in general remove images and sample data from this PR.
Will have to re-read/re-write the text to make sure it can stand on its own. Will be few days though.

@VolkerH some interesting ideas for adding screenshots to tutorials in this or other repos:
https://twitter.com/billba/status/1470166672283615232
ie, add the pngs/gifs/mp4s here as comments, then link to them. Apparently this is pretty common practice! 😂 The twitter threads suggest people have a dedicated issue for the things, but I think it's quite natural for the images to go on the PR in which they are added.

Maybe there is a Fuse FS driver that will open issues, encode files as images and add them issues transparently :-)
Free cloud storage.


Run more tests

Bring back tests I un-commented a while back.
Temporarily do not run first_stage() by default, as it seems to break with "C()" syntax. Need to move to using FixestFormula class. -> needs to change
Temporarily uncommend models with logs() for IV estimation. -> needs to change

Ah, I didn't notice that the IV part in test_vs_fixest.py was commented. I have worked on the seperate testing script(test_iv.py), so the diagnostic part of IV should work fine. If this indeed affects the parts I had worked on, please let me know!

Ah, I didn't notice that the IV part in test_vs_fixest.py was commented.

Yeah, me neither; a seemingly innocuuous "skip" statement and I asked pytest to skip all IV tests 🤦♂Yeah, generally I agree that all is fine - coefs, SEs etc are all correct. I think something broke with C() operators - maybe best to change this in a separate PR from this one here and the testing PR? I might ask you to review it at some point this week if that's ok =)

Hi @Jayhyung , I pushed the changes to the IV module in d7a792c, could you take a look in case you find some time (only at the specific commit)?

Hi @s3alfisc ! I will check on this issue as soon as possible, possibly this weekend.

Very cool! I think reviewing the IV parts should not take you more than 15 minutes =)

Hi @Jayhyung, I will likely merge this in a few hours as I need this in another PR. If you find the time, would nevertheless be great if you'd review the IV part (we can always revert / update in case something is off / you think smth should be improved).

Thanks for the reminder, @s3alfisc ! Please, proceed out my review at this moment. Sorry, I will take a look at some point today at evening, as I was swamped by my stuffs ;). If i find something weird or does not not work, I will make a new issue or PR.

Sounds good and no worries at all!


Absolute paths don't work.

I have tried adding support to absolute paths by changing the configuration in the webpack.config.ts:
I made the following changes in webpack.config.ts:
config.resolve = {
    extensions: ['.ts', '.js', '.json'],
    modules: [path.resolve('./src'), 'node_modules']
  };

And in
webpack.d.ts:
resolve?: {
    extensions?: Array<string>;
    modules?: Array<string>;
  };

I still get Cannot find module error when I try the import statment like this:
import {AppComponent} from 'app/app.component':
I also tried using path.resolve(__dir, 'src') with no luck.
Can someone please help?
@qdouble  Is this a known issue? I couldn't find any similar issue reported here.

I've had this problem too.
Adding
"baseUrl": "./src",
In tsconfig.json & tsconfig.webpack.json and restarting webpack solved it

@Zwimber I tried your solution and it didn't work, still getting the same error.

Changed it to baseurl "src". You can remove the config.resolve.modules.

 Cannot find module 'app/app.component'.
Still the same error, no use. Do you have a working example of this, with the same setup?
I can't figure out why it would work for you and not for me.

@qdouble @Zwimber  Any luck on this? Can't really figure out what is wrong, here.

@dsasidhar  could you post the whole base code after you made change in a repo and paste the link here ? it would be easier to debug

and using __dirname not __dir seems to also work. but the whole code will help to debug if any other problem if any

@Rafi993 @Zwimber  Please find https://github.com/dsasidhar/angular-webpack2-starter I tried your suggestions and couldn't get it to work.

This is solved by this SO question: https://stackoverflow.com/questions/46467827/absolute-path-doesnt-work-in-webpack-2
The baseUrl had to be used in compilerOptions that was the mistake all along.


Steam user saying mod isn't pulling settings from old version

From our TMPE workshop page:

Hindi 1 hour ago
i activated this one and deactivated the old TMPE in the content manager, but in my save, nothing has been carried over
Was that the way to go, or do i have to unsubscribe before subscribing?

I can't answer now but he has to unsubscribe from old TMPE before enabling this mod.
BTW I've added notification for it if user did not unsubscribed (it's checking user content manager for mod by steamId) maybe there is a bug...

Thanks :)
I've relayed that to the user and asked him to check a few things, I'll report back here if there's any progress or further action needed.

I didnt unsubscribe, just deactivated in content manager. Is that the problem?
Everything wasnt cariied over, no settings, and no lane connections, speed limit, junction settings etc
I loaded a savegame

I've asked them to unsub the old mod, and also to share the savegame.
Will report back with updates.

Apparently he had to quit Cities.exe and reload before it started working.
I'm guessing this has something to do with the mod not handling second load (eg. load from pause menu, or return to main menu then load) without app quit?

Added troubleshooting guide in case other people have same problem: https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/wiki/Settings-not-copied-from-old-TMPE

Heyho, here I am
I quitted back to desktop (no loading from pause menu as of the known issues it can cause)

@DaHindi is the settings bug solved now? If so, please close issue.

@aubergine10 I am confuzzled, how does he close the issue if you made it?

Ah, good point! I'll close the issue then. If you have any more problems with settings let us know :)

Yes, i could load the settings


enable unistd::{sync, syncfs} on Android

What does this PR do
unistd::{sync, syncfs} were not implemented on Android, even though they are available in libc:

https://docs.rs/libc/latest/aarch64-linux-android/libc/fn.sync.html
https://docs.rs/libc/latest/aarch64-linux-android/libc/fn.syncfs.html

I'm not sure if it makes a difference, but especially sync was added fairly recently (9 months ago in https://github.com/rust-lang/libc/commit/0ba1fc4d6658317ca1ad79e5b62677ba4c772f0c).
Checklist:

[x] I have read CONTRIBUTING.md
[x] I have written necessary tests and rustdoc comments
[x] A change log has been added if this PR modifies nix's API

Hi, thanks for the contribution, changes look good, though a changelog is needed:
// changelog/2296.added.md
Enable unistd::{sync, syncfs} for Android

Ahhh that's how that works. Thanks!


Missing include (for std::nullptr_t)

Thanks. May I ask which compiler complained about that?

May I ask which compiler complained about that?

oh, recent LLVM trunk Clang/libc++ (on macOS)


Cannot install on mac ventura

This is the message i get in terminal.
Last login: Mon Feb  5 11:23:41 on ttys000
/Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool ; exit;
timothy@iMac-van-Timothy ~ % /Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool ; exit;
dyld[5968]: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
Referenced from:  /Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool
Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file), '/usr/lib/libusb-1.0.0.dylib' (no such file, not in dyld cache)
zsh: abort
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Proces voltooid]

Hello.
Try brew install libusb.
On Mon, Feb 5, 2024 at 5:25 PM Timothy977 @.***> wrote:

This is the message i get in terminal.
Last login: Mon Feb 5 11:23:41 on ttys000
/Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool
; exit;
@.*** ~ %
/Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool
; exit;
dyld[5968]: Library not loaded:
/usr/local/opt/libusb/lib/libusb-1.0.0.dylib
Referenced from:
/Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool
Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such
file),
'/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libusb/lib/libusb-1.0.0.dylib'
(no such file), '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such
file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file),
'/usr/lib/libusb-1.0.0.dylib' (no such file, not in dyld cache)
zsh: abort
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Proces voltooid]
—
Reply to this email directly, view it on GitHub
https://github.com/kriomant/ch57x-keyboard-tool/issues/54, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AADYWRWXFXDTJTZ74ZSUSPLYSCXRJAVCNFSM6AAAAABCZ32DJCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYTQMJXG4ZDINY
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

Hello,
Thanks so much for the reply!!
In terminal it says, zsh: command not found : brew
Kind regards
Op ma 5 feb. 2024 18:22 schreef Mikhail Trishchenkov <
@.***>:

Hello.
Try brew install libusb.
On Mon, Feb 5, 2024 at 5:25 PM Timothy977 @.***> wrote:

This is the message i get in terminal.
Last login: Mon Feb 5 11:23:41 on ttys000

/Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool

; exit;
@.*** ~ %

/Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool

; exit;
dyld[5968]: Library not loaded:
/usr/local/opt/libusb/lib/libusb-1.0.0.dylib
Referenced from:

/Users/timothy/Desktop/ch57x-keyboard-tool-universal-apple-darwin/ch57x-keyboard-tool

Reason: tried: '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such
file),

'/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/libusb/lib/libusb-1.0.0.dylib'

(no such file), '/usr/local/opt/libusb/lib/libusb-1.0.0.dylib' (no such
file), '/usr/local/lib/libusb-1.0.0.dylib' (no such file),
'/usr/lib/libusb-1.0.0.dylib' (no such file, not in dyld cache)
zsh: abort
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Proces voltooid]
—
Reply to this email directly, view it on GitHub
https://github.com/kriomant/ch57x-keyboard-tool/issues/54, or
unsubscribe
<
https://github.com/notifications/unsubscribe-auth/AADYWRWXFXDTJTZ74ZSUSPLYSCXRJAVCNFSM6AAAAABCZ32DJCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYTQMJXG4ZDINY>

.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

—
Reply to this email directly, view it on GitHub
https://github.com/kriomant/ch57x-keyboard-tool/issues/54#issuecomment-1927520542,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BFQQLFQAYU6EIGRRW5VUTLLYSEIM5AVCNFSM6AAAAABCZ32DJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRXGUZDANJUGI
.
You are receiving this because you authored the thread.Message ID:
@.***>

https://brew.sh/

Hey,
The brew install went well.
This is what i get now.
Again thank you so much for making time & helping out i couldn't do it
without your help
Op do 8 feb 2024 om 05:11 schreef Mikhail Trishchenkov <
@.***>:

https://brew.sh/
—
Reply to this email directly, view it on GitHub
https://github.com/kriomant/ch57x-keyboard-tool/issues/54#issuecomment-1933334329,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BFQQLFUFWKARMBDJJCE3CHTYSRF6PAVCNFSM6AAAAABCZ32DJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZTGMZTIMZSHE
.
You are receiving this because you authored the thread.Message ID:
@.***>

I didn't get, is your problem solved?

No, i sent you a seperate email with the error im getting after installing
brew.

—
Reply to this email directly, view it on GitHub
https://github.com/kriomant/ch57x-keyboard-tool/issues/54#issuecomment-1936295895,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BFQQLFTTGJQFYLDLP33KRR3YSZKS3AVCNFSM6AAAAABCZ32DJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWGI4TKOBZGU
.
You are receiving this because you authored the thread.Message ID:
@.***>


Datapicker lost focus inside bootstrap modal and Datepicker double open

Hi, I re-open both issue because I tested but it not works. I upload a simple test case (just extract it and click on index.html):
https://file.io/G0ukUhR8Cpoo

double open:
just quickly open one picker and then open the other one. It will appear two datepicker instead of only one. This is a wrong behaviour because if you open just one datapicker and you wait for the animation complete than you can open the second one and you will see that the first one will disappear. image with the issue: https://ibb.co/G99V7h8

lost focus inside bootstrap modal:
you suggest to use afterRemove: function (dc) { // Move focus somewhere specific...  },
this can be work if you are using the keyboard. You open the picker with ENTER on the button than you click ESC and the focus will move again on the button thanks to the afterRemove event.
What if you do it with the mouse click? You click on the button and the picker is open than you click for example on the second date picker input field... the focus will move first in the second input field and than to the first datapicker button since there is the afterRemove event and this is wrong. In the afterRemove event is it possibile know if the event was called from the ESC input keybord rather then the mouse click?

Hi,
Regarding issue 1 (quickly opening 2 datepicker calendars at the same time), I am not able to reproduce this. Can you test this on the following page?
https://whatsock.com/Templates/Datepickers/Basic/test.htm
If you are not seeing this behavior on this test page, but you are on your own test page, then your implementation is not likely running the latest 4X.js and Datepicker.js file versions.
Regarding issue 2 (focusing to another element when the mouse is used), no, there is no way to specify that when the mouse is used to click another input that second input will receive focus when the original calendar is closed. Besides the technical challenges of determining the difference between a datepicker edit field and another random element type on the page, doing this would impair keyboard accessibility for the widget since it would violate intuitive keyboard navigation for dynamic widgets which should always set focus back to the logical triggering element when closed. A sighted mouse user can simply click the second input, see that focus is set back to the original location and then click the second field again to set focus to it.

Hi, Regarding issue 1 (quickly opening 2 datepicker calendars at the same time), I am not able to reproduce this. Can you test this on the following page? https://whatsock.com/Templates/Datepickers/Basic/test.htm If you are not seeing this behavior on this test page, but you are on your own test page, then your implementation is not likely running the latest 4X.js and Datepicker.js file versions.
Regarding issue 2 (focusing to another element when the mouse is used), no, there is no way to specify that when the mouse is used to click another input that second input will receive focus when the original calendar is closed. Besides the technical challenges of determining the difference between a datepicker edit field and another random element type on the page, doing this would impair keyboard accessibility for the widget since it would violate intuitive keyboard navigation for dynamic widgets which should always set focus back to the logical triggering element when closed. A sighted mouse user can simply click the second input, see that focus is set back to the original location and then click the second field again to set focus to it.

I used your test page, I upload a video to show you the wrong behaviour (desktop chrome, leatest version):
https://easyupload.io/jizo46

I think it was a misunderstanding. If I'm inside a bootstrap modal and I move the focus with the TAB key at some point the focus will move on the the datepicker button. Now I press the ENTER key and the datepicker will open and the focus will move inside the calendar. Now If I click ESC key the datepicker will close and the focus will lost, it will not return on the button and this is a wrong accessibility behaviour. So in the other issue that you close, you suggest me to use the afterRemove event to solve this problem. So for example you can write to solve the issue inside the bootstrap modal:
afterRemove: function (dc) {  $("#my_button_picker").focus();  },

In this way when you close the picker with the ESC key the focus will return on the button picker element. The problem of the above code is that when you are using the mouse click you have a wrong behaviour. You click with the mouse in any other element inside the modal, the focus will move on this another element but few moment later the focus will move "#my_button_picker" since is trigger the afterRemove event.

Hi, I've corrected both issues in the latest update to 4X version 2023.7.14 + Datepicker.js version 4.6.
Using the latest code, the double opening issue has been confirmed to work correctly using Chrome, Firefox, and Edge on the test page at:
https://whatsock.com/Templates/Datepickers/Basic/test.htm
Regarding setting focus back to the button after the calendar is closed, I understand what you wish to do, however setting focus to the associated input field is not actually an accessibility issue because it allows non-sighted screen reader users the opportunity to verify the correct date has been entered into the field before moving on within the form. This functionality is preferable to most visually impaired users. As a totally blind screen reader user myself, I find this is very helpful when entering dates into important fields such as travel and banking websites for example.
If there is a pressing need to change this behavior though, you can do so now using the returnFocusTo property by declaring this within the Datepicker setup config.
E.G.
// Optionally specify a DOM node to return focus to after the datepicker calendar is removed.
// By default, this will set focus back to the associated input field where the date is saved, but it can be overridden if needed using the following property.
returnFocusTo: $A.get('elementId'),

Please make sure you update the 4X.js and Datepicker.js files within your own code to verify the fixes within your own environment.
Since there is nothing else I can do for this issue, please open a new one if this or a different issue occurs.

I tested on my code after update 4x.js and Datapicker.js and I also tested again at your page:
https://whatsock.com/Templates/Datepickers/Basic/test.htm
Unfortunally the double opening issue is not fixed. I'm still able to open two datepicker by clicking quickly each button piker :(

@impetoyt I am struggling to understand what the problem is.
The primary purpose of the date picker is to allow users to select dates from a calendar representation—not to click the date picker buttons consecutively without interacting with the calendar to set a date. I had to try several times to make both stay open on Windows. On iOS I could open both at the same time easily, if I tapped one button and then the next.
I could not open both at the same time on any device or OS when using the date pickers to select a date.
However, to prevent this from happening you could try implementing something similar to the code example below. @accdc will know the exact APEX 4X code to use, but the JavaScript below should explain the ask.
// datepicker instances
const datePicker1 = UniqueCalendarId1; // Replace with the actual datepicker instance DC = $A("UniqueCalendarId");
const datePicker2 = UniqueCalendarId2; // Replace with the actual datepicker instance DC = $A("UniqueCalendarId");

let lastOpenDatePicker; // Holds reference to the last opened datepicker

// Replace click event handlers using the Apex 4X method
document.querySelector('#dateIcon1').addEventListener('click', () => {
    if (lastOpenDatePicker && lastOpenDatePicker !== datePicker1) {
        lastOpenDatePicker.remove();
    }
    datePicker1.render();
    lastOpenDatePicker = datePicker1;
});

document.querySelector('#dateIcon2').addEventListener('click', () => {
    if (lastOpenDatePicker && lastOpenDatePicker !== datePicker2) {
        lastOpenDatePicker.remove();
    }
    datePicker2.render();
    lastOpenDatePicker = datePicker2;
});

All the best
Laurence Lewis
Accessibility Senior Technical Specialist - Telstra

Hi, in the latest update just pushed I attempted once again to prevent this issue from occurring. Hopefully it will do the trick, but if not, Laurence is right in that the vast majority of users who interact with these controls will simply wish to select a date and will likely never encounter this behavior.

@LaurenceRLewis it's to improve the UX. You can also decide to increase the duration of the picker animation and in this way it will be more easy have this issue. To give you a exemple and think about the link of this test page:
https://whatsock.com/Templates/Datepickers/Basic/test.htm
In this test page you will not have this issue if the user are not click very fast. But image that the two buttons with the related input field are in two different rows (like in a table). The user click the button in the second row and the picker will open with a X seconds animation but if the user was in truth thinking to click the first button in the first row than he can do it very quickly click and the result is to have two datepicker openend and the second picker overlap the first one! This is really a bad thing for the UX.
The user can also act in this way:
He already choose a date in the second row or for any reason the date is already filled, he click again to the second picker for any reason but since he don't wnat to choose another date he will just click on the button in the first row to choose the other date and so again the second picker will overlap the first one.
So it's not a problem in which the user want to click quickly one button picker and than the other one just to get pleasure in doing it. The issue can really happen when you have two buttons picker displayed in two differents row but they are one above the other.

Thank you for explaining, I get that and agree it would be good to have fixed.
The latest code has a property within 4X.js ($A.isAnimating) that is set to true every time one of the rendering animations is running, then toggles to false when the animation is done.
This is checked against within the latest code within Datepicker.js so that the triggering event ("opendatepicker") will only activate if this property is false and never when it is true.
Please check the latest code against your implementation and let me know if this is now fixed.

Hi, I was able to reproduce the issue using your example code, so I now at least have a starting point to figure out what the underlying problem is. It's a strange one, so I'll need to work on this later in the week. I'll get back to you when I learn more. I appreciate your patience.

Thanks to you for the patience, I really appreciate it. If there is something that I can do to help you let me know.

Hi, it took me a while to track it down but the fix was surprisingly simple. I uncommented out autoCloseSameWidget within Datepicker.js and removed the line "dc.cancel = $A.isAnimating". which was conflicting  with the autoCloseSameWidget functionality.
I just pushed the code live and all you should have to do is update Datepicker.js to version 4.10.
Please let me know if that fixes your issue.

Hi, I update Datepicker.js to version 4.10 and I confirm that now the issue is solved but unfortunately with this update it was introduced another issue.
If the duration is about 1 second or more, the user could click the second button picker during the animation of the first picker. Since the animation of the first picker is still in progress, nothing will happen and the second picker will not display, The user need to wait 1 second or more until click the second button picker to open the second picker (also in this case the UX is really bad).
In case you are using an animation with a duration of about 250ms the user will not really notice that because the animation is so fast that when he click the second button picker the animation of the first picker probabily is aleady completed.

Hi, to confirm, are you saying that the second calendar should cancel the animation of the first calendar if the user clicks on the second datepicker while the first datepicker is currently running an animation?

No, if you click on the second button, the second picker will not appear because the first animation picker is still running.

I understand. Unfortunately this is not something I can fix, though there are techniques you can use to reduce any user impact.
This cannot be fixed due to the lifecycle processes that are automatically handled within every DC object. You can read more about these by viewing the help documentation within the repo folder at:
Help/DC API/DC Object Configuration/Lifecycle Methods and Scripting
Since each datepicker instance is an instantiated DC object, it will run all of these processes every time you render a calendar. The only times you can cancel the process from rendering after you activate render(), is by setting dc.cancel to true within either the beforeRender or duringRender method calls.
By the time the animation is visible on the screen, it is too late to cancel part way through because it has already passed beyond the duringRender lyfecycle method and is performing the final processes for animation and DOM manipulation.
It is also impossible for the second calendar DC object to cancel the opening of the first calendar DC object part way through since both instances are autonomous processes.
The only options in this case are to either disable animation, or shorten the animation effect duration so that it will not run for very long.
For example, if you set the duration of the animation for 500 or 750 millisecond's, it is a reasonable timeframe for a user to realize if they have opened the wrong calendar and then open a different one instead.

I understand your point and I'm agree with you.
My last concern it's about if I was able to explain the issue:
Actually, with this update, if there is a picker open running animation then the user is not able to open the second picker by clicking the second button.

I've been looking into this, and though it is impossible for me to halt the rendering process that is mostly complete, I can program all previous calendars to close after they finish animation.
This is the only way I can do it where the currently clicked datepicker will always open imediatly.
This means though, the prior calendar will have to complete rendering while the latest calendar is opening, after which the prior calendar will automatically close. This is the only way this can be done. There will be some overlap until the prior calendar finishes closing however.
If you think this is better than waiting a second or 2 for one calendar to finish opening before opening another, I can give this a try.
To be honest though, I don't see this as a high priority issue since anyone using the calendar will see it opening and know they can close it after it finishes.

This means though, the prior calendar will have to complete rendering while the latest calendar is opening, after which the prior calendar will automatically close. This is the only way this can be done. There will be some overlap until the prior calendar finishes closing however.

In my opinion what you said should be the right UX behavior.
Actually it doesn't happen because the latest calendar doesn't appear when the user clicks on the related button calendar during the prior calendar fade-in animation. From the pluser point of view it's like click the calendar button and nothing happen, so he will think:"Why the calendar isn't opening?"

4x_datepicker_test2.zip
Please test the attached files and let me know if this is what you are requesting.

I tested your code and in this case the issue that I described above is gone. Thank you for the time and patience


[WalletConnect Safe app] Allow multiple connections in parallel

What is this feature about? (1 sentence)
This will allow to have multiple connections in the WalletConnect Safe app open at the same time.
Why is it needed? What is the value? For whom do we build it?

When interacting with multiple dapps via WalletConnect at the same time, users would have to close the connection and reconnect every time, when switching between dapps.

High-level overview of the feature

Multiple WalletConnect connections can be established at the same time.
There is a list of open connections.
Users can close single connections.

Open questions

Should we limit the max number of open connections?
Should we add a "close all connections" button?
How should the connections be sorted? (Alphabetically by dapp name or by the order they were opened?)

Also, it might be handly to show which dapp actually triggered the transaction

Also, it might be handly to show which dapp actually triggered the transaction

There was a user requesting this feature:https://discord.com/channels/477106835862716416/477391201708802058/819935984840867850

Yeah, that would be nice. Anyone wanting to test a contract on hardhat in conjunction with an existing L1 or L2 vendor contract (like ChainLink VRF)  is facing this problem.


[Bug]: Next.js App does not work offline

Provide environment information
    "next": "^14.2.1",
    "react": "^18.3.0",
    "@serwist/next": "^9.0.5",
    "serwist": "^9.0.5",

Which project is this issue for?
@serwist/next
Link to reproduction - Issues with a link to complete (but minimal) reproduction code help us address them faster
https://github.com/goleary/romad
To reproduce
Repo is private, but i'm happy to add any investigators to it in order to see the code
next.config.mjs:
import withSerwistInit from "@serwist/next";

const withSerwist = withSerwistInit({
  // Note: This is only an example. If you use Pages Router,
  // use something else that works, such as "service-worker/index.ts".
  swSrc: "src/sw.ts",
  swDest: "public/sw.js",
});

export default withSerwist({
  // Your Next.js config
});

src/sw.ts:
import { defaultCache } from "@serwist/next/worker";
import type { PrecacheEntry, SerwistGlobalConfig } from "serwist";
import { Serwist } from "serwist";

// This declares the value of `injectionPoint` to TypeScript.
// `injectionPoint` is the string that will be replaced by the
// actual precache manifest. By default, this string is set to
// `"self.__SW_MANIFEST"`.
declare global {
  interface WorkerGlobalScope extends SerwistGlobalConfig {
    __SW_MANIFEST: (PrecacheEntry | string)[] | undefined;
  }
}

declare const self: ServiceWorkerGlobalScope;

const serwist = new Serwist({
  precacheEntries: self.__SW_MANIFEST,
  skipWaiting: true,
  clientsClaim: true,
  navigationPreload: true,
  runtimeCaching: defaultCache,
});

serwist.addEventListeners();

Describe the bug
After adding my app to the home screen, opening it, turning on airplane mode, force quitting and reopening the app I get a message that says "Safari can't open the page because your iPhone is not connected to the internet".
Here is the deployed app: https://romad-production.up.railway.app/
Expected behavior
I expect that the app works offline.
Screenshots (if relevant)
After "Adding to home screen", opening, turning airplane mode on, force quitting and reopening the app:

This is what PWA Builder tells me.

Additional information (if relevant)
Perhaps I don't have something set up right? If so, I've reviewed the docs multiple times and I can't figure out what.

Your service worker failed to install:

This is because Serwist was fed an outdated list of assets to be precached. When it fails to precache an asset for any reason, it throws, causing the whole service worker to be discarded.
Have you checked if your deployment pipeline erroneously cached, or failed to cache, something?

Whoops, not sure how that got committed. I removed it!
Now I'm getting this error:

Can I ask where you are seeing those sw.js errors?
When I load the site via Chrome (macOS) or iOS Safari I don't seen any error message in the console (perhaps I resolved that particular error by removing public/sw.js from the repo?)

Ok, this is strange:
When I navigate to https://romad-production.up.railway.app from Safari on iOS it loads even when offline.
But I "installed" the PWA via Share=>"Add to Home Screen" and this one always shows the error mentioned above when opened after a force quit with no internet :(

That's not the case for me, unfortunately:

I guess that this error is because there's not a response in the cache and the network. Perhaps the page was not served by the service worker when you visited said page with network.

So strange!
The left devtools is from the homescreen version which has nothing listen under storage even though I loaded the PWA with service before force quitting it. The right is the safari version which does have the assets in the cache.

I've been trying to find reliable repro steps that do and do not cause the issue, but it is really inconsistent.
This has resulted in the error:

Add to home screen
Open from home screen
Turn off internet
Force quit "app"
Reopen app

This has also resulted in the error:

Add to home screen
Open from home screen
Background app
Force quit "app"
Turn off internet
Reopen app

And this:

Add to home screen
Open from home screen
Background app
Turn off internet
Force quit "app"
Reopen app

And this:

Add to home screen
Open from home screen
Background app
Reopen app
Turn off internet
Force quit "app"
Reopen app

It seems like this is the series of events that most often results in it working correctly, but I've also gotten the error after repeating these steps:

Add to home screen
Open from home screen
Background app
Turn off internet
Reopen app (reopening the app without internet before force quitting it)
Force quit "app"
Reopen app

FYI: I'm deleting the home screen "app" between every one of these cases.

I guess that this error is because there's not a response in the cache and the network. Perhaps the page was not served by the service worker when you visited said page with network.
There is only a single page in this app, so I'm not sure how that is possible.

It does seem as though once it works correctly without service after a force quit it continues working correctly every time, so it must be something about the above cases where it doesn't correctly cache the assets, but then once they are they stick around....?
What are the steps you're taking? Where it is working as expected every time?

@goleary
These are the steps I do:

Add app to home screen
Open app to install service worker
Close app
Open app so that the service worker handles the page
Close app
Turn off internet
Open app

Let me know if this works for you :)

When you say "Close app" what do you mean? Do you mean background it? or Force quit it?
I just followed those steps assuming you mean Force quit and it does appear as though it works!
That said, the app I'm building is designed to be used off grid (offline), and I'm concerned about how unreliable the offline behavior seems to be in iOS PWAs. That and I'm concerned that I won't be able to get my users to reliably follow the 5 steps required to ensuring that it actually works offline :/ I guess time will tell.
I did come up with a hack to reduce it to 2/3 steps. My app fetches itself after a couple seconds in an attempt to have "the service worker handle the page" without requiring more steps on the part of the user.  This does seem to cut it down to just these steps in order to "reliably" function offline:

Add app to home screen
Open app to install service worker
(wait long enough for app to fetch itself)

Don't know if you have any other ideas about how to "activate" the service worker in a cleaner manner (or perhaps as a part of serwist itself?)
Thanks for all of your help, will close the ticket!

also do you mind deleting the image of the map in this comment? I need to secure my app, but would like to get that location of off github's permanent record if possible 😉

@goleary
Add this:
const serwist = new Serwist(options);

const urlsToPrecache = ["/"] as const;

self.addEventListener("install", (event) => {
  const requestPromises = Promise.all(
    urlsToPrecache.map((entry) => {
      return serwist.handleRequest({ request: new Request(entry), event });
    }),
  );

  event.waitUntil(requestPromises);
});

serwist.addEventListeners();

This tells Serwist to cache the pages in urlsToPrecache as the service worker is being installed. It works in the same manner as precaching, except that we will not use PrecacheStrategy, but rather whatever strategies that match the pages. This works best for Next.js apps, as using PrecacheStrategy will cause your pages to be outdated until an updated service worker is installed whenever you deploy an update to your app.
Also there isn't a way to wipe the screenshot off GitHub, I'm afraid. Best you mention your requirements next time, I'd say. Sorry for that :)


Fix colormap delete

Fixes the delete colormap button so that it removes the colormap from both the local state and the vcs server. In the event that a graphics method was using the deleted colormap it sets that graphics method back to the "default" colormap.

Note: These changes depend upon changes that are currently in the nightly build of vcs-js


Move old race_achs into achievements

resource "achievments" (Achievments for mix server) should be removed from startup for race server.

Actually I want race_achs to be removed, it still uses the old sql system and should be merged into achievements

Done


Guard macros

This renames is_success?/1 to success?/1 and is_failure?/1 to failure?/1 to align with Elixir style that functions prepended with is_ work in guard clauses.
~~https://hexdocs.pm/elixir/1.9.0/naming-conventions.html#is_-prefix-is_foo~~
I added is_success/1 and is_failure/1 so we would have those for guards.
It also adds a Guards section in the docs.

Elixir 1.6.6 doesn't care for the @doc that would add a Guards section.

The guard looks good, I added the comment about changing the other function.
Probably for now, just add the guard.

I rolled back the renaming.

Thanks, I haven't used defguard before.
I wonder if because success and failure are defined as macros, can they already  be used as guards

Looks like you get:
** (FunctionClauseError) no function clause matching in :erl_eval."-inside-an-interpreted-fun-"/1

I got:
iex(1)> require OK
OK
iex(2)> f = fn x when OK.success(x) -> x end
#Function<7.91303403/1 in :erl_eval.expr/5>
iex(3)> f.({:ok, 1})
** (FunctionClauseError) no function clause matching in :erl_eval."-inside-an-interpreted-fun-"/1

    The following arguments were given to :erl_eval."-inside-an-interpreted-fun-"/1:

        # 1
        {:ok, 1}

Yeah, that's what I got too. Looks like you get that for any value apart from an explicit return of true

Ahh so the grouping addition breaks the tests. I'll update the travis file on master and then suggest we pull it into this branch. with green tests this looks great and I'll merge away

Hmm, I made some very simple changes to the test settings and now one is failing.
https://travis-ci.org/CrowdHailer/OK/builds/552190306

Released as 2.2.3 https://hex.pm/packages/ok, along with #64
We don't have a changelog but if you fancy, leave a comment here https://elixirforum.com/t/ok-elegant-error-handling-with-result-monads-alternative-to-elixir-with-special-form/3264/31


Add a sample for github source in knative/docs/eventing/samples

Expected Behavior
knative/docs repo contains workable examples for Knative Eventing examples including github.
Actual Behavior
Currently has an out of date one, will remove it from there.
Additional Info
Should be done in conjunction with: #36

https://github.com/knative/eventing/issues/548


Fixed raw image url for documentation

Using the relative path for images results in the image not found on the documentation website, this PR fixed the newly added image for the doc.

Thanks!


Refactoring to common.

Moving some of the files to the common folder.
Part 1 of the big rebase.

All set. Part 1 is done. All works.


Osiris crashed mid game.

yeah i cant play anymore with osiris,
after the last update of CS:GO (1day ago) osiris is crashing mid game....
everything work, i jhust get like 1000000 error messages in 1 minute.
please fix osiris...

still works for me, might be using latest one.

bro nothing crashed, pasted some features as well, working fine tho


feat(Components): add target prop to Button, Fab, and IconButton

add target prop to Button, Fab, and IconButton
update index.d.ts
update stories

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

npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Error during installation:
Error: Invalid formula: /opt/homebrew/Library/Taps/redmadrobot/homebrew-formulae/catbird.rb
catbird: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the redmadrobot/formulae tap (not Homebrew/brew or Homebrew/core):
  /opt/homebrew/Library/Taps/redmadrobot/homebrew-formulae/catbird.rb:7

Error: Cannot tap redmadrobot/formulae: invalid syntax in tap!

Fixed in: https://github.com/RedMadRobot/homebrew-formulae/pull/3

@margarita-v Please try to install FigmaExport via Homebrew again.

Not it works, thank you 👍