Re: Are ES6 modules in browsers going to get loaded level-by-level?

2020-10-24 Thread Randy Buchholz
>We could wirte a simpler parser just for the imports subset IMHO code on client and server isn't the root problem. I've written a few versions and the biggest issue I had was how to distinguish an `import` request/fetch from any other. There is nothing in the request metadata to let you know

RE: Are ES6 modules in browsers going to get loaded level-by-level?

2020-10-18 Thread Randy Buchholz
ay, October 17, 2020 10:35 PM To: Randy Buchholz Cc: es-discuss@mozilla.org Subject: Re: Are ES6 modules in browsers going to get loaded level-by-level? That's neat, but it seems like the same work that a server would have to do with actual ES Module imports, right? And the "type tree&q

Re: Are ES6 modules in browsers going to get loaded level-by-level?

2020-10-17 Thread Randy Buchholz
I think some form of bundling will always be necessary. I use classes and took a name-spaced and typed approach to modules and classes, putting each class in its own module in a file hierarchy (namespace). This is an enterprise level LOB application with dozens of classes. Many classes are used

Re: Are ES6 modules in browsers going to get loaded level-by-level?

2020-10-14 Thread Randy Buchholz
I've been doing some work around module loading/importing recently, writing some "import awareness" into the server request pipeline. I'm also doing things on the client side, but I'm not set up to build a browser so I'm substituting a DI based `injection` approach for the `import` operation.

Custom Elements in Templates

2019-09-24 Thread Randy Buchholz
I'm putting a custom element in a template and then "selecting" it out to Window level. It seem to loose its identity as a custom element. ``` // In page class MyElement extends HTMLElement { constructor() { super(); } get Field() { return

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread Randy Buchholz
Sorry. My confusion. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread Randy Buchholz
@Andrea Giammarchi, While the connection is secondary, HTML often serves as the specification for the creation of JS objects. And while it could be considered a sub-set, JS is full of HTML related features - `HTMLElement` for one. Thing is, if you are

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread Randy Buchholz
Full Table Scans and Unique indexes are database concepts (that's the DBA reference). When a database searches for a record based on a column value, it might look at every record in the table to find the matches - scan the entire (full) table, in the order the records were inserted or stored.

RE: Indexing HTML Attributes and Unique Indexes

2019-05-22 Thread Randy Buchholz
ā€. Iā€™m sure the engines are pretty optimized for this though. From: Andrea Giammarchi Sent: Wednesday, May 22, 2019 12:25 PM To: Randy Buchholz Cc: es-discuss@mozilla.org Subject: Re: Indexing HTML Attributes and Unique Indexes With Custom Elements you have `attributeChangedCallback` which reacts

Indexing HTML Attributes and Unique Indexes

2019-05-22 Thread Randy Buchholz
I've been working with `Custom Elements` and I'm writing a lot of code against tag attributes. In some cases, I want the attribute values to be unique on a page (like `id`). It got me wondering about how the engines handle attribute based searches, and if indexing (with unique/distinct

Re: Discussion: Module Reflection - import.reflect

2019-04-25 Thread Randy Buchholz
It seems the recursion has problems with `Symbol`, at least in Chrome. ``` import * as module from "/foo.mjs"; export default class Foo{ } const bar = Symbol("Bar"); ``` Load page, enter debug mode, and reload. The debugger disconnects. ___

Re: Discussion: Module Reflection - import.reflect

2019-04-24 Thread Randy Buchholz
Interesting approach. Covers "public" (exported) members, which is about 90% of my use cases. Works great! Thanks. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Discussion: Module Reflection - import.reflect

2019-04-24 Thread Randy Buchholz
Maybe my example was misleading by using an `import`. What I'm talking about is inspecting the module from within itself. Similar to `this` or `self`, AFAIK, I can't get a reference to the module from within the module - e.g., `module`. Say, I'm in a module that has a default export of class

Re: Proposal: Static Typing

2019-03-25 Thread Randy Buchholz
I recently started doing a lot of ES, coming from C# and really missed "typings" at first. But once I learned to think more in es, they became less necessary - even cumbersome in some ways. The question for me on this really comes down to what is a "type" and what value does it bring. As I see

Discussion: Module Reflection - import.reflect

2019-01-25 Thread Randy Buchholz
Would it be worthwhile to add reflection to modules as a distinct feature? `import.meta.url` is a basic form of reflection, but it seems (?) `meta` is trying to be a fairly loose specification. Being able query a module can be helpful. For example, if I can see the static imports, I can

Re: Re: Proposal: Symbol Linked to `typeof`

2019-01-16 Thread Randy Buchholz
Your Absolutely right! My mistake. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Proposal: Symbol Linked to `typeof`

2019-01-16 Thread Randy Buchholz
@Augusto Moura, I like the approach using `hasInstance`. It may be just me, but having your software architecture hardcoded to your filesystem (even with logical roots) feels shaky. (and so 1970ā€™s ļ˜Š). Namespaces serve the purpose you stated at compile/runtime, but also serve as a form of human

Re: Re: Proposal: Symbol Linked to `typeof`

2019-01-15 Thread Randy Buchholz
Right. Misappropriating a symbol corrupts its intent. As ES moves in a more towards a more "class-ish" feel, and people start writing more classes, a type/namespace system isn't far behind. Implementing some symbols to support this helps drive some standard approaches and discourages symbol

RE: Proposal: Symbol Linked to `typeof`

2019-01-15 Thread Randy Buchholz
the same unreliability with one of the few truly reliable operators in the language. On Tue, Jan 15, 2019 at 12:38 PM J Decker mailto:d3c...@gmail.com>> wrote: On Sat, Jan 12, 2019 at 8:19 AM Randy Buchholz mailto:w...@randybuchholz.com>> wrote: (Hi all, new to group) Some of th

Proposal: Symbol Linked to `typeof`

2019-01-12 Thread Randy Buchholz
(Hi all, new to group) Some of the Well Known Symbols are linked to standard functions - Symbol.toStringTag - A string value used for the default description of an object. Used by Object.prototype.toString(). When I have a Class instance (say, `const flow = new Flow()`, the debugger shows