DrSensor / DrSensor/nusa

`strict` and loose mode

Open
#59 0 comments 0 reactions 0 assignees View on GitHub
enhancement optimization priority: medium
Dominant language
JavaScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

By default this framework operate on loose mode where `__MODE__ === "loose"`. All scripts that only have strict mode have smaller bundle size and it's organized on `strict/` folder. For example,
```html

```
will define `` that only operate on strict mode.

### `strict` mode
- [ ] Require `@bind` decorator (unlike controlled loose mode, binding work on class parent and ancestors too without traversing)
- [ ] Can be enforced via `strict` attribute when using default (loose) scripts
- [ ] `` doesn't handle inline `` and `<style>` module (where it has attribute `type=module/*`)

### loose mode
- [x] Bind class `accessor`
- [x] Bind class `get`ter/`set`ter
- [ ] Bind class field
- [x] Bind class method()
- [ ] By default, all binding apply to all class parent and ancestors (#57)
- [ ] #57 can be controlled via `traverse-depth=<uint>` attribute or `class extends traverse(...Classes).extends(Class)` helper

> 💡 **Hint**: traverse binding and binding class field can be implemented at the same time
> ```js
> if (name in instance) {
> desc[name].set = function(value) {
> super[name] = databank[index] = value
> }
> }
> Object.defineProperties(instance, desc)
> ```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.