Comments (10)
Have you started this yet? I'm taking a stab at it over here https://github.com/matthughes/scalajs-react/tree/v0.12 though I'm pretty new to both react and ScalaJS.
from scalajs-react.
So I haven't gotten very far besides doing some renaming. I've broken the demos by trying to introduce createElement here:
+++ b/core/src/main/scala/japgolly/scalajs/react/vdom/VDomBuilder.scala
@@ -40,6 +40,6 @@ private[vdom] final class VDomBuilder {
def render(tag: String) = {
if (hasStyle) set(props, "style", style)
- React.DOM.applyDynamic(tag)(vdomArgs: _*).asInstanceOf[ReactOutput]
+ React.createElement(tag, null, null).asInstanceOf[ReactOutput]
FYI: I found the type mapping at the bottom of this page helpful https://gist.github.com/sebmarkbage/fcb1b6ab493b0c77d589#react-elements. Though it's a little hard to line up with the types in this project.
from scalajs-react.
Hey Matt. Nah I haven't started on this yet. I haven't looked very deeply so I'm not sure what kind of changes are required but if you're gonna take a determined crack at this do have a look at the unit tests, you'll probably want to add a few more. If you have PhantomJS installed run, them with fastOptStage::test
instead of normal test
, it'll be faster. There's even an SBT alias installed so you just type t
from SBT. :)
from scalajs-react.
Made a bit more progress. Still trying to get key/ref moved into the right place. In 0.11.z, they lived on props, now they just live on the component. Any chance you want to hangout on irc / Google Hangouts to try and make more progress?
from scalajs-react.
Sorry man, firstly I'm more into async communication than sync, unless I'm being paid for it 😉 But more importantly I've got many things on my plate right now that have declared themselves more important. Before too long I will visit this issue.
Some passing advice though, all the types in scalajs-react are about representing the rules and processes of React itself. I usually start by looking at the JS in isolation to understand where everything needs to go and how, then you just enforce that in the type system. I hope that helps, maybe?
from scalajs-react.
Got a coffee, got some good music on, time to have a crack at this.
from scalajs-react.
Nearly there. Few easy things left to do and one very disconcerting issue to fix. I am concerned.
japgolly.scalajs.react.CoreTest.children.argsToComponents.listOfScalatags
Progress so far:
https://github.com/japgolly/scalajs-react/compare/react-0.12
from scalajs-react.
Got it. I believe all the hard stuff is over for this. This issue should be closable soon.
from scalajs-react.
Merged into master.
from scalajs-react.
Btw, thanks @matthughes for the attempt on this. Unfortunately it turned out to be as annoying a change as I'd feared. Way too complex for someone just getting acquainted with both libraries. Thanks for effort.
from scalajs-react.
Related Issues (20)
- Export `assertOuterHTML` HOT 1
- Deprecate `Mounted` component types HOT 2
- Add default arg to `ReactTestUtils.withRendered` HOT 1
- ScalaFnComponent is anonymous HOT 2
- Consider using `DocumentFragments` in `ReactTestUtils` HOT 1
- Re-evaluate `ComponentDom` post- React 18
- Is there a way to integrate Components with cats.effect.Ref? HOT 1
- Ref not always set HOT 2
- Syntax to integrate `useContext` with context function in Scala 3 HOT 1
- Compilation fails in Scala 3 when deriving Reusability for case classes with multiple parameter groups HOT 1
- Missing getDerivedStateFromError
- Missing / misspelled packages in MODULES.md HOT 1
- Add support for Discussions tab in Github HOT 1
- Modern testing recipe?
- Cannot mix static and dynamic routes even if conditional
- A minimal setup fails with Scala 3 HOT 5
- Provide default IO/SyncIO error handler for component
- ScalaFnComponent doesn't include displayName HOT 1
- Another way to define hook components
- AsyncCallback + cats, gracefully handling errors with EitherT: unexpected behaviour HOT 1
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 scalajs-react.