Comments (11)
Willing to help on this, any pointers for where to start?
from next.js.
I'm also totally down to getting Inferno fully working with Next as this project is beyond awesome in my opinion. Great work guys :)
from next.js.
Piggybacking off @rektide's work, I was able to get it working by...
git clone https://github.com/zeit/next.js next
cd next
npm install
npm install -i preact-compat/react preact-compat/react-dom preact preact-compat
# comment out HTMLDOMPropertyConfig
npm build # this will fail on the tests, but will still give you a dist/client
# copy that dist/client to whatever app you've got next running on
Some additional work needs to be done to figure out how to make HMR play nice with non-react things. react-hot-loader does some crazy stuff. @developit has minimalist way to make HMR work more universally: preactjs/preact#168 (comment)
I think the big things needed from next are:
- remove the dependency on
HTMLDOMPropertyConfig
, it can just be a map copied into next or a separate module. - replace react-hot-loader with something that just adheres to the HMR API.
from next.js.
This is already possible with simple webpack overrides.
from next.js.
Paging @nkzawa and @arunoda. I think we should think about even documenting in the Wiki what the API surface that we depend on from React is. This will allow people to keep experimenting with engine improvement and minimization :)
from next.js.
@developit I made a list of files importing React that are not tests, examples, or benchmarks:
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/pages/_error.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/client/head-manager.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/server/render.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/lib/side-effect.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/lib/eval-script.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/client/next.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/lib/head.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/pages/_error-debug.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/lib/document.js
https://github.com/zeit/next.js/blob/4b74c70cc9f55a19d4f8305214d2840186af0155/lib/app.js
from next.js.
I started trying to see what this would take to implement. I thought this was going to do it, but not seeing any changes.
https://github.com/rektide/next.js/tree/preact-compat
Update: now getting some test failure:
Error: ./dist/client/head-manager.js
Module not found: Error: Cannot resolve module 'preact-compat/lib/HTMLDOMPropertyConfig' in /home/rektide/src/next.js/dist/client
resolve module preact-compat/lib/HTMLDOMPropertyConfig in /home/rektide/src/next.js/dist/client
looking for modules in /home/rektide/src/next.js/node_modules
resolve 'file' or 'directory' lib/HTMLDOMPropertyConfig in /home/rektide/src/next.js/node_modules/preact-compat
resolve file
/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig doesn't exist
/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig.webpack.js doesn't exist
/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig.web.js doesn't exist
/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig.js doesn't exist
/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig.json doesn't exist
resolve directory
/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig doesn't exist (directory default file)
/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig/package.json doesn't exist (directory description file)
[/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig]
[/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig.webpack.js]
[/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig.web.js]
[/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig.js]
[/home/rektide/src/next.js/node_modules/preact-compat/lib/HTMLDOMPropertyConfig.json]
HTMLDOMPropertyConfig
does not appear in the Preact or preact-compat codebase. It's use in Next.js is exclusively in head-manager. I tried commenting out the import and it's use as so but got 3 other test errors that were a bit harder to decipher: const attr = /*HTMLDOMPropertyConfig.DOMAttributeNames[p] ||*/ p.toLowerCase()
. I still haven't really started figuring out what it's asking for or what React is providing here.
from next.js.
Very impressive @rektide ! Looking forward to seeing this evolve. Ideally we get it down to 2 imports (next-preact
and preact
peer dep) and 1 tweak on the config :)
from next.js.
@matthewmueller Tests pass for me!
from next.js.
That's really amazing (and simple) @matthewmueller
from next.js.
Both inferno
& preact
lack a HTMLDOMPropertyConfig
component, but I'm not sure that they should need to offer one...
from next.js.
Related Issues (20)
- Unable to parse config export in source file HOT 1
- Unable to parse config export in source file HOT 1
- Unable to parse config export in source file HOT 8
- next/link leads to a cached page HOT 1
- While Scrolling back to top in mobile, Next app Breaks! HOT 5
- headers() fails to opt route into dynamic rendering if generateStaticParams for all params is defined in layout
- Using Link/Router with 'shallow' to navigate from pages to app router, when there is a top-level dynamic route under pages, lands on the dynamic route instead
- Using Server action in parallel routes causing unexpected error- [Failed to find Server Action "a944...". This request might be from an older or newer deployment] HOT 1
- App Router: Application crashes with client-side exeption on dynamic import failure HOT 6
- Server action forms resulting in blank `405` page if is JS disabled on Vercel
- TurboPack crashes immediately while compiling any page. Webpack working fine HOT 6
- Improve Metadata API documentation HOT 1
- `<Script />` with `strategy="beforeInteractive"` doesn't get loaded when navigate through router link HOT 2
- "Unsupported OpenType signature wOF2" when loading Inter in opengraph-image
- Docs: NEXT.js HOT 1
- [Partial Prerendering] Error: Runtime exited with error: signal: segmentation fault HOT 1
- Next.js proxy from a different origin with a trailing slash isn't possible
- Client side navigation `router.push()` does not work before/after server action
- generateStaticParams() not detected when using parallel routes / dynamic routes using output: export HOT 2
- Facing An error occured in `next/font`. HOT 2
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 next.js.