profile
viewpoint
Jeremy Ashkenas jashkenas @observablehq Berkeley & SF http://ashkenas.com 🏍 🛣 🌎 I miss _why.

jashkenas/backbone 27621

Give your JS App some Backbone with Models, Views, Collections, and Events

jashkenas/underscore 25175

JavaScript's utility _ belt

jashkenas/coffeescript 15490

Unfancy JavaScript

jashkenas/docco 3423

Literate Programming can be Quick and Dirty.

jashkenas/ruby-processing 1257

Code as Art, Art as Code. Processing and Ruby are meant for each other.

jashkenas/coffee-script-tmbundle 829

A TextMate Bundle for CoffeeScript

jashkenas/journo 427

A quick-and-dirty (literate) blogging engine

jashkenas/learning-processing-with-ruby 133

The examples from Daniel Shiffman's "Learning Processing", all done in Ruby-Processing

jashkenas/api-playground 66

Helping journalists understand, browse and toy with API data.

jashkenas/lil-license 62

A Lil Improvable License for Open Source Software

pull request commentobservablehq/runtime

Defer recompute until all variables are computing.

Putting in a couple of notes on this, for future us:

The fundamental problem we’re trying to solve with this branch is an under-specified total ordering of our runtime computation graph, specifically with the interaction between the evaluation order of generators that are yielding new values continuously, and downstream cells that depend on their values.

The downstream cell may compute "synchronously" (albeit, through a promise), or asynchronously, and when it computes synchronously, we want the evaluation order to be coordinated with the yielding of its input generator, so, given:

a = {
  let i = 0;
  while (true) yield ++i;
}
b = a

We want:

  • a: 1
  • b: 1
  • a: 2
  • b: 2
  • a: 3
  • b: 3
  • ... and so on.
mbostock

comment created time in 6 days

pull request commentobservablehq/runtime

Adding a test for #220

@mbostock — Would you like this as part of your merge for https://github.com/observablehq/runtime/pull/220/ ?

jashkenas

comment created time in 6 days

push eventobservablehq/runtime

jashkenas

commit sha 9abb7e16ff18eed3a01b3ee96a2112b97a7ef8e1

Remove tape.only

view details

push time in 6 days

Pull request review commentobservablehq/htl

Implement {html,svg}.fragment.

-export const html = hypertext(string => {+function renderHtml(string) {   const template = document.createElement("template");   template.innerHTML = string;   return template.content;-});+} -export const svg = hypertext(string => {+function renderSvg(string) {   const g = document.createElementNS("http://www.w3.org/2000/svg", "g");   g.innerHTML = string;   return g;-});+}++export const html = Object.assign(hypertext(renderHtml, fragment => {+  if (fragment.firstChild === null) return null;+  if (fragment.firstChild === fragment.lastChild) return fragment.removeChild(fragment.firstChild);+  const span = document.createElement("span");+  span.appendChild(fragment);+  return span;+}), {fragment: hypertext(renderHtml, fragment => fragment)});++export const svg = Object.assign(hypertext(renderSvg, g => {+  if (g.firstChild === null) return null;+  if (g.firstChild === g.lastChild) return g.removeChild(g.firstChild);+  return g;+}), {fragment: hypertext(renderSvg, g => {+  const fragment = document.createDocumentFragment();+  while (g.firstChild) fragment.appendChild(g.firstChild);

I'm probably missing something obvious, but why is this a while loop?

mbostock

comment created time in 19 days

push eventjashkenas/docco

jashkenas

commit sha 058989822f512aeff75d636daeaa934be06757bf

Bold ES6

view details

push time in 21 days

pull request commentjashkenas/docco

Humbling proposing to add Docco Next to the list.

Merged — with a few edits (and the list is historically chronological) Thanks!

mercmobily

comment created time in 21 days

push eventjashkenas/docco

jashkenas

commit sha 874f7494c95eec425e9b31532fb97736fc3a7513

Chronological order, rephrase

view details

push time in 21 days

push eventjashkenas/docco

Tony Mobily

commit sha 1352f5fee16c825ee0fb776f79f4f2dcd5d54d20

Humbling proposing to add Docco Next to the list. I hope the write up is OK -- if not, feel free to taser me!

view details

Jeremy Ashkenas

commit sha 4b06511fb59cc9357c01aa7c587ed294a3bcb48d

Merge pull request #408 from mercmobily/patch-1 Humbling proposing to add Docco Next to the list.

view details

push time in 21 days

PR merged jashkenas/docco

Humbling proposing to add Docco Next to the list.

I hope the write up is OK -- if not, feel free to taser me!

+4 -0

0 comment

1 changed file

mercmobily

pr closed time in 21 days

issue commentjashkenas/docco

ES6 port/rewrite done. A couple of questions...

Basically, I would love to have your OK to call it "Docco 2", but ONLY if you feel that 1) It won't confuse people 2) My version is what you would have done with a small mountain of time and determination 3) You feel my code is a version 2 of yours.

I think that would confuse people, and it isn't what I would have done for a version 2. Also, we don't want to have eventual confusion with a Docco v2.0 versus your project. So picking something else would be better.

mercmobily

comment created time in 24 days

issue commentjashkenas/docco

ES6 port/rewrite done. A couple of questions...

Looks nice! I hope you had fun working on it.

Feel free to send the PR adding the link to the Docco home page once you get it published up online somewhere. You can call it whatever you like — I promise I won't be offended.

mercmobily

comment created time in 24 days

issue commentjashkenas/coffeescript

Compilation very slow.

I can take a crack at this 👍

Woo hoo! 🥳

Jorenm

comment created time in a month

issue commentjashkenas/coffeescript

Compilation very slow.

And not to sound dismissive, but my intuition is that compile time is a low priority for most users.

I'll have to disagree. Compile times that are slow enough to be noticeable are a huge pain point for anyone that encounters them, grow worse as your project grows in scope and seriousness, and slow down your ability to iterate and test hypotheses.

In the project that I'm currently working on, our JavaScript compile time (just Rollup) takes ten seconds every time you make a change to the front-end, and it's terrible.

It's pretty clear we're not hunting a marginal decrease in compile time. 500ms -> 12s is a ridiculous jump and should definitely be fixable.

Yes, especially because it sounds like we haven't yet taken a profiling and optimization pass over the AST codebase, I think it's very likely there's something relatively simple that can be fixed, without needing to consider removing features.

Jorenm

comment created time in a month

issue commentjashkenas/coffeescript

Compilation very slow.

That’s the 1.12.7 compiler compiling the 1.12.7 codebase, and the 2.5.0 compiler compiling the 2.5.0 codebase, which is twice as large. For apples to apples you need to have the 2.5.0 compiler compile the 1.12.7 codebase.

Ah, true. Sorry for the brainfart.

I'd recommend doing a more thorough profile with Chrome DevTools, using @Jorenm’s problematic codebase (or something similar to it):

https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27

Then you can use the JS profiler (with flamechart), to see if there's any low hanging fruit to be optimized away.

Jorenm

comment created time in a month

issue commentjashkenas/coffeescript

Compilation very slow.

It could be that certain syntax is especially expensive to compile

Yeah, this sounds like a case of a potential polynomial time algorithm introduced by the AST changes that his files are triggering somehow (and that we could discover by profiling).

Although, 786ms in 1.x to 2,608ms in 2.5 also isn't too wonderful in isolation. I can imagine quite a few folks might be bothered by a ~ 4x compile slowdown.

Apologies for the grumbling, but I just wanted to voice it. Hopefully there’s an obvious optimization somewhere that can help.

Jorenm

comment created time in a month

issue commentjashkenas/coffeescript

Compilation very slow.

😱 That's very concerning.

If you don't mind troubleshooting a little bit — would you try installing 2.4.1, and letting us know how that fares? (There was a large internal change between 2.4.1 and 2.5.0).

Using the time command to get precise times for the runs on different versions would also help.

Jorenm

comment created time in a month

issue commentjashkenas/underscore

ES modules exports

One single file, please.

If we can keep the diff as small and the result as clean as possible, that would help greatly. Ideally, just adding named exports to the functions where they are — with Underscore itself as the default export.

mjeanroy

comment created time in a month

issue closedjashkenas/underscore

Enhance _.difference to evaluate non-primitives

I came across a need to compare two arrays A and B of objects, and produce an output array containing the objects belonging to A but not B. This use case is supported by _.difference, but only if the elements within the array are primitives.

closed time in a month

sambavaro

issue commentjashkenas/underscore

Enhance _.difference to evaluate non-primitives

Difference also works with objects, using JavaScript’s object equality semantics.

I'm not interested in adding deep object comparison/equality operators to core Underscore ... but I'm sure there are already lots of other libraries and plugins you can use that will do this.

sambavaro

comment created time in a month

issue commentjashkenas/underscore

ES modules exports

@jashkenas what do you think of @mjeanroy's suggestion? i would be happy to help...

Sure! I'd be happy to merge a PR that swaps to named exports for all of the Underscore functions, and also uses Rollup to publish a UMD version of the file.

mjeanroy

comment created time in a month

push eventjashkenas/underscore

Temur

commit sha fa118e74ab012cf38775f2245d9b68d1a075c6e4

Fix documentation entry for "sortedIndex" function Documentation for the `sortedIndex()` was at least ambiguous at this point, or even wrong, consider for example `let m = [ 1, 2, 4, 4, 4, 5, 6, 7 ];` array, if we are searching for `4`, like so: `_.sortedIndex(m, 4);`, it actually returns `2` which is a *smallest* index of 4 between all it's occurences, not simply the index found by binary search, at this point true binary search could return `3` instead of `2`. So, it is important to state explicitly in the documentation that the index returned is indeed *the smallest index*, as I corrected here. Please apply this update.

view details

Temur

commit sha 934052aa9471e537ec9ae175a9e6868a5d4be28b

make sure sortedIndex() finds the smallest index The test which is supposed to check if sortedIndex() finds the smallest index is already there, see line 137 which is quoted here: ``` assert.strictEqual(indexFor30, 2, 'finds the smallest index at which a value could be inserted to retain order'); ``` -however the `var number` array used for the test case does not contain duplicates, which is fixed in this commit. This is to ensure consistence of behavior of the sortedIndex() function. All in all this change makes the quoted test from the line 137 more meaningful by including duplicates, given that a pure binary search algorithm could have a different result in the same scenario.

view details

Jeremy Ashkenas

commit sha e51aa7251f3e010fe003fbb9d969a74b9dcda103

Merge pull request #2820 from tvibliani/patch-1 Fix documentation entry for "sortedIndex" function

view details

push time in 2 months

PR merged jashkenas/underscore

Reviewers
Fix documentation entry for "sortedIndex" function

Documentation for the sortedIndex() was at least ambiguous at this point, or even wrong, consider for example let m = [ 1, 2, 4, 4, 4, 5, 6, 7 ]; array, if we are searching for 4, like so: _.sortedIndex(m, 4);, it actually returns 2 which is a smallest index of 4 between all it's occurences, not simply the index found by binary search, at this point true binary search could return 3 instead of 2. So, it is important to state explicitly in the documentation that the index returned is indeed the smallest index, as I corrected here. Please apply this update.

+3 -3

1 comment

2 changed files

tvibliani

pr closed time in 2 months

Pull request review commentjashkenas/underscore

Fix documentation entry for "sortedIndex" function

 <h2 id="arrays">Array Functions</h2>       <p id="sortedIndex">         <b class="header">sortedIndex</b><code>_.sortedIndex(array, value, [iteratee], [context])</code>         <br />-        Uses a binary search to determine the index at which the <b>value</b>+        Uses a binary search to determine the smallest index at which the <b>value</b>

How about "lowest"?

tvibliani

comment created time in 2 months

push eventjashkenas/underscore

Ruben Bridgewater

commit sha 5304f86c4ca7c67d47e083be219bea7938161c34

Fix deprecation warning about `GLOBAL` This came up on CITGM (https://github.com/nodejs/citgm) and it's easy to fix.

view details

Jeremy Ashkenas

commit sha 36eef3c118041ae6386b6bba2b48b099e57ca0e5

Merge pull request #2801 from BridgeAR/fix-global-deprecation Fix deprecation warning about `GLOBAL`

view details

Margen67

commit sha 46888bfffb4bb151910b024fe92ee12ae91d0f11

Make links HTTPS

view details

Jeremy Ashkenas

commit sha 3c6d93b254632c069bbd8921a760127d04aa560b

Merge pull request #2816 from Margen67/https Make links HTTPS

view details

jashkenas

commit sha 853dd761cb58ebf57e94e0ab13d080970214aa16

Underscore.js v1.9.2

view details

jashkenas

commit sha 73e256d4fcac50b9068c0536d1251eef3c74bbe6

Merge branch 'master' into gh-pages

view details

push time in 2 months

pull request commentnodejs/node

lib: move GLOBAL and root aliases to EOL

This issue was fixed by @BridgeAR in March 2019 but that change has yet to make it into a release. jashkenas/underscore@5304f86

I was pinged by BridgeAR today, and published the updated test case as part of version 1.9.2.

jasnell

comment created time in 2 months

issue closedjashkenas/underscore

Publishing a new release

Is it possible to get a new release some time soon? I know there where no major changes but it would be keep CITGM working. See https://github.com/nodejs/node/pull/31167#issuecomment-571022478

closed time in 2 months

BridgeAR

issue commentjashkenas/underscore

Publishing a new release

Sure thing — I've pushed the latest master (with no actual code changes), and released it as 1.9.2.

BridgeAR

comment created time in 2 months

created tagjashkenas/underscore

tag1.9.2

JavaScript's utility _ belt

created time in 2 months

push eventjashkenas/underscore

jashkenas

commit sha 853dd761cb58ebf57e94e0ab13d080970214aa16

Underscore.js v1.9.2

view details

push time in 2 months

issue commenthelixbass/prettier-plugin-coffeescript

Formatting: don't dedent comma between nonbreaking call arguments

For your example:

f(
  if someCondition
    firstArg1
  else
    firstArg2
  secondArg
)

I would generally prefer:

firstArg = if someCondition
    firstArg1
  else
    firstArg2

f firstArg, secondArg

... but that's not the sort of thing that Prettier can do to a piece of code.

As to a general rule — I enjoy dropping the first, outermost level of braces/parens/brackets in a given expression ... but once you have more than one nesting of optional braces/parens/brackets, I prefer to include all of the inner ones, to help keep things crystal clear.

For a real example from thirty seconds ago, I initially misread your code snippet while skimming, assuming that secondArg was part of the conditional body.

helixbass

comment created time in 2 months

PR closed jashkenas/underscore

Personal advice
+1 -4

0 comment

1 changed file

liulyu

pr closed time in 2 months

issue commenthelixbass/prettier-plugin-coffeescript

Formatting: don't dedent comma between nonbreaking call arguments

Not exactly this issue, but related 😄. There are people who really dislike the deindented comma just floating out there, because it’s a tiny thing that’s easily overlooked; whereas others hate unnecessary braces. We had a back and forth about this in a PR a long time ago in the CoffeeScript repo. I think both opinions are valid. (I know, Prettier is supposed to be opinionated. . . .)

Quite right! Just to restate my opinion — I have a strong dislike for the floating dedented comma.

Optional braces, brackets and parens are supposed to be a convenience that can aid readability when used tastefully ... they're not supposed to be enforced or relied upon, and it's alright if there are many syntactical situations where you need to use them to get a clean parse.

helixbass

comment created time in 2 months

MemberEvent

PR opened observablehq/runtime

Reviewers
Adding a test for #220

After much struggle, I was able to write a test that distinguishes the variable computation ordering on master from the ordering on defer-recompute-test ... but I'm not positive that it demonstrates that the change in ordering is what we desire it to be, so read carefully.

The meaningful difference between the two branches is on the line commented in the test case below. On the current master, at the time that the gen generator cell is first fulfilled, the actual generator has not resumed yet after its initial yield, and the value of i is still 1.

On the defer-recompute branch, at the time that the gen generator cell is first fulfilled, the generator has already resumed, and although the current value being yielded through the runtime is 1, i already equals 2.

Is this the behavior we want?

+70 -0

0 comment

1 changed file

pr created time in 2 months

push eventobservablehq/runtime

jashkenas

commit sha cc6b83f52cd24b54e45d193f343ad19183a2e2ad

Testing the variable fulfillment ordering state more explicitly and exhaustively

view details

push time in 2 months

push eventobservablehq/runtime

jashkenas

commit sha 90eb30c97352a28d424f630fb4601e66f1b77e80

Adding a test for #220

view details

push time in 2 months

create barnchobservablehq/runtime

branch : defer-recompute-test

created branch time in 2 months

issue commentjashkenas/backbone

idAttribute is undefined for modelId method if model define as function.

I just merged the old https://github.com/jashkenas/backbone/pull/3966 PR, after resolving conflicts. Let me know if it gives you any trouble...

PavelKoroteev

comment created time in 2 months

PR merged jashkenas/backbone

Update `modelId()` to Allow Polymorphic Collections with Different, Unknown, Model.idAttributes

For Issue: https://github.com/jashkenas/backbone/issues/3965

Changes

  • modelId() now takes the idAttribute of the model in question as the second argument
  • modelId() will use the passed idAttribute before falling back to Collection.prototype.model.idAttribute and then 'id'
  • Retains backwards compatibility
  • Update tests to show default modelId() fallbacks
  • Update tests to show default polymorphic collection behavior

Rationale

Right now modelId(attrs) is only passed a plain-object representation of the model's attributes. This makes it difficult for application developers to create n-degree polymorphic Collection subclasses.

Contrived Example:

// A collection of mixed entity types that maintains sort order based 
// on their joinDate property

var Entities = Collection.extend({
  modelId(attrs){
    // What ID attribute to use? Not determined at runtime.
  },
  comparator: 'joinDate'
});


// These are only two entity types with different idAttributes, but assume 
// There may be up to (n) different entity types, each with different idAttributes, 
// determined by the database backing this example application.

var Company = Model.extend({
  idAttribute: 'companyId'
});

var Customer = Model.extend({
  idAttribute: 'customerId'
});

// Proceeding to add and remove Customers, Companies, etc, to the Entities
// Collection will mess up the `_byId` cache because the Entities collection
// is not aware of all the different possibilities for `idAttribute` at runtime and 
// a `modelId` method cannot be written to satisfy the needs of this app.

By making the modelId callback take the form modelId(attrs, model), where the second argument is the model in question, Backbone can retain backwards compatibility but enable the default implementation to be:

// Always give precedence to the provided model's idAttribute. 
// Fall back to the Collection's idAttribute, and then to the default value `id`.

Entities.modelId = function modelId(attrs, idAttribute){
  return attrs[(idAttribute || this.model.prototype.idAttribute || 'id'];
};

It still maintains backwards compatibility: For any implementation that is not already polymorphic, Collections will still function normally – models will have their idAttribute set when added to the Collection by the Collection's model constructor. Those that are already polymorphic, or have some type of non-standard idAttributes, will already have this modelId method overwritten.

+25 -16

3 comments

2 changed files

amiller-gh

pr closed time in 2 months

push eventjashkenas/backbone

Adam Miller

commit sha c71336641ee0354776556cdcfa5522f23ca14abf

Update to `modelId()` - modelId now takes the model in question as the second argument - modelId will look at the model in question's idAttribute before falling back to Collection.prototype.model.modelId and then 'id' - Makes basic polymorphic collection work out of the box while retaining backwards compatability

view details

Adam Miller

commit sha b3a28132901f3acc881bfa1efcc4acb04b2061b9

Only pass idAttribute to collection.modelId()

view details

jashkenas

commit sha 0b1c2e3fce3156fcb9819b8bbf8885456e4e1055

Resolve merge conflicts

view details

push time in 2 months

pull request commentjashkenas/underscore

Make links HTTPS

Updated!

Margen67

comment created time in 3 months

pull request commentobservablehq/parser

Allow destructuring of cells.

This initial implementation looks good, and the functionality it provides is highly desirable.

While there are going to be a few small considerations to keep in mind in the UI when the adopt destructuring (permalink names for cells, display of multiple names in the cell menu, embed code generation for a cell that exposes multiple values...), those are all fairly easily surmountable.

I'd still like to register my (already verbally discussed) mild objection to this syntax. We’re appropriating the parenthetical declaration of destructured function arguments, instead of the JavaScript canonical parenthetical wrapping of the entire destructuring assignment. I'd prefer that we hew to JavaScript if we’re going to add this.

For example, JavaScript:

let a, b;
...
({a, b} = expression);

But in this proposal:

({a, b}) = expression

I'd prefer:

({a, b} = expression)

... and of course, dropping the parentheses altogether would be best.

There’s quite a bit more discussion about the ES6 parse choices of ({a, b}) = ... vs ({a, b} = ...) in this GitHub thread, as well as the special note in the ES spec forbidding expression statements from starting with {.

mbostock

comment created time in 3 months

push eventjashkenas/underscore

Margen67

commit sha 46888bfffb4bb151910b024fe92ee12ae91d0f11

Make links HTTPS

view details

Jeremy Ashkenas

commit sha 3c6d93b254632c069bbd8921a760127d04aa560b

Merge pull request #2816 from Margen67/https Make links HTTPS

view details

push time in 3 months

PR merged jashkenas/underscore

Make links HTTPS

Dead links weren't replaced. Please also make this link https: image

+59 -59

1 comment

13 changed files

Margen67

pr closed time in 3 months

pull request commentjashkenas/underscore

Make links HTTPS

Thanks!

Margen67

comment created time in 3 months

issue closedobservablehq/runtime

cross-domain problem

check the official example, https://codepen.io/jashkenas/pen/gzZXPG Access to script at 'https://api.observablehq.com/d/e8186dc6a68b5179.js?key=65c8f0576a197717' from origin 'https://cdpn.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

closed time in 4 months

eatgrass

issue commentobservablehq/runtime

cross-domain problem

I've fixed the CodePen example, which was out of date. It should be working again properly now.

Thanks for reporting!

eatgrass

comment created time in 4 months

pull request commentobservablehq/inspector

Do not delve inte Object.prototype

image

tmcw

comment created time in 4 months

PR opened observablehq/stdlib

Reviewers
Adding FileAttachment to the README
+95 -0

0 comment

1 changed file

pr created time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha 4fd1f08466286ac53a6dec2d710684fec26645b5

Adding FileAttachment to the README

view details

push time in 4 months

push eventjashkenas/docco

Evgeniy Vasilev

commit sha 9180843677f5c94133f6d0733f96cb20f624e8c0

Adds dart support to languages.json

view details

Jeremy Ashkenas

commit sha 8bf8ddd3876d11f63c022270172bd0d3540997c5

Merge pull request #406 from aquilax/patch-1 Adds Dart support to languages.json

view details

push time in 4 months

PR merged jashkenas/docco

Adds Dart support to languages.json

Adds Dart support to languages.json

Reference for doc comments here.

+1 -0

0 comment

1 changed file

aquilax

pr closed time in 4 months

create barnchobservablehq/stdlib

branch : file-attachments-readme

created branch time in 4 months

PR opened observablehq/stdlib

Reviewers
File attachments image() "invalid URL" fix

Currently, calling .image() on a FileAttachment will fail if the attachment’s ".url()" returns a relative path.

+6 -2

0 comment

1 changed file

pr created time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha f14ae5849124a77b1e1c9f05d34e513dbb89558c

Fix FileAttachment().image() with relative paths

view details

push time in 4 months

create barnchobservablehq/stdlib

branch : file-attachments-cross-origin

created branch time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 067695192aa579a2c3845bf21320ee4d0a975c4c

Bump stdlib

view details

push time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha e06f7882546784fed0019cba5d85e23917c3baa7

Rename ResolveFileAttachment to FileAttachments

view details

push time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha 793fd80711d028bceb5f2d9b058561e84321517a

Throw an error when resolve() fails to find a file by name.

view details

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 051aa6b9c1e788f37db193ce3bade9b652d46d2e

Expose ResolveFileAttachment as a property on a runtime instance, for embeds

view details

push time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha 590fffdb0f6f480360005d1d01d59eb41fd2d32a

Tweak ResolveFileAttachment Implementation Strategy

view details

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 2d4da0adeedc88bd61246dbf135550100d62b81e

While init-ing a module, allow additions to specials.

view details

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 06ad81741ad1eca39fab56bfbb666ea0bd265a57

Bumping d3-require to latest version

view details

push time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha 811d89ba1722bfb5c02cfb1fcfd5d2b8c683b55d

Bump d3-require to latest

view details

push time in 4 months

push eventobservablehq/parser

jashkenas

commit sha c427ee213df5eb8d88d668c79df9e17617b50213

Bumping yarn.lock

view details

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 87df00cb211dd18dd650f71553dc36528d246c82

Exporting FileAttachment in parallel to Library

view details

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 4d1a187f81a1427762134fb948a8138896a982cf

Bumping stdlib test version

view details

push time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha d0c10dc4c987cedddfa5eea31d7df7367ad4aa00

Don't expose raw FileAttachment from the standard library

view details

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha dcad84508700f2072ce5bd3474d40d9f9bb68540

Bumping stdlib test version

view details

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 9f395ebc3b974bb0a31db4558700e78d81d06481

Bumping stdlib test version

view details

push time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha 7c983f36136f6514e92f3f172ac4f90aeecd7e94

Don't expose raw FileAttachment from the standard library

view details

push time in 4 months

Pull request review commentobservablehq/stdlib

Basic FileAttachment implementation, with "resolve" function

 export default function Library(resolver) {   const require = requirer(resolver);   Object.defineProperties(this, {     DOM: {value: DOM, writable: true, enumerable: true},+    FileAttachment: {value: constant(FileAttachment), writable: true, enumerable: true},

Great idea. I was imagining that there would be cases where we would only be able to access it from the library itself ... but I guess that's not exactly true.

jashkenas

comment created time in 4 months

PR opened observablehq/runtime

Use stdlib/file-attachments

Goes with: https://github.com/observablehq/stdlib/pull/128, for testing

+3 -5

0 comment

2 changed files

pr created time in 4 months

PR opened observablehq/stdlib

Basic FileAttachment implementation, with "resolve" function

... for use in UI, API (for downloads), and embeds.

  • UI: resolve() function posts messages up to the parent frame to get signed URLs for private files.
  • API: resolve() function is compiled with relative paths to downloaded files in the folder hierarchy.
  • Embeds: resolve() function is compiled into the ES Modules, with absolute URLs of published files.
+43 -0

0 comment

3 changed files

pr created time in 4 months

pull request commentd3/d3-require

SyntaxError: Identifier 'require' has already been declared

It only happens for me when actually running a script — not in the Node REPL.

Try a test.js file containing:

const require = function() {};

And node test.js or node -r esm test.js

jashkenas

comment created time in 4 months

push eventobservablehq/runtime

Visnu Pitiyanuvath

commit sha eb641cf1c79b72babca5927544cd31a474530110

Module special resolves Allow specifying special names per module that resolve to arbitrary values

view details

Visnu Pitiyanuvath

commit sha c24a4e11153f398b256d59bc46268ce68a55987b

Allow passing in specials via runtime.module(...)

view details

Mike Bostock

commit sha fdf60a74e8324f234cda93b281d729b15ad9c288

Update special-test.js

view details

Visnu Pitiyanuvath

commit sha 8b626ab6b92456f46f737a90844696e5132120d6

Copy special on copy/derive

view details

Visnu Pitiyanuvath

commit sha 93b7625a7b9792d7ca4df19792c59ca488860490

4.4.5

view details

Tom MacWright

commit sha f7e5da919122c81f882de4dd23d987745c4eed8f

4.4.6

view details

Mike Bostock

commit sha 4c5ab2d69f1be3522c5b0fc50ce5d89c4cda8c0e

Require special to be iterable.

view details

Mike Bostock

commit sha 83863f22d4c3019a1db69a56aab8c0183c387320

Convert special object to entries.

view details

Tom MacWright

commit sha 9f9256907458b741ed6469e708897a4917b72874

4.4.7

view details

Visnu Pitiyanuvath

commit sha a1072eabd2a8ea956cf192f6f082b6d7156804dc

Try out GitHub Actions!

view details

Visnu Pitiyanuvath

commit sha 87e24fb77e8e76e5f31989f536bad71d9296103b

Remove Node v8, v12 tests And will open a ticket for v12 failures.

view details

Mike Bostock

commit sha 2c6b4404afc33a2d0dfa113cefabb3f039d9f654

Explicitly await runtime._computing.

view details

Mike Bostock

commit sha 4fb3d19398908d81dde8b3b9fbe51b7e8651c5b3

More deterministic tests.

view details

Mike Bostock

commit sha d6c0162220a196820c58048624e1b7806209dcee

Restore node@12 tests.

view details

Mike Bostock

commit sha 878fbf1e8cea2883441567bf3735ff6f0986c554

Remove unnecessary await.

view details

Mike Bostock

commit sha ff12d89d78a0767232f26d1ff034881df4d0e411

Simplify.

view details

Visnu Pitiyanuvath

commit sha ecb7fac61a474643fa3491d827330350e316f9d4

Show Node CI status on README

view details

jashkenas

commit sha 1d45ae16218956cea808736198671b3505410130

Using file-attachments branch of stdlib

view details

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 2898341862eaeffa860f287791c4f63156fbc3ff

Using file-attachments branch of stdlib

view details

push time in 4 months

push eventobservablehq/runtime

push time in 4 months

push eventobservablehq/runtime

jashkenas

commit sha 54367a58d255308cea27139ecb06a265af2764ac

Using file-attachments branch of stdlib

view details

push time in 4 months

PR opened d3/d3-require

SyntaxError: Identifier 'require' has already been declared

In Node 10.16, attempting to declare const require = ... causes a SyntaxError:

const require = function() {}; ^

SyntaxError: Identifier 'require' has already been declared at Module._compile (internal/modules/cjs/loader.js:723:23) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

Using a var for the export continues to work.

+1 -1

0 comment

1 changed file

pr created time in 4 months

create barnchd3/d3-require

branch : node-require-error

created branch time in 4 months

pull request commentjashkenas/coffeescript

Add debugging information to error message test

Looks harmless enough to me 👍

Trott

comment created time in 4 months

create barnchobservablehq/runtime

branch : file-attachments

created branch time in 4 months

push eventobservablehq/stdlib

jashkenas

commit sha bfdb699694ed08baafa15410731cc25f7bac66d5

Adding a basic implementation of remote file attachments, with resolve function

view details

push time in 4 months

create barnchobservablehq/stdlib

branch : file-attachments

created branch time in 4 months

delete branch observablehq/stdlib

delete branch : mutable

delete time in 4 months

Pull request review commentobservablehq/parser

File attachments indices

 export default function findFileAttachments(cell) {           );         } -        references.add(-          args[0].type === "Literal"-            ? args[0].value-            : args[0].quasis[0].value.cooked-        );+        const fileReference =+          args[0].type === "Literal" ? args[0].value : args[0].quasis[0].value.cooked;++        if (references.has(fileReference)) {+          references.get(fileReference).push({+            start: args[0].start,+            end: args[0].end+          });

Maybe pull out const fileLocation = {start: args[0].start, end: args[0].end} into a line above, but otherwise, looks great!

sydneypalumbo

comment created time in 5 months

push eventobservablehq/parser

jashkenas

commit sha fca20b682e07e601f8b2df12da2de47dfe531b60

Ensure that fileAttachments Set() exists, s/parseData/parseFileAttachments

view details

push time in 5 months

delete branch observablehq/parser

delete branch : file-attachments-file-attachments

delete time in 5 months

push eventobservablehq/parser

jashkenas

commit sha 07c42e412b20f1b8746a0a815e6f4f643b1702a7

Ignore nyc_output

view details

jashkenas

commit sha 70e6f03b280c428b2a57479610bb582316490d2a

Rename Data to FileAttachment

view details

jashkenas

commit sha 119e9801bd15665f31b90030f91a1f703ba46a39

Add a nested test

view details

Jeremy Ashkenas

commit sha d0b5a425fd04ada03695ace4035f9dd6108ce0df

Merge pull request #67 from observablehq/file-attachments-file-attachments Rename file attachments

view details

push time in 5 months

PR merged observablehq/parser

Rename file attachments

Renames Data() to FileAttachment() ... assuming that's the direction we want to go.

+623 -263

2 comments

11 changed files

jashkenas

pr closed time in 5 months

pull request commentobservablehq/parser

Rename file attachments

(FileAttachment 🥇)

jashkenas

comment created time in 5 months

PR opened observablehq/parser

Reviewers
Rename file attachments

Renames Data() to FileAttachment() ... assuming that's the direction we want to go.

+623 -263

0 comment

11 changed files

pr created time in 5 months

create barnchobservablehq/parser

branch : file-attachments-file-attachments

created branch time in 5 months

push eventjashkenas/jashkenas.github.io

jashkenas

commit sha 79acb219702dc3d05b67b9bdba6768ad7be497e6

Add @version embed cell example

view details

push time in 5 months

push eventjashkenas/jashkenas.github.io

jashkenas

commit sha 95690d5ea67b93b29bf355c0c548023e6077c006

Adding a cell embed example

view details

push time in 5 months

push eventjashkenas/jashkenas.github.io

jashkenas

commit sha a67c75e423fccbaebc2f4847d7a1e7829f082cf8

Adding a cell embed example

view details

push time in 5 months

issue closedjashkenas/backbone

Generate schema from models

Is it possible to generate some form of schema in a structured format using backbone models?

closed time in 5 months

tom-sherman

issue commentjashkenas/backbone

Generate schema from models

Certainly. I'd perhaps recommend using AJV to validate your model attributes using JSON Schema in your model.validate() function.

tom-sherman

comment created time in 5 months

more