webcomponents / webcomponents.org

Home of the web components community
https://www.webcomponents.org
Apache License 2.0
356 stars 95 forks source link

Simplify JS and templates #1418

Closed aomarks closed 1 year ago

aomarks commented 1 year ago

This PR re-organizes the site-client package, and simplifies the way we load scripts in the browser for each page.

Changes

New layout of packages/site-client/src:

.
├── pages
│   ├── catalog
│   │   ├── boot.ts
│   │   ├── wco-catalog-page.ts
│   │   ├── wco-catalog-search.ts
│   │   └── wco-element-card.ts
│   ├── docs
│   │   ├── boot.ts
│   │   ├── shell.ts
│   │   └── wco-docs-page.ts
│   ├── element
│   │   ├── boot.ts
│   │   ├── shell.ts
│   │   └── wco-element-page.ts
│   └── home
│       ├── boot.ts
│       └── wco-home-page.ts
└── shared
    ├── wco-footer.ts
    ├── wco-nav-page.ts
    ├── wco-page.ts
    └── wco-top-bar.ts

Also

github-actions[bot] commented 1 year ago

A live preview of this PR will be available at the URL below and will update on each commit. = The build takes ~5-10 minutes, and will 404 until finished.

https://pr1418---site-khswqo4xea-wl.a.run.app/

Warning Until our Cloud Run project is public, only authorized users can view the above URL. The easiest way to view it authenticated is to run the following proxy command and visit http://localhost:5453

(gcloud beta run services proxy --project=webcomponents-org-test --region=us-west2 --tag=pr1418 --port=5453 site \
& gcloud beta run services proxy --project=webcomponents-org-test --region=us-west2 --tag=pr1418 --port=6453 catalog)
justinfagnani commented 1 year ago

Nice!

My only thought is that for terminology we might consider hydrate over boot, because all boot does is hydrate and boot is just a new term to add to the mix. Very much no big deal though. This is great.

aomarks commented 1 year ago

Nice!

My only thought is that for terminology we might consider hydrate over boot, because all boot does is hydrate and boot is just a new term to add to the mix. Very much no big deal though. This is great.

I was looking for a name that just means "the script that runs when a page starts up", which might not actually do hydration, or might not exclusively do hydration. Other names could be: init, entrypoint, ... but I guess I'll just keep it as boot for now, can always change it.