profile
viewpoint
Christophe Benz cbenz https://jailbreak.paris/ Paris, France Co-founder / software developer at Jailbreak. Ex Etalab, Easter-eggs

amccollum/microtron 26

Microformat Parser/Transformer

cbenz/ccomptes-affected-taxes 3

Affected taxes of french "cour des comptes"

cbenz/elm-leaflet-maps 3

Using Leaflet Maps in Elm by way of Polymer

cbenz/git-deploy 2

Deploy git repositories to multiple targets.

brunetton/aum_google_chrome_extension 1

AUM extension for google chrome (Makes possible to open profiles in tabs on www.adopteunmec.com (adoptes un mec))

cbenz/dokuwiki_picasa_webalbum 1

Dokuwiki plugin for PWI (Picasa Webalbum Integration)

cbenz/elm-openfisca 1

Experimentation of a rewrite of OpenFisca-Core in Elm.

adrienpacifico/openfisca-france 0

French specific module for OpenFisca

benjello/openfisca-france-indirect-taxation 0

French indirect taxation module for OpenFisca

startedmaptiler/tileserver-gl

started time in 17 hours

startedToblerity/Fiona

started time in 18 hours

startedpraveenjuge/kutty

started time in a day

issue commentsailui/ui

Consider converting Sail UI into a Tailwind plugin

Hi

I started a project based on the idea of Tailwind plugins for UIs.

https://gitlab.com/cbenz/tailwind-toolkit

It is extremely alpha, there is about nothing.

Example with alerts : https://gitlab.com/cbenz/tailwind-toolkit/-/blob/master/plugins/alert.js

I'm happy to have found another project attempting to produce a UI toolkit based on Tailwind! I don't think that Tailwind UI has the same approach.

matt-daneshvar

comment created time in a day

startedjimmywarting/StreamSaver.js

started time in 7 days

startedbrowserless/chrome

started time in 7 days

issue openedkaisermann/svelte-i18n

Cannot extract message keys build by string interpolation

When running svelte-i18n extract as documented here on a file that formats a message with $_ using a message key build by string interpolation or concatenation, the CLI tool crashes with an exception.

There is such a message key in the Sapper template for svelte-i18n: $_('languages.' + item.replace('-', '_')).

How to reproduce:

$ git clone https://github.com/kaisermann/sapper-template-i18n.git
$ npm install
$ ./node_modules/.bin/svelte-i18n extract "src/components/Nav.svelte"
(node:1180263) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
    at /home/cbenz/Dev/vendor/sapper-template-i18n/node_modules/svelte-i18n/dist/cli.js:17:2801
    at Array.forEach (<anonymous>)
    at h (/home/cbenz/Dev/vendor/sapper-template-i18n/node_modules/svelte-i18n/dist/cli.js:17:2644)
    at Command.<anonymous> (/home/cbenz/Dev/vendor/sapper-template-i18n/node_modules/svelte-i18n/dist/cli.js:17:4131)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1180263) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:1180263) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I've tried with some other patterns that also fail with the same exception:

$('key.' + value)
$(`key.${value}`)

Expected behavior: the message extractor could display a warning, and skip this message key. I understand that it can't guess all the possible values of the string interpolation.

I'm using:

  • node v14.2.0 (Arch Linux)
  • svelte-i18n 3.0.4 (latest version at the time I write the issue)

created time in 7 days

started20lives/tailwindcss-rtl

started time in 7 days

startedsveltejs/community

started time in 25 days

startedrollup/plugins

started time in a month

startedkentcdodds/cross-env

started time in a month

startedMrRio/jsPDF

started time in a month

startedsindresorhus/filenamify

started time in a month

startedtypescript-eslint/typescript-eslint

started time in a month

startedargoproj/argo

started time in a month

startedmadzak/python-json-logger

started time in 2 months

issue commentWoden-app/svelte-nouislider

Export reference to inner slider object

With Svelte components wrapping other libs, it's always the same question: should we keep private the library instance? If so, each method has to be wrapped which can be a pain to maintain.

For example, I wrapped Mapbox GL with Svelte, and the Map class has tons of methods, so I exposed the instance (cf this line).

Another idea I sometimes used is to leverage Svelte "bind" mechanism. For example here we could have a value property that would be reactive to changes, allowing things like:

<script>
import NoUiSlider from '@woden/svelte-nouislider'

let value
</script>

<NoUiSlider bind:value />

<button on:click={() => { value = 10 }}>Set slider to 10</button>

When clicking on the button, value would be updated, but when manipulating the slider itself, value would be also updated.

That's higher-level than exposing the inner instance, but I think both could be made, so the user could choose between reactivity style (binding a property) or imperative style (calling the instance methods directly).

Implementation of value would be something like:

// In Slider.Svelte

export let value

$: sliderInstance.set(value)

slider.noUiSlider.on(
  "update",
  (values, handle, unencoded, tap, positions) => {
    value = values // or unencoded?
    dispatch("update", { values, handle, unencoded, tap, positions })
  }
)

(did not test it; but I plan to do it, and if it's satisfying I'll submit a real PR)

cbenz

comment created time in 2 months

PR closed Woden-app/svelte-nouislider

Export slider reference

Solves #1

+2 -2

1 comment

1 changed file

cbenz

pr closed time in 2 months

pull request commentWoden-app/svelte-nouislider

Export slider reference

Oops, forget about it, that's a mistake, it only exports a ref to an HTML element, sorry.

cbenz

comment created time in 2 months

PR opened Woden-app/svelte-nouislider

Export slider reference

Solves #1

+2 -2

0 comment

1 changed file

pr created time in 2 months

push eventcbenz/svelte-nouislider

Christophe Benz

commit sha a9070cd560d2916157307a4d14a7297b5c4816b5

Export slider reference Solves #1

view details

push time in 2 months

fork cbenz/svelte-nouislider

A Svelte wrapper for noUiSlider

fork in 2 months

issue openedWoden-app/svelte-nouislider

Export reference to inner slider object

I would like to call the .set() method of the inner slider instance. Currently I can't because it is private:

https://github.com/Woden-app/svelte-nouislider/blob/5f8c44bd8b7548596b1ca4351e1b293d9e25a68a/src/index.svelte#L6

I think that if you just change it to export let slider this will allow anyone to call any method on it like so:

<script>
import NoUiSlider from '@woden/svelte-nouislider'

let slider


</script>

<NoUiSlider bind:slider />

created time in 2 months

startedleongersen/noUiSlider

started time in 2 months

issue commenttailwindlabs/heroicons

Build and publish raw data

While working with this approach I updated sightly my data structure to define the variant, like this:

export const trash = {
  d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",
  viewBox: heroiconsViewbox,
  variant: "solid",
}

SvgIcon Svelte component was updated in consequence.

cbenz

comment created time in 2 months

startedpython-poetry/poetry

started time in 2 months

startedasottile/pyupgrade

started time in 2 months

startedandreoliwa/nitpick

started time in 2 months

startedSalamek/cron-descriptor

started time in 2 months

startedphotonstorm/phaser

started time in 2 months

startedrakyll/hey

started time in 2 months

startedderailed/popeye

started time in 2 months

startedromkor/svelte-portal

started time in 2 months

issue openedrefactoringui/heroicons

Build and publish raw data

I'd like to use heroicons with, for example, Svelte.

Currently only React or Vue are supported.

While it would be possible to add a build script to this repo to support Svelte, I think that it would be more interesting to have a build script that would output raw data.

I already use this method in a project by copy-pasting SVG path d attributes in heroicons.js, that I pass to my SvgIcon Svelte component.

Example:

import { trash } from "./heroicons.js"
import SvgIcon from "./SvgIcon.svelte"

<SvgIcon {...trash} />
// equivalent to
<SvgIcon d={trash.d} viewBox={trash.viewBox} />

It would be nice to replace the import from ./heroicons.js by npm install heroicons then importing from heroicons/data/solid for example.

This would remove the need to add a new build script to support any new JS frontend library (and there are plenty!).

What do you think about this? Should I start writing a new build script in order to produce such data?

Excerpt from heroicons.js:

// From https://heroicons.dev/

const heroiconsViewbox = "0 0 24 24"

export const externalLink = {
  d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
  viewBox: heroiconsViewbox,
}

created time in 2 months

startedcontainrrr/watchtower

started time in 2 months

startedhjacobs/kube-resource-report

started time in 2 months

startedhjacobs/kube-ops-view

started time in 2 months

startedstephenhillier/starlette_exporter

started time in 2 months

create barnchcbenz/s3fs

branch : afd-toutafrique

created branch time in 2 months

PR opened PyFilesystem/s3fs

Handle region in opener

In order to support S3 providers such as Scaleway it's mandatory to define a custom region.

While it's possible to build a S3FS instance with region= kwarg, by stopping using the open_fs(url) opener we don't leverage the generic side of pyfilesystem anymore.

+1 -0

0 comment

1 changed file

pr created time in 2 months

create barnchcbenz/s3fs

branch : handle-region-in-opener

created branch time in 2 months

fork cbenz/s3fs

Amazon S3 filesystem for PyFilesystem2

http://fs-s3fs.readthedocs.io/en/latest/

fork in 2 months

startedweibeld/k1s

started time in 2 months

startedgrafana/loki

started time in 3 months

more