Open lemanschik opened 1 year ago
We should not expect any adoption as we destroy the money flow of them
wassfila — heute um 11:27 Uhr
This is a "Very" Frequently Asked Question and disturbing for people starting with Astro : Comments and improvements suggestions are welcome
https://stackoverflow.com/questions/74784560/how-to-share-state-among-components-in-astro/74840400#74840400
Stack Overflow
[How to share state among components in Astro?](https://stackoverflow.com/questions/74784560/how-to-share-state-among-components-in-astro/74840400)
I believe I'm taking the wrong approach in my code, how can I set a client side preference in a button click that is used as a prop in all my astro components globally? Or how should I do this? I k...
Bild
SP33D — heute um 11:33 Uhr
@wassfila your correct your doing it fundamental wrong
good observation from you by the way
Let me expand a bit about that context as it gives the most value
The ESModule system got designed with static exports because we engine internal return a memory pointer
that means for you if you create a esm module like this
sharedMemory.js
export const sharedMemory = {};
export const assignMemory = (state) => Object.assign(sharedMemory, state);
any where in your code no matter the scope or context this is engine wide
import { sharedMemory, assignMemory } from './sharedMemory.js';
assignMemory({ currentPage: 'myPageId' });
any where in your code no matter the scope or context this is engine wide
await import('./sharedMemory.js').then(({ sharedMemory}) => sharedMemory.currentPage); // => 'myPageId'
await import('./sharedMemory.js').then(({ assignMemory}) => assignMemory({ currentPage: 'myPageIdChanged'}); // => ({ currentPage: 'myPageIdChanged'})
await import('./sharedMemory.js').then(({ sharedMemory}) => sharedMemory.currentPage) // => 'myPageIdChanged'
so the key fundamental concepts are ESModules can only be modified out of them self that is why you need the assignMemory function
the exported value is shared always real time as all do import only memory pointers of the already instantiated module
that was about the client
now what you do fundamental wrong with your backend sync
you assume that you got a persistent connection that is not true most have flaky connections
you need to collect the data in a append only fashion and via serviceWorker and background sync api like style sync periodicaly
if there is a network connection
i do not post code for that simply look into couchdb sync and learn the fundamentals they use
couchdb sync is a protocol and does not refer to you should use couchdb
Chris (he/him) — heute um 11:44 Uhr
Very thorough answer @wassfila — nice work!
SP33D — heute um 11:46 Uhr
but i will not correct the stackoverflow answer stackoverflow is already dead
not useable to much miss information
uncleanable
wassfila — heute um 11:55 Uhr
@SP33D thank you for your feedback, I updated my SO answer and even mentioned you. As per the project link I posted, I was already using that pattern for (volatile) state sharing. I differentiate now state sharing from state+events sharing.
A note on that, Astro/Vite introduced a server code bundling, which unfortunately broke that for sharing state between express and Astro middleware, given that an imported module from Astro will reside in a different file than the one imported by express. If you have an idea for that ? currently, I only see prevent bundling, use env vars (needs serdes)
SP33D — heute um 11:56 Uhr
mention https://github.com/lemanschik
GitHub
lemanschik - Overview
lemanschik has 122 repositories available. Follow their code on GitHub.
Bild
i am implementing that as fundamentals
i am the author of the next 3rd edition dragon book
The White Dragon Book
https://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools
Compilers: Principles, Techniques, and Tools
Compilers: Principles, Techniques, and Tools is a computer science textbook by Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman about compiler construction for programming languages. First published in 1986, it is widely regarded as the classic definitive compiler technology text.It is known as the Dragon Book to generations of co...
Compilers: Principles, Techniques, and Tools
now you know why you read in the linux world there are dragons inside 🙂
thats me then
😉
wassfila — heute um 11:59 Uhr
this statement is not correct, although I exposed all options, the proposed solution is based on cookies which are not connection dependent.
SP33D — heute um 12:00 Uhr
cookies are not correct we deprecate them already
we have reached 30% net deprecation
we track that via http archive
it is a database of the whole www
we use it to track function and api usage net wide
you need to switch all your cookie stuff to the new advertisement and privacy sandbox apis
https://privacysandbox.com/
The Privacy Sandbox: Technology for a More Private Web.
The Privacy Sandbox aims to create technologies that protect online privacy and give companies and developers tools to build thriving digital businesses.
i know what i say i am 100% correct i author what you will use in 10 years
you can trust my predictions
wassfila — heute um 12:05 Uhr
I posted all options, see using client storage section and how much effort that includes for flicker free server response. I'm personally moving away from cookies for all the reasons you know.
SP33D — heute um 12:05 Uhr
that is great that you already do so
i hope that i next year find a sponsor then all will switch anyway
i finished based on the pattern i showed here a net wide super memory grid
implementing this as persistent net wide memory to use it as super ki
out of all browsers in the world based on webrtc
all world knowleg will be persistent loaded in net wide memory as long as any using peer exists net wide garbage collection
no build no load no run only watch
🙂
i call that at a whole web 4.0 but most do net get that concept so i start by kicking of a real chromium os with a installer and visual build tool
once some one sponsors that i guess even the most tooling depending developers that need it easy will switch to that os
and as that os is simple real chromium as a platform build for your needs it is already browser compatible 1:1 and you can still use existing browsers anywhere
thats the high level view of the current state of the web
Chris (he/him) — heute um 12:13 Uhr
Hi @SP33D — happy that you’re feeling comfortable in the server, but please remember the main point of this space is to discuss things related to the Astro project. We’d love to see sites you build with Astro or answer questions if you run into issues.
We have an off-topic channel for stuff that is only tangentially related, but still of interest to the community. Please do be mindful of people’s time and interests when posting.
SP33D — heute um 12:14 Uhr
heheheh that was not off topic but i understand your point is astro a profit project?
i was thinking that it is a open one so like a none profit
if astro is profit oriented i will leave any way complet
i guess i will look into the documentation and website for that right?
ah i understand as my concepts do deprecate your sponsors that is why you claim that?
hmmm ok i guess then i need to leave you alone and let you be happy with your sponsoring money 😄 sorry i did got it wrong i only know the code first time i looked into sponsor related stuff and where the money flows but i learned next time before i try to improve a project i should look if the money aligns with the goals of the net
I wanted to give them for free the future they also denied it and it is important to log that so we can track people who put money into them or other projects like that are not allowed to get affiliated with us. Also we need to track that so that we do not hire or share information with them.
SP33D — gestern um 23:20 Uhr
Oh hi your here what a good thing
i am searching for you already did create https://github.com/lemanschik/awesome/issues/5
GitHub
[Try to get some one from astro that we know. · Issue #5 · lemanschi...](https://github.com/lemanschik/awesome/issues/5)
@matthewp you know me maybe back in the day from canjs stealjs I want to onboard you as your now working on astro i did work on some new cool stuff and you remember maybe from the steal-element exa...
Try to get some one from astro that we know. · Issue #5 · lemanschi...
🙂
only for you
I did in short port everything into the browser without the need for wasm
in fact i have the successor of wasm at hand
including the missing wasm module system
SP33D — gestern um 23:29 Uhr
you maybe know https://stackblitz.com/ and the nodejs example in the browser
[StackBlitz | Instant Dev Environments | Click. Code. Done. - StackB...](https://stackblitz.com/)
StackBlitz | Instant Dev Environments | Click. Code. Done. - StackB...
i can replicate that feature complet with 10 lines of code i did demo it to them they offered me a job i did not accept
because of higher motivation then ripping customers
i also bring low hanging fruites like multiple ssr rendering streams based on the doc implementation api
which allows parallel html parsing in the browser it is the nativ html parser exposed as api
const doc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null);
const body = document.createElementNS('http://www.w3.org/1999/xhtml', 'body');
body.setAttribute('id', 'abc');
doc.documentElement.appendChild(body);
if you create a doc with the implementation api it even offers own ESM globalThis
as i know you like loaders that is how we can discard the ESM Cache in userland
we render the scripts on a extra document and if we are done with the modules we throw away the reference to the doc and this way get garbage collected
😄
SP33D — heute um 12:40 Uhr
Sorry your on the wrong side of the net i need to revert that offer.
Clyde
BOT
— heute um 12:40 Uhr
Deine Nachricht konnte nicht zugestellt werden. In der Regel passiert das, weil du mit dem Empfänger keinen Server teilst oder der Empfänger nur Direktnachrichten von Freunden akzeptiert. Du kannst dir die vollständige Liste der Gründe hier ansehen: https://support.discord.com/hc/de/articles/360060145013
Diese Nachricht kannst nur du sehen • Nachricht verwerfen
Typescript
A facade implementation for js allowing you mainly to add types to anything is equal to Stealify Lang Types so a Upper Case function that takes a value and returns it unified checked.
Pros
cons
Turbo a Rust Written TaskRunner
Pros
The Secret of turbos performance is that it runs simply multi th as also hashes a lot of stuff like ENV Variables
Cons
Git can do all that better already the people need education. and i am not talking about using pipelines. worktrees and branches would help already. as also understanding how git hashes work.
Vite
A Wrapper around rollup value could not be identified maybe plugin system and defaults?
Astro
a DoneJS Clone using maybe vite i do not know next js?