Comments (9)
The collect
function is a React higher order component, so couldn't be used to wrap a Stencil component. (I guess it would maybe work but you'd need both React and Stencil loaded).
Regarding the bug...
What version of react-recollect are you using? I accidentally published a version with no dist
directory that was up for about 4 minutes last night :) So if you've got 2.1.1
please update to 2.1.2
.
I haven't tested with Rollup, but if you peek into node_modules/react-recollect/dist/index.js
can you tell me if you see the export? It takes the form
Object.defineProperty(exports, "store", {
enumerable: true,
get: function get() {
return _store.store;
}
});
which is just how Babel does exports.
from react-recollect.
I'm using 2.1.2
when this was created.
Here is dist/index.js
:
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "afterChange", {
enumerable: true,
get: function get() {
return _updating.afterChange;
}
});
Object.defineProperty(exports, "store", {
enumerable: true,
get: function get() {
return _store.store;
}
});
Object.defineProperty(exports, "collect", {
enumerable: true,
get: function get() {
return _collect.collect;
}
});
var _react = _interopRequireDefault(require("react"));
var _logging = require("./logging");
var _updating = require("./updating");
var _store = require("./store");
var _collect = require("./collect");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
if (!window.Proxy) {
console.warn('This browser doesn\'t support the Proxy object, which react-recollect needs. See https://caniuse.com/#search=proxy to find out which browsers do support it');
}
window.__RR__ = {
getStore: _store.getStore,
getListeners: _updating.getListeners,
debugOn: _logging.debugOn,
debugOff: _logging.debugOff
};
Thanks!
from react-recollect.
I wonder if this is a Rollup bug? Surely not as I'm building that dist/index.js file with the default Babel settings so the Object.defineProperty(exports, "store", {
pattern is used in heaps of libraries.
There's a similar error, also related to stencil.js: typestack/class-transformer#200.
I'll try a minimal build using Rollup.
from react-recollect.
Yeah it's weird. If you setup a brand new Stencil "app" project, install recollect and import it, you should be able to repro it. Thanks for investigating!
from react-recollect.
This relates to #44 right? Should we close this?
from react-recollect.
from react-recollect.
Ok cool, let me know when you want me to checkout things 👍
from react-recollect.
I'm going to close this one now. Rollup no longer has a problem.
But for the question in the issue name, react-recollect isn't going to work with anything but React any time soon. The reason: internally it 'knows' which components are reading which properties from the store by tying in very closely with the lifecycle methods, and updates the store at a very specific point in time so that shouldComponentUpdate
and componentDidUpdate
get the previous/next versions of the store and allows React to do its PureComponent magic.
Maybe one day I'll go the Redux route of being UI agnostic, but for now I'll leave as is.
Thanks for your input!
from react-recollect.
Makes sense, I figured it wasn't such a simple sort of thing to get working. Maybe I'll look into it someday... maybe...
from react-recollect.
Related Issues (20)
- Subsequent renders with pure children doesn't recollect data
- Passing store data to a collected component can have unexpected results HOT 1
- CodeMirror onChange event appears to have an outdated store HOT 7
- Collected components re-render when an unused property is created HOT 3
- Checking prop types of non-collected components counts as reads
- Create module/cjs builds in addition to umd
- Some reads in componentDidUpdate aren't getting the old store
- Add better debugging tools
- Top down rendering? HOT 3
- Don't process props in production HOT 1
- PropType Errors Collapsed HOT 1
- Add .back() and .forward() debug tools (time travel)
- How to deal with discriminated union types? HOT 2
- Can you please elaborate on how to convert `redux-saga` to use `react-recollect`? HOT 2
- __RR__.getStore is not a function HOT 1
- Expose a `useStore` hook. HOT 1
- Borrow local to feedback for `Scroll Memory` extension
- Is this project is still active? HOT 2
- Add a useProps function
- <React.Strict> causes "You are attempting to modify the store during a render cycle"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-recollect.