profile
viewpoint

kMeillet/reason-loadable 84

🔥 Suspense/Lazy for ReasonReact.

kMeillet/bs-dynamic-import 31

📦🚀 BuckleScript dynamic import interop on JavaScript environment

kMeillet/afk-av 2

AFK Alterac Valley to get ranks for WoW Classic.

kMeillet/dufl 1

[POC] Modern zero-config JavaScript toolchain

kMeillet/jest-graphql-import 1

Jest GraphQL import transformer (see issue)

kMeillet/isfiberreadyyet 0

Is Fiber Ready Yet Website

startedDmitrySoshnikov/syntax

started time in a month

startedemoon/rust_minifb

started time in 2 months

startedemoon/minifb

started time in 2 months

startedvire/jest-vue-preprocessor

started time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 16b17161583d5f718d4aecc1c94d550c5c3b7b74

Remove duplicate "Special thanks to" in README

view details

push time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 16b17161583d5f718d4aecc1c94d550c5c3b7b74

Remove duplicate "Special thanks to" in README

view details

push time in 2 months

startedtaiki-e/futures-async-stream

started time in 2 months

startedmgattozzi/oxidizing-the-technical-interview

started time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 3676bb9987fa3ddafef877b36a049046a3214b11

Remove non-necessary comments in examples

view details

Meillet Robin

commit sha 2f7b48f2379c83f38df04f497455537f223c5bad

Update README (Experimental SuspenseList usage and fix typo)

view details

push time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 3676bb9987fa3ddafef877b36a049046a3214b11

Remove non-necessary comments in examples

view details

Meillet Robin

commit sha 2f7b48f2379c83f38df04f497455537f223c5bad

Update README (Experimental SuspenseList usage and fix typo)

view details

push time in 2 months

starteddoctorn/trait-eval

started time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 0089b7d652060f8cb8b274d40860651898e49ffc

Update README (fix typo)

view details

push time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 0089b7d652060f8cb8b274d40860651898e49ffc

Update README (fix typo)

view details

push time in 2 months

issue closedkMeillet/bs-dynamic-import

How to interact with classes in modules

Imagine you have a module that exports a class Rect. How would you declare the type so that you can do new Rect(), I think is not currently possible to handle that specific case.

closed time in 2 months

aitoroses

issue commentkMeillet/bs-dynamic-import

How to interact with classes in modules

Warning : This package is now in read-only mode, if you want to lazy load React components in a ReasonML application use "reason-loadable".

If you want to import something else like a JSON document or JavaScript code that isn't a React component (example : Math library), take a look at "reason-loadable" source code and tests, it can do that with some adaptation.

This package probably doesn't work anymore since BuckleScript changed object representation in JavaScript output in recent version (from array to object).

aitoroses

comment created time in 2 months

push eventkMeillet/bs-dynamic-import

Meillet Robin

commit sha 4e0982de41ee3cea7d2c36b50a1a782dd942c0bc

Update README.md

view details

push time in 2 months

issue closedkMeillet/bs-dynamic-import

Error handling if bundle fails to load (React Error Boundaries)

In React we can handle this by React Error Boundaries. https://reactjs.org/docs/error-boundaries.html

Something similar can be done here too to catch the error if any chunk fails.

closed time in 2 months

kd4001

issue commentkMeillet/bs-dynamic-import

Error handling if bundle fails to load (React Error Boundaries)

React Error Boundaries require class component, there's no official hook for this feature at the moment, but I guess you can use this package : https://www.npmjs.com/package/use-error-boundary

kd4001

comment created time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 9fe604dba709e95ea1eabb8a3f4b49c49beb3644

Add tests for class component

view details

push time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 9fe604dba709e95ea1eabb8a3f4b49c49beb3644

Add tests for class component

view details

push time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 581b0a054f1714127e76cfa47e0ae9b81c2ddc3c

Reintroduce lockfiles (package-json.lock & yarn.lock)

view details

Meillet Robin

commit sha 5e7f4b4b6f097dd9d96abdc1106a4515ce714ea5

bsconfig.json upgrade - Remove "bs-dynamic-import" dependency. - Use "bs-react-testing-library" for testing instead of "bs-react-test-renderer". - Change JSX version to 3. Only ReasonReact JSX v3 is supported. Please consider migrating to JSX v3 (new ReasonReact hook components).

view details

Meillet Robin

commit sha 771d35538deaf7efb33387f26081d15883e7d109

Remove "interface" command in package.json

view details

Meillet Robin

commit sha 870a47ca23142fa74f72e9caa483a887cb9b7145

Package.json changes - Update all devDependencies (bs-platform@7.3.2, @glennsl/bs-jest@0.5.1, babel-jest@26.0.1, jest@26.0.1, @babel/core@7.9.6, babel-preset-react-app@9.1.2, react@16.13.1, react-dom@16.13.1, reason-react >= 0.8). - Remove "bs-dynamic-import" dependency. - Remove "bs-react-test-renderer" devDependency. - Add "reason-react" in peerDependencies to avoid package duplication. #84 - Move "react" & "react-dom" into devDependencies. - Add "@komponente/react-hello-world" in devDependency (used for testing external component).

view details

Meillet Robin

commit sha dab5ae1f8e91d32d6b3608fb2359709a5726d7ac

Update tests

view details

Meillet Robin

commit sha aaa07786ab7e0fefc312f5ceab09bc475f9b262f

Remove interface file

view details

Meillet Robin

commit sha 2a17ea662ba0b9392bde828070444be9973779ea

Add new ReLoadable API (import & lazy_)

view details

Meillet Robin

commit sha 77e9b2b54e2f67127fe638ed350b8707c9c9af57

Update refmt script Update refmt shell script to use node_modules bsrefmt instead of globally installed bsrefmt.

view details

Meillet Robin

commit sha b212389f278a5fd07d1ba33ccd9b4b6ebbd2151e

Update README

view details

Meillet Robin

commit sha 7891b76bc9dfe13eae4ad5880d45a915c2ac111e

Update package description

view details

Meillet Robin

commit sha 7bf2ec189bef44a1634a358ecede7a2a2319130a

Bump version to 1.0.0

view details

Meillet Robin

commit sha 3b0ce83391f1bd805b61c5e94ee2d68b5b9cdc70

Update travis configuration to run tests against Node.js v12 (LTS)

view details

Meillet Robin

commit sha fe7c5d7959fd61bbe2c1bf817c42611d61f9ffca

Add npmignore file Add npmignore file (prevent tests & examples to be part of npm artifacts).

view details

Meillet Robin

commit sha 8f8f05e3d43d126290d5f7d053f4a778ffea7ffa

Update tests

view details

Meillet Robin

commit sha ef0a86416346b3f6b51b58dd3ec70ded70cb7aab

Update CHANGELOG

view details

Meillet Robin

commit sha 22ebed73bf907c0b851ee405af3eb4be0b7decb4

Update examples

view details

Meillet Robin

commit sha 6a31555a830a2807bd76922be193dec4db07506c

Update CHANGELOG

view details

Meillet Robin

commit sha ed6208b82862321d28a665712c705a74f7d77713

Use reason-loadable@1.0.0 in examples

view details

push time in 2 months

issue closedkMeillet/reason-loadable

Failure when module has other variables exported

Whenever the module being loaded contains any other bindings at the top level besides make and default, the following runtime error occurs:

react-dom.development.js:11017 Uncaught TypeError: Cannot read property 'someVariable' of undefined
    at Object../src/LazyHelloWorld.bs.js (LazyHelloWorld.bs.js:12)
    at __webpack_require__ (bootstrap:63)
    at Object../src/App.bs.js (App.bs.js:12)
    at __webpack_require__ (bootstrap:63)
    at __webpack_require__.t (bootstrap:161)

Cause

BuckleScript compiles top level declarations as exports from that module, but since the lazy module declares the component as undefined and runs the include (val component); statement in order to make the compiler accept that it has the same signature as the actual component, it attempts to copy those exports from the undefined value:

// Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE
'use strict';

var React = require("react");

var include = undefined;

var make = React.lazy((function (param) {
        return import("./HelloWorld.bs.js");
      }));

var Lazy_someVariable = include.someVariable; // <== This is the culprit

var Lazy = {
  someVariable: Lazy_someVariable,
  make: make,
  $$default: make
};

exports.Lazy = Lazy;
/* include Not a pure module */

Steps to reproduce

I'm taking the same example from the docs, making only the necessary change to reproduce the error:

/* HelloWorld.re */
let someVariable = "Hello world ";

[@react.component]
let make = (~name) => <h1> (ReasonReact.string(someVariable ++ name)) </h1>;
let default = make;

Notice I'm using a variable at the top level of the module in this demonstration, but module declarations also cause the same error.

The rest of the example remains exactly the same:

/* LazyHelloWorld.re */
module type T = (module type of HelloWorld);

[@bs.val] external component: (module T) = "undefined";

module Lazy: T = {
  include (val component);
  let make = ReLoadable.lazy_(() => DynamicImport.import("./HelloWorld.bs.js"));
  let default = make;
};

/* App.re */
[@react.component]
let make = () => {
  <React.Suspense fallback={<div> (ReasonReact.string("Loading ...")) </div>}>
    <LazyHelloWorld.Lazy name="Zeus" />
  </React.Suspense>;
};

Workarounds

For anyone struggling with this issue, I came up with two workarounds.

  1. Extract all top level declarations to a different module and open it at the top:
/* HelloWorld_Deps.re */
let someVariable = "Hello world ";

/* HelloWorld.re */
open HelloWorld_Deps;

[@react.component]
let make = (~name) => <h1> (ReasonReact.string(someVariable ++ name)) </h1>;
let default = make;
  1. Declare component as a global object (it doesn't matter which one since the values won't actually be used):
/* LazyHelloWorld.re */
module type T = (module type of HelloWorld);

[@bs.val] external component: (module T) = "window";

module Lazy: T = {
  include (val component);
  let make = ReLoadable.lazy_(() => DynamicImport.import("./HelloWorld.bs.js"));
  let default = make;
};

closed time in 2 months

oddlyfunctional

issue commentkMeillet/reason-loadable

Failure when module has other variables exported

Fixed in reason-loadable@1.0.0 : https://github.com/kMeillet/reason-loadable/releases/tag/1.0.0

Be aware that you can only use default export with React.lazy.

Reason-loadable is made to lazy load React component, not JSON or JavaScript code that isn't a React component.

oddlyfunctional

comment created time in 2 months

issue closedkMeillet/reason-loadable

When using this in a project with reason-react v0.8.0, this libraries reliance on v0.7 causes v0.7 to be used globaly

When I used this library in a project with react v0.8 I got the following message from the bsb compilor:

image

And my whole project ends up using v0.7 instead of v0.8.

I can test the upgrade of this and make a PR if you want?

closed time in 2 months

JasoonS

issue commentkMeillet/reason-loadable

When using this in a project with reason-react v0.8.0, this libraries reliance on v0.7 causes v0.7 to be used globaly

Fixed in reason-loadable@1.0.0 : https://github.com/kMeillet/reason-loadable/releases/tag/1.0.0

JasoonS

comment created time in 2 months

created tagkMeillet/reason-loadable

tag1.0.0

🔥 Suspense/Lazy for ReasonReact.

created time in 2 months

release kMeillet/reason-loadable

1.0.0

released time in 2 months

delete tag kMeillet/reason-loadable

delete tag : 0.6.0

delete time in 2 months

delete tag kMeillet/reason-loadable

delete tag : 1.0.0

delete time in 2 months

created tagkMeillet/reason-loadable

tag1.0.0

🔥 Suspense/Lazy for ReasonReact.

created time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 22ebed73bf907c0b851ee405af3eb4be0b7decb4

Update examples

view details

Meillet Robin

commit sha 6a31555a830a2807bd76922be193dec4db07506c

Update CHANGELOG

view details

Meillet Robin

commit sha ed6208b82862321d28a665712c705a74f7d77713

Use reason-loadable@1.0.0 in examples

view details

push time in 2 months

push eventkMeillet/reason-loadable

Meillet Robin

commit sha 581b0a054f1714127e76cfa47e0ae9b81c2ddc3c

Reintroduce lockfiles (package-json.lock & yarn.lock)

view details

Meillet Robin

commit sha 5e7f4b4b6f097dd9d96abdc1106a4515ce714ea5

bsconfig.json upgrade - Remove "bs-dynamic-import" dependency. - Use "bs-react-testing-library" for testing instead of "bs-react-test-renderer". - Change JSX version to 3. Only ReasonReact JSX v3 is supported. Please consider migrating to JSX v3 (new ReasonReact hook components).

view details

Meillet Robin

commit sha 771d35538deaf7efb33387f26081d15883e7d109

Remove "interface" command in package.json

view details

Meillet Robin

commit sha 870a47ca23142fa74f72e9caa483a887cb9b7145

Package.json changes - Update all devDependencies (bs-platform@7.3.2, @glennsl/bs-jest@0.5.1, babel-jest@26.0.1, jest@26.0.1, @babel/core@7.9.6, babel-preset-react-app@9.1.2, react@16.13.1, react-dom@16.13.1, reason-react >= 0.8). - Remove "bs-dynamic-import" dependency. - Remove "bs-react-test-renderer" devDependency. - Add "reason-react" in peerDependencies to avoid package duplication. #84 - Move "react" & "react-dom" into devDependencies. - Add "@komponente/react-hello-world" in devDependency (used for testing external component).

view details

Meillet Robin

commit sha dab5ae1f8e91d32d6b3608fb2359709a5726d7ac

Update tests

view details

Meillet Robin

commit sha aaa07786ab7e0fefc312f5ceab09bc475f9b262f

Remove interface file

view details

Meillet Robin

commit sha 2a17ea662ba0b9392bde828070444be9973779ea

Add new ReLoadable API (import & lazy_)

view details

Meillet Robin

commit sha 77e9b2b54e2f67127fe638ed350b8707c9c9af57

Update refmt script Update refmt shell script to use node_modules bsrefmt instead of globally installed bsrefmt.

view details

Meillet Robin

commit sha b212389f278a5fd07d1ba33ccd9b4b6ebbd2151e

Update README

view details

Meillet Robin

commit sha 7891b76bc9dfe13eae4ad5880d45a915c2ac111e

Update package description

view details

Meillet Robin

commit sha 7bf2ec189bef44a1634a358ecede7a2a2319130a

Bump version to 1.0.0

view details

Meillet Robin

commit sha 3b0ce83391f1bd805b61c5e94ee2d68b5b9cdc70

Update travis configuration to run tests against Node.js v12 (LTS)

view details

Meillet Robin

commit sha fe7c5d7959fd61bbe2c1bf817c42611d61f9ffca

Add npmignore file Add npmignore file (prevent tests & examples to be part of npm artifacts).

view details

Meillet Robin

commit sha 8f8f05e3d43d126290d5f7d053f4a778ffea7ffa

Update tests

view details

Meillet Robin

commit sha ef0a86416346b3f6b51b58dd3ec70ded70cb7aab

Update CHANGELOG

view details

push time in 2 months

issue commentkMeillet/reason-loadable

When using this in a project with reason-react v0.8.0, this libraries reliance on v0.7 causes v0.7 to be used globaly

I'll release an update tonight to solve this issue #84 and #83 .

JasoonS

comment created time in 2 months

startedmicrosoft/winget-cli

started time in 3 months

startedapekros/valorant_offsets

started time in 3 months

startedRust-SDL2/rust-sdl2

started time in 3 months

startedvulkano-rs/vulkano

started time in 3 months

more