@devvit/play
TypeScript icon, indicating that this package has built-in type declarations

0.0.43 • Public • Published

:play :play

A little playground for building apps on Reddit.

Installation

npm install --save-prefix= @devvit/play

See the changelog for release notes.

Usage

Import play in your JavaScript bundle to define the play-pen element:

import '@devvit/play/pen'

Add a pen to your HTML markup:

<play-pen>
  <script type="application/devvit">
    import {Devvit} from '@devvit/public-api'

    Devvit.addCustomPostType({
      name: 'Say Hello',
      render: () => <text>Hello!</text>
    })

    export default Devvit
  </script>
</play-pen>

Artifacts

Published releases include:

  • play-.*.html: portable playground (Firefox only since v0.0.32).
  • play-pen.js: play-pen element.
  • play.js: library utilities.

Development

npm install
npm start

Visit http://localhost:1234 in your web browser. Run npm test to execute tests.

See supplemental development notes.

NPM scripts

  • install: install play dependencies.
  • start: run development server.
  • test: build play and execute all tests. Anything that can be validated automatically before publishing runs through this command.
  • run test:unit: run the unit tests. Pass --update to update all test snapshots.
  • run test:ui: run the user interface integration tests. Pass --manual to inspect browser and / or a filename to filter.
  • run format: apply lint fixes automatically where available.
  • run build: compile source inputs to artifacts under dist/.

💡 Add -- to pass arguments to the script command. For example, npm run test:unit -- --update to update snapshots.

Project Structure

  • docs/: supplemental play documentation.
  • src/: source inputs.
  • tools/: development tools for building :play.

Contribution Guidelines and Design Principles

  • Make it fun. play must be fun to use and fun to develop. Speed and quality are play's top two features.
  • Avoid dependencies. Dependencies are high-cost integrations. Simply don't add them.
  • Avoid code. Lines of code are costly. We probably can't afford your code if you write a lot of it.
  • Open-source for everyone. This repo was started with the intention to be open-sourced as soon as possible.
    • All dependencies must be available publicly. Avoid closed-source Reddit dependencies.
    • Avoid Reddit-specific branding.
  • Code should be written to be read. We value good context. This often means including short inline or accompanying docs.
  • Keep the interface and outputs plain and simple. play is only a tool. The user's focus is their work.
  • Every commit should be an overall improvement. If every commit is an improvement, the code only gets better.
  • Smaller patches get better reviews.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.2-dev.2023-09-15T2002.95ffef0.00next
0.0.43166latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.43166
0.0.424
0.0.410
0.0.404
0.0.391
0.0.380
0.0.360
0.0.350
0.0.340
0.0.330
0.0.320
0.0.310
0.0.300
0.0.290
0.0.280
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.2-dev.2023-09-15T2002.95ffef0.00
0.0.10

Package Sidebar

Install

npm i @devvit/play

Weekly Downloads

175

Version

0.0.43

License

BSD-3-Clause

Unpacked Size

89.7 MB

Total Files

143

Last publish

Collaborators

  • marcuswood23
  • gunsch
  • krakabek
  • colacadstink
  • securimancer
  • devvit-cli-bot
  • vedreddit
  • niedzielski
  • obsidianx