zap icon indicating copy to clipboard operation
zap copied to clipboard

Investigate using the `universal_html` packages

Open simolus3 opened this issue 3 years ago • 2 comments

In preparation for server-side rendering, we need some mechanism to generate components that don't depend on dart:html. This will likely be a build option, but we can make the transition easier by already using universal_html under the hood. universal_html is an alias for dart:html when compiling to the web, but defines compatible APIs for use on the Dart VM too.

With universal_html, we can also make it easier to debug and test zap component logic outside of a browser. It would be interesting to know how much currently breaks when using universal_html, so a investigation would be really helpful.

  • We can probably replace dart:html imports in the zap package.
  • In the zap_dev generator package, we can use the import rewriting mechanism to rewrite dart:html imports in <script> tags with universal html imports.

Some things that would be interesting to know:

  • How many of the current zap components (in this repo) break when using universal_html? Will be a lot of effort to fix them?
  • Can we reliably run tests for some components in the Dart VM when using universal_html?

simolus3 avatar Feb 25 '22 19:02 simolus3

I would love to work on this issue.

aadarshadhakalg avatar Mar 14 '22 08:03 aadarshadhakalg

Awesome, thanks for your help! If you run into any problems, please let me know :)

simolus3 avatar Mar 14 '22 11:03 simolus3