tracked-tools / tracked-built-ins

Tracked versions of JavaScript's built-in classes
MIT License
128 stars 24 forks source link

Migrate off the cached primitives polyfill #406

Open NullVoxPopuli opened 1 year ago

NullVoxPopuli commented 1 year ago

https://github.com/tracked-tools/tracked-built-ins/blob/193214bc7cce2d4a23edfb5dfaf93b6a6e674550/addon/src/-private/object.js#L5

MichalBryxi commented 7 months ago

I think this could influence #405 (read: should be done before).

What will be the process of removing ember-tracked-storage-polyfill? How would one go about replacing respective methods (TrackedStorage, createStorage, getValue, setValue, ...)? Is there a known pattern that can replace them? Or is it even as simple as just removing the code that calls those altogether?

NullVoxPopuli commented 7 months ago

Migrating to the builtins is what needs to happen:

import { 
  createStorage, getValue, setValue 
} from '@glimmer/tracking/primitives/storage';

But i don't know at what minimum ember-source these become available

MichalBryxi commented 7 months ago

Ah, those are described in this RFC, which was merged here on Feb 12, 2021. But it seems to me that even v5.8.0-apha.1 does not contain @glimmer/tracking/primitives/storage. So I guess your sentence:

But i don't know at what minimum ember-source these become available

Talks about the future and I'd have to wait for said code to land before I can do anything here?

Making sure as the wording is a bit confusing :)

NullVoxPopuli commented 7 months ago

looks like you understand the situation :sweat_smile:

Timing is a bit goofy with storage primitives, because the ideal is that starbeam replaces the need for all this. but we'll see. the packages will still need to exist tho, so it may still be worth PRing an actual implementation -- though, I don't know if that'd help with perf. :sweat_smile: (I don't know that it wouldn't either!)