GithubHelp home page GithubHelp logo

paperclip-ui / legacy-paperclip Goto Github PK

View Code? Open in Web Editor NEW
202.0 202.0 13.0 440.25 MB

Paperclip is a common language for designers and developers

Home Page: http://paperclip.dev

License: Other

JavaScript 5.82% TypeScript 74.04% R 0.01% Rust 19.63% CSS 0.27% HTML 0.21% Shell 0.01% Dockerfile 0.01% PHP 0.02%
backend css front-end html javascript react

legacy-paperclip's People

Contributors

crcn avatar dependabot[bot] avatar micahasmith avatar zephraph avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

legacy-paperclip's Issues

diff / patch virtual DOM

TODOS:

  • Rust engine should generate diffs of previous DOM structs
  • Web renderer should receive incremental patches

show all syntax errors

Currently, parsers stop & return syntax errors as they come up; this is terrible DX. Instead, all parsers should store syntax errors in a vector.

[MTI] intellisense

This will require more functionality to the paperclip engine - possible a suggestions() engine prop which looks for patterns in tokens.

TODOS:

  • auto-complete for css prop names
  • auto-complete for reserved CSS keywords
  • auto-complete for imported elements
  • auto-complete for imported mixins
  • auto-complete for CSS variables
  • auto-complete for native elements
  • auto-complete for slot props
  • auto-complete for >>> references
  • auto-complete for importing files

linter

Todos

  • prevent slots for...
    • reserved attributes: id, as, component, export
  • a11y

unicode characters in source file messes up Location

E.g:

<import id="some-component" src="./some-component.pc">
๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰
<some-component />

โ˜๐Ÿป Location of tag name here is incorrect since emojis contain more than one u8 character

inferencing (rust-based)

Todos

  • Replace TS inferencer
  • Hook into Linter

Considerations:

  • Error messages may get annoying for props reserved to code (such as listeners)

virt:Text needs AST location

This is causing errors when meta + click is pressed on text elements in the preview.

Requires location to also be added to evaluated JS values

Explicit export attribute

E.g:

<div export component id="something">
</div>

However, this wouldn't work without the component attribute:

<div export id="something">
</div>

โ˜๏ธ Should result in an error: "component" attribute is needed for export.

Use different identifier than "id"

id conflicts with styling. Instead, maybe as attribute?

<import as="import" src="./something.pc">

<div export component as="something">
</div>

CSS ports

.list {
  ...list-styles
}
<import id="list" src="./list.pc">

<style>
list::list-styles {
  color: red;
}
</style>

React native support

TODOS:

  • react-native preview
  • CSS needs to be compiled to vanilla JS
  • CSS would need to be scoped down since expressions like :nth-child wouldn't work.

Warning when bindings are used outside of component

Since components & exports will need to be explicitly defined (#40, #42), there should be a warning when bindings are used outside of components. For example, this would be invalid:

Hello {message}!

Since there wouldn't be any way to use the {message} binding. Instead, the user would have to define the binding in a component. For example:

<span component id="Message">
  Hello {children}
</span>

โ˜๏ธ This would still display a preview of Hello undefined, but the user could then preview the component like so:

<span component id="Message">
  Hello {children}
</span>

<fragment preview>
  <Message>World!</Message>
</fragment>

component & preview attributes instead of tags

e.g:

<div component="something">
  {thisIsScoped}
</div>

<!-- alternative -->
<div component id="something-else">
  {thisIsScoped}
</div>

<something />

To cover fragments, we can create an explicit tag:

<fragment component id="something">
  some text
 <an-element />
</fragment>

โ˜๏ธ This would replace <></> syntax.

<self /> would also be deprecated since elements are all sitting at the root, you'd just need an id, and component attribute. Previews might look something like this:

<div component id="button">
  {children}
</div>

<fragment preview>
  This is a button: <button>Something</button>
</fragment>

preview and component attributes could also be combined:

<fragment preview component id="some-preview">
</fragment>

โ˜๏ธ There could be some discoverability in the preview UI that looks for all preview elements and allows the user to toggle between them. For example:

<fragment preview component id="MobilePreview" label="Mobile preview">
  <!-- HTML here -->
</fragment>
<fragment preview component id="TabletPreview" label="Tabel Preview">
  <!-- HTML here -->
</fragment>

โ˜๏ธ These preview fragments would also be exported as components.

Better pattern for variant selectors

Not this:

<style>
  div[done] {
    color: red;
  }
</style>

<div {done}>something</div>

Stuff that needs to be covered:

  • style overrides
  • style variants

โ˜ with these two things covered we should be good! ๐Ÿ™Œ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.