Week 41 - 2018
The weeknote for 10/8 - 10/14.
OSS
denoland/deno
deno is a new TypeScript / JavaScript runtime.
-
Contributions.
- https://github.com/denoland/deno/pull/946
- A PR which improves the log output of unit testing. But the there is a problem on the timing of the logging of the test case's title, it's now pending. This PR raised another issue https://github.com/denoland/deno/issues/948, which requires to fix the writing of stdout, which needs the fix around tokio.
-
I also tried to change
any
type of parameters ofassertEqual
function tounknown
type, but typescript doesn't seem to guess successfully the type of them inside the if statement and I gave it up. Probably we need to wait for typescript to be updated to handle them correctly. -
deno now seems supporting TCP server.
The echo server example (taken from the benchmark script):
import { args, listen, copy } from "deno";
const addr = args[1] || "127.0.0.1:4544";
const listener = listen("tcp", addr);
console.log("listening on", addr);
listener.accept().then(async conn => {
await copy(conn, conn);
conn.close();
listener.close();
});
$ echo "hello
> " | nc localhost 4544
hello
c3js/c3
- Released v0.6.8
- Now scss files are included in npm package.
MyProject
kt3k/buttons
https://github.com/kt3k/buttons
buttons
is a web service for recording the daily tasks by creating the buttons for those tasks.
- Now user profile page shows the heatmap of the user. The heatmap can be filtered by the buttons.
- twitter auth has been added. Now session continues 3 days.
- @LukeSugiura has signed up. Thanks! :)
Work
draft-js
- Read a little bit about the inside of draft-js because we met this issue and needing the solution for it.
- The view part of draft-js is written in react, and the data part is written in immutable.js and its wrapper classes. EditorState is the root of the all models and it works as the facade of the entire data layer. They don't use flux framework. They just trigger changes to EditorState and which kind of works like the reducer of redux. There seems nothing wrong about this architecture.
- The root problem of issue #1886 is the timing of creating a new node. draft-js doesn't create a new text node when the user changes the inline text styles, but it creates a new text node after the first character was entered after the change of the style. That seemed a problem, and it required a lot of changes in both structure of models and the timing of text node creation. I gave it up because it's not fixable in a reasonable amount of time.
- The issue #1886 is more or less critical for the users who use IMEs. As far as I searched, none of famous JavaScript wysiwyg editors have this defect. My conclusion is just "Don't use draft-js in production".
react-helmet
- The team encountered an infinite loop in react-helmet. react-helmet uses
deep-equal
. The implementation ofdeep-equal
is very naive, and it throwsMaximum call stack size exceeded
error with the following code:
const a = {}
const b = { a }
a.a = b
require('deep-equal')(a, b)
This is because a
and b
has completely and infinitely the same shape but not the same reference at any level of the trees. This overflow error doesn't happen with, for example, assert.deepStrictEqual or lodash.isEqual. They checks the circular reference in the target objects and prevent the infinite recursions.
react-helmet uses deep-equal
in shouldComponentUpdate (This decision itself is silly or ignorant). This doesn't cause a problem in most cases, but in some cases, this triggers the infinite recursion of deep-equal and throws an error. I couldn't identify the condition which causes this situation, but when it happens, the props.children seems having the infinite structure and probably that's the problem. When it happens, props.children has _owner
property and under it, there seem exiting circular structures.
Math
Category Theory
Reading the category theory textbook of The University of Chicago. https://github.com/kt3k/math-exercises-notes/tree/master/categories
- Did some routine proofs. Now Ab,
Vect_k
, and Top are shown to be categories.
Movie
A Quiet Place
- Seen a movie, A Quiet Place. I liked it, but I'm not such impressed. I didn't learn anything from the movie. Just got a strange feeling.