Skip to content

Commit

Permalink
chore: rename qoot => qwik.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhevery committed May 29, 2021
1 parent d7b8cb7 commit d2cc5a6
Show file tree
Hide file tree
Showing 204 changed files with 613 additions and 618 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ dist
.history
bazel-bin
bazel-out
bazel-qoot
bazel-qwik
bazel-testlogs
**/*.gold.md
2 changes: 1 addition & 1 deletion DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Running cypress manually
## Publishing

```
bazel run client:qoot_pkg.publish -- --tag=next
bazel run client:qwik_pkg.publish -- --tag=next
```

## Pre-submit hooks
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 a-Qoot
Copyright (c) 2021 BuilderIO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# `Q-oot` `/kyo͞ot/` DOM-Centric, Resumable Web-App Framework
# `Qwik` DOM-Centric, Resumable Web-App Framework

An Open-Source framework designed for best possible [time to interactive](https://web.dev/interactive/), by focusing on [resumability](./docs/RESUMABLE.md) of server-side-rendering of HTML, and [fine-grained lazy-loading](./docs/LAZY_LOADING.md) of code.

---

> _DISCLAIMER_: This project is an Open Source project of [Miško Hevery](https://github.com/mhevery) and is in no way associated with, endorsed by, or supported by [Google LLC](https://about.google).
---

## Getting Started

- Visit [integration](./integration) folder for guided tours of Qoot to learn how it works.
- Visit [integration](./integration) folder for guided tours of Qwik to learn how it works.
- Understand the difference between [resumable and replayable](./docs/RESUMABLE.md) applications.
- Learn about Qoot's high level [mental model](./docs/MENTAL_MODEL.md).
- Learn about Qwik's high level [mental model](./docs/MENTAL_MODEL.md).
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

## Server

- [ ] Developer should `import 'qoot'`, and the server should translate it to relative URL.
- [ ] Developer should `import 'qwik'`, and the server should translate it to relative URL.

## STATE MANAGEMENT

Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
workspace(
name = "qoot",
name = "qwik",
managed_directories = {"@npm": ["node_modules"]},
)

Expand Down
40 changes: 20 additions & 20 deletions client/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package(default_visibility = ["//visibility:public"])

js_library(
name = "client",
package_name = "qoot",
package_name = "qwik",
srcs = ["package.json"],
deps = [
":project",
Expand All @@ -21,7 +21,7 @@ ts_project(
srcs = glob(
["**/*.ts"],
exclude = [
"qootloader.ts",
"qwikloader.ts",
"**/*.unit.ts",
"CONFIG.ts",
],
Expand All @@ -46,30 +46,30 @@ ts_project(
)

rollup_bundle(
name = "qoot",
name = "qwik",
config_file = "//:rollup.config.js",
entry_point = "index.js",
deps = [":client"],
)

terser_minified(
name = "qoot.min",
src = "qoot.js",
name = "qwik.min",
src = "qwik.js",
config_file = "//:terser.config.json",
sourcemap = False,
terser_bin = "@npm//terser/bin:terser",
)

ts_project(
name = "qootloader",
srcs = ["qootloader.ts"],
name = "qwikloader",
srcs = ["qwikloader.ts"],
declaration = True,
tsconfig = "//:tsconfig",
)

terser_minified(
name = "qootloader.min",
src = "qootloader.js",
name = "qwikloader.min",
src = "qwikloader.js",
config_file = "//:terser.config.json",
sourcemap = False,
terser_bin = "@npm//terser/bin:terser",
Expand Down Expand Up @@ -106,8 +106,8 @@ mocha_test(
api_extractor(
name = "public_api_extractor",
outs = [
"qoot.d.ts",
":qoot.api.md",
"qwik.d.ts",
":qwik.api.md",
],
args = [
"run",
Expand All @@ -127,8 +127,8 @@ api_extractor(

generated_file_test(
name = "publicAPI.md",
src = ":qoot.api.gold.md",
generated = ":qoot.api.md",
src = ":qwik.api.gold.md",
generated = ":qwik.api.md",
tags = ["unit"],
)

Expand All @@ -141,19 +141,19 @@ genrule(
)

pkg_npm(
name = "qoot_pkg",
name = "qwik_pkg",
srcs = [
":package.json",
],
substitutions = {"//internal/": "//"},
deps = [
":LICENSE",
":qoot",
":qoot.d.ts",
":qoot.min",
":qootloader",
":qootloader.min",
":qwik",
":qwik.d.ts",
":qwik.min",
":qwikloader",
":qwikloader.min",
"//client/cjs:package.json",
"//client/cjs:qoot",
"//client/cjs:qwik",
],
)
4 changes: 2 additions & 2 deletions client/CONFIG.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @license
* Copyright a-Qoot All Rights Reserved.
* Copyright BuilderIO All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/a-Qoot/qoot/blob/main/LICENSE
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
*/

import { setConfig } from './index.js';
Expand Down
8 changes: 4 additions & 4 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
If you would like to build the distribution bundles then you can run these commands:

```
bazel build client/qoot && ls -al dist/bin/client/qoot.js
bazel build client/qoot.min && ls -al dist/bin/client/qoot.min.js
bazel build client/qootloader && ls -al dist/bin/client/qootloader.js
bazel build client/qootloader.min && ls -al dist/bin/client/qootloader.min.js
bazel build client/qwik && ls -al dist/bin/client/qwik.js
bazel build client/qwik.min && ls -al dist/bin/client/qwik.min.js
bazel build client/qwikloader && ls -al dist/bin/client/qwikloader.js
bazel build client/qwikloader.min && ls -al dist/bin/client/qwikloader.min.js
```
4 changes: 2 additions & 2 deletions client/assert/assert.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @license
* Copyright a-Qoot All Rights Reserved.
* Copyright BuilderIO All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/a-Qoot/qoot/blob/main/LICENSE
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
*/

export function assertDefined(value: any, text?: string) {
Expand Down
4 changes: 2 additions & 2 deletions client/assert/assert.unit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license
* Copyright a-Qoot All Rights Reserved.
* Copyright BuilderIO All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/a-Qoot/qoot/blob/main/LICENSE
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
*/
4 changes: 2 additions & 2 deletions client/assert/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @license
* Copyright a-Qoot All Rights Reserved.
* Copyright BuilderIO All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/a-Qoot/qoot/blob/main/LICENSE
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
*/

export * from './assert.js';
2 changes: 1 addition & 1 deletion client/cjs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ load("@npm//@bazel/typescript:index.bzl", "ts_project")
package(default_visibility = ["//visibility:public"])

esbuild(
name = "qoot",
name = "qwik",
entry_point = "index.ts",
platform = "node",
tool = select({
Expand Down
4 changes: 2 additions & 2 deletions client/cjs/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @license
* Copyright a-Qoot All Rights Reserved.
* Copyright BuilderIO All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/a-Qoot/qoot/blob/main/LICENSE
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
*/

export * from '../index.js';
6 changes: 3 additions & 3 deletions client/cjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"description": "A CJS version of qoot",
"description": "A CJS version of qwik",
"type": "commonjs",
"main": "./qoot.js",
"typings": "../qoot.d.ts"
"main": "./qwik.js",
"typings": "../qwik.d.ts"
}
34 changes: 17 additions & 17 deletions client/component/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Qoot Components
# Qwik Components

A collection of Qoot Components in a tree structure make up a Qoot application.
The unique feature of Qoot Components is that they can be:
A collection of Qwik Components in a tree structure make up a Qwik application.
The unique feature of Qwik Components is that they can be:

1. Server-side pre-rendered:
1. The state of the Qoot Component serializes into the DOM attributes:
1. Qoot Components can rehydrate on the client out of order:
1. Qoot Components lazy load their behavioral handlers:
1. Qoot Components declare listeners (both event and broadcasts) declaratively
1. The state of the Qwik Component serializes into the DOM attributes:
1. Qwik Components can rehydrate on the client out of order:
1. Qwik Components lazy load their behavioral handlers:
1. Qwik Components declare listeners (both event and broadcasts) declaratively

## SSR

Qoot's goal is to have extremely fast startup times. Qoot achieves this by minimizing the amount of code the client needs to load and execute. This is done through:
Qwik's goal is to have extremely fast startup times. Qwik achieves this by minimizing the amount of code the client needs to load and execute. This is done through:

1. Server-side rendering: The server can pre-render the application. Most of the application UI never changes and so there is no need to bring the code to the client.
1. Fine-grained lazy loading: Only download code which needs to be executed now. If the application contains a button that is rarely clicked, then the code for the handler should not be downloaded unless the user interacts with the button.
Expand All @@ -20,7 +20,7 @@ Qoot's goal is to have extremely fast startup times. Qoot achieves this by minim

Most frameworks create replayable applications. By replayable, we mean that once the server renders the page, the client must re-run the whole application to get the client memory-heap into a state to be ready to interact with the users. Examples are: setting up listeners, subscribers, closures, and entity objects. The more complicated the page, the more complex the amount of code the client has to replay in order to get the client memory-heap into the right state.

In contrast, Qoot aims to be resumable. A resumable application can always be serialized and send across the wire. On the client-side, there is no need to replay any of the SSR code on the client. The application has all of the relevant information serialized in HTML in a form such that the client can resume where it left off. For example, once the chrome of the application is rendered there is no need ever to execute that code if the chrome is static.
In contrast, Qwik aims to be resumable. A resumable application can always be serialized and send across the wire. On the client-side, there is no need to replay any of the SSR code on the client. The application has all of the relevant information serialized in HTML in a form such that the client can resume where it left off. For example, once the chrome of the application is rendered there is no need ever to execute that code if the chrome is static.

## Out of order re-hydration

Expand All @@ -40,7 +40,7 @@ In-order-hydration would be if one would start at a component and render everyth

## State

A component store state. There are three different kinds of states which Qoot recognizes:
A component store state. There are three different kinds of states which Qwik recognizes:

1. **Private State**: A private state of the component is a state which only matters to the component. For example, in case of a collapsible UI element, whether or not the element is collapsed is private state of the component. (A component can choose to expose its private state, but that is beyond the scope of this discussion.)
1. **Shared State**: A shared state is information that can be part of more than one component. Typically this is information that needs to be persisted on the server. Because it is shared between components it can't be serialized within each components because doing so would lead to duplication. An example would be a to-do item in a task tracking application.
Expand All @@ -50,7 +50,7 @@ A component store state. There are three different kinds of states which Qoot re

In traditional applications, listeners are problematic because they cause a lot of code to be downloaded even if the user never interacts with that listener. For example, a shopping checkout code may be very complex, but clicking on the purchase button is rare. A replayable application must set up a listener on the purchase button. The listener, in turn, needs a reference to the purchase entity. All of these objects need to be created and wired into the listener on application startup. This causes a lot of code to be downloaded which may never be executed.

Qoot solves this by having a declarative way of setting up listeners. The listeners only specify where the code lives (import.) Unless the event fires, the listener never loads the code. The result is that Qoot only loads code when it is strictly necessary and thus delays most of the work until later. This leads to fast startup time because only very little code needs to be downloaded, and even less needs to be executed.
Qwik solves this by having a declarative way of setting up listeners. The listeners only specify where the code lives (import.) Unless the event fires, the listener never loads the code. The result is that Qwik only loads code when it is strictly necessary and thus delays most of the work until later. This leads to fast startup time because only very little code needs to be downloaded, and even less needs to be executed.

# Declaring Components

Expand Down Expand Up @@ -128,7 +128,7 @@ The private implementation consists of at a minimum of 1) one file representing

```typescript
import {<COMPONENT>} from './<COMPONENT>.js';
import {Component} from './qoot.js';
import {Component} from './qwik.js';

export <COMPONENT>State {
// Serializable state of the component.
Expand All @@ -143,7 +143,7 @@ The private implementation consists of at a minimum of 1) one file representing

```typescript
import { GreeterProps } from './Greeter.js';
import { Component } from './qoot.js';
import { Component } from './qwik.js';

export interface GreeterState {
name: string;
Expand All @@ -161,7 +161,7 @@ The private implementation consists of at a minimum of 1) one file representing

```typescript
import { <COMPONENT>Component } from './<COMPONENT>_component.js';
import { inject } from './qoot.js';
import { inject } from './qwik.js';

// See: Component Injection for more details
export default inject(<COMPONENT>Component, function (this:<COMPONENT>Component) {
Expand All @@ -173,7 +173,7 @@ The private implementation consists of at a minimum of 1) one file representing

```typescript
import { GreeterComponent } from './greeter_component.js';
import { inject } from './qoot.js';
import { inject } from './qwik.js';

export default inject(GreeterComponent, function (this: GreeterComponent) {
return (
Expand All @@ -187,7 +187,7 @@ The private implementation consists of at a minimum of 1) one file representing
- **Handler**: Handlers are optional, but most components will have one or more. Handlers are responsible for processing events. By convention, the handlers are named `<COMPONENT>_<WHAT>_on<EVENT>.ts` (`greet_text_onClick.ts`)

```typescript
import { inject } from './qoot.js';
import { inject } from './qwik.js';
import { <COMPONENT>Component } from './<COMPONENT>_component.js';

export default inject(<COMPONENT>Component, function (this: <COMPONENT>Component) {
Expand All @@ -200,7 +200,7 @@ The private implementation consists of at a minimum of 1) one file representing
Example:

```typescript
import { inject, markDirty, provideQrlExp } from './qoot.js';
import { inject, markDirty, provideQrlExp } from './qwik.js';
import { GreeterComponent } from './greeter_component.js';

export default inject(GreeterComponent, function (this: GreeterComponent, name: string) {
Expand Down
12 changes: 6 additions & 6 deletions client/component/component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/**
* @license
* Copyright a-Qoot All Rights Reserved.
* Copyright BuilderIO All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/a-Qoot/qoot/blob/main/LICENSE
* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
*/

import { QRL } from '../import/qrl.js';
Expand All @@ -13,10 +13,10 @@ import { AttributeMarker } from '../util/markers.js';
import { getInjector } from '../injector/element_injector.js';

/**
* Base class for Qoot component.
* Base class for Qwik component.
*
* All Qoot components are defined by a class that must inherit from `Component`.
* An instance of a Qoot component represents the transient state of that component.
* All Qwik components are defined by a class that must inherit from `Component`.
* An instance of a Qwik component represents the transient state of that component.
* A component contains `$state` and `$keyProps` properties.
*
* Example:
Expand Down Expand Up @@ -49,7 +49,7 @@ export class Component<PROPS, STATE> {
hostElement: Element
): Promise<COMP> {
// TODO: Needs tests
const componentConstructor = (this as any) as ComponentConstructor<COMP>;
const componentConstructor = this as any as ComponentConstructor<COMP>;
const componentTemplate = hostElement.getAttribute(AttributeMarker.ComponentTemplate);
if (!componentTemplate) {
hostElement.setAttribute(
Expand Down
Loading

0 comments on commit d2cc5a6

Please sign in to comment.